Instructions to use ericrisco/gemma-maia-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ericrisco/gemma-maia-12b with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("unsloth/gemma-4-12b-it") model = PeftModel.from_pretrained(base_model, "ericrisco/gemma-maia-12b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use ericrisco/gemma-maia-12b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ericrisco/gemma-maia-12b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M # Run inference directly in the terminal: llama cli -hf ericrisco/gemma-maia-12b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf ericrisco/gemma-maia-12b:Q4_K_M
Use Docker
docker model run hf.co/ericrisco/gemma-maia-12b:Q4_K_M
- Llama new
- LM Studio
- Jan
- vLLM
How to use ericrisco/gemma-maia-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ericrisco/gemma-maia-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ericrisco/gemma-maia-12b", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ericrisco/gemma-maia-12b:Q4_K_M
- Ollama
How to use ericrisco/gemma-maia-12b with Ollama:
ollama run hf.co/ericrisco/gemma-maia-12b:Q4_K_M
- Unsloth Desktop
- Pi
How to use ericrisco/gemma-maia-12b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "ericrisco/gemma-maia-12b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use ericrisco/gemma-maia-12b with Docker Model Runner:
docker model run hf.co/ericrisco/gemma-maia-12b:Q4_K_M
- Lemonade
How to use ericrisco/gemma-maia-12b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull ericrisco/gemma-maia-12b:Q4_K_M
Run and chat with the model
lemonade run user.gemma-maia-12b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use ericrisco/gemma-maia-12b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default ericrisco/gemma-maia-12b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use ericrisco/gemma-maia-12b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf ericrisco/gemma-maia-12b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "ericrisco/gemma-maia-12b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
gemma-maia-12b
LoRA adapter of maia, a model specialised in Andorra built from Gemma 4. Experimental: not a final model yet.
This card describes the latest version, 20261104-0036-12b-k-canon.
Every training run is a tagged version of this repo:
20261104-0036-12b-k-canon
Load a specific version with revision="<tag>".
- Base model:
unsloth/gemma-4-12b-it - Data: variant K-canon of the
training-dataexport (conversations in Andorran Catalan) - Code: github.com/ericrisco/maia, with a training guide
- The whole process, including what failed: how maia was trained
Evaluation
Both models were run as Q4_K_M GGUF through Ollama, at temperature 0, under the same conditions.
Read this first. The 43.3 % below overstates what the model learned. This run added multiple-choice practice about the canon facts, and many of those questions resemble benchmark questions because both ask about the same facts. On the questions without a similar practice question, the gain almost disappears: +0.8 points, 95 % CI [โ2.6, +4.1], which is not statistically significant.
Fact recall on 338 held-out questions about facts of the augmented canon (asked in wording never seen in training; a correct answer must contain the expected keywords):
| Gemma 4 12B (base) | maia (20261104-0036-12b-k-canon) |
|
|---|---|---|
| Facts recalled | 41 / 338 (12 %) | 160 / 338 (47 %) |
maia recalls 126 facts the base model misses and misses 7 the base model knew.
maia-bench (926 questions about Andorra, judge Gemini 3.8 Flash; the benchmark questions and the articles it reserves are never trained on):
| Question type | Gemma 4 12B (base) | maia | Difference (95 % CI, paired bootstrap) |
|---|---|---|---|
| All | 37.4 % | 43.3 % | +5.9 pts [+2.8, +8.9] |
| Multiple choice (604) | 51.5 % | 60.3 % | +8.8 pts [+4.6, +13.1] |
| Open (231) | 13.0 % | 13.9 % | +0.9 pts [โ2.8, +4.5] |
| Trap (91) | 6.0 % | 5.5 % | โ0.5 pts [โ5.5, +3.8] |
Where the gain comes from. Similarity is the word overlap (Jaccard, words of 3 letters or more) between a benchmark question and its closest practice question:
| Benchmark questions | n | Difference (95 % CI) |
|---|---|---|
| Multiple choice, similarity 0.2 or more | 341 | +14.7 pts [+8.8, +20.5] |
| Multiple choice, similarity below 0.2 | 263 | +1.1 pts [โ5.3, +8.0] |
| All without a similar practice question (below 0.2, plus open and trap) | 585 | +0.8 pts [โ2.6, +4.1] |
| Topics the training data never covers | 82 | โ3.1 pts [โ11.0, +4.9] |
The training run with the same facts and no multiple-choice practice scored 35.0 %, and it answered with a sentence instead of a letter in 67 of the 604 multiple-choice questions. This version never does. So the model now keeps the answer format and recalls many more taught facts, but it is not yet better at Andorran knowledge it was not taught.
Training
QLoRA with Unsloth on 1 NVIDIA L4. The loss is computed on the model's responses only.
| Parameter | Value |
|---|---|
| LoRA r / alpha | 32 / 32 |
| Epochs | 2 |
| Learning rate | 0.0002 (cosine, 3 % warmup) |
| Effective batch | 16 (2 x 8) |
| Max length | 2048 tokens |
| Chat template | gemma-4 |
| Seed | 3407 |
Final validation loss: 1.4610
| Step | Epoch | Validation loss |
|---|---|---|
| 200 | 0.11 | 1.7489 |
| 400 | 0.21 | 1.6254 |
| 600 | 0.32 | 1.5768 |
| 800 | 0.42 | 1.5508 |
| 1000 | 0.53 | 1.5442 |
| 1200 | 0.63 | 1.5227 |
| 1400 | 0.74 | 1.5045 |
| 1600 | 0.85 | 1.4948 |
| 1800 | 0.95 | 1.4825 |
| 2000 | 1.06 | 1.4982 |
| 2200 | 1.16 | 1.4954 |
| 2400 | 1.27 | 1.4871 |
| 2600 | 1.37 | 1.4749 |
| 2800 | 1.48 | 1.4706 |
| 3000 | 1.58 | 1.4681 |
| 3200 | 1.69 | 1.4626 |
| 3400 | 1.80 | 1.4621 |
| 3600 | 1.90 | 1.4610 |
| 3786 | 2.00 | 1.4610 |
System message
The model was always trained with this system message (in Catalan). Use it at inference time too:
Ets maia, un assistent que coneix a fons Andorra: la seva histรฒria, les institucions, la geografia, la cultura i la gent. Respons en catalร , amb naturalitat i amb la parla d'Andorra.
Samples
Generated at the end of training (greedy decoding). Unedited and not fact-checked: some of these answers are wrong or invented, so do not take them as facts about Andorra.
Quรจ รฉs el Consell de la Terra?
รs lโassemblea de representants del paรญs, que es va constituir el 1419.
Quines sรณn les set parrรฒquies d'Andorra?
La llista de parrรฒquies andorranes comenรงa amb Canillo i continua amb Encamp, Ordino, la Massana, Andorra la Vella, Sant Juliร de Lรฒria i Escaldes-Engordany.
Explica'm quรจ era la Querimรฒnia.
Era una assemblea de veรฏns convocada per resoldre un conflicte o una qรผestiรณ comuna. La descripciรณ la presenta com una forma de participaciรณ local, perรฒ no nโespecifica el lloc ni el funcionament concret. Per tant, sabem quรจ era en general, perรฒ no com sโaplicava a una parrรฒquia concreta.
Quรจ es menja per Sant Jordi a Andorra?
La coca massegada, una coca dolรงa farcida de prรฉssec o d'albercoc.
Com va anar la reforma constitucional del 1993?
El Consell General va aprovar el text el 2 de febrer de 1993. Desprรฉs, el poble el va ratificar en referรจndum el 14 de marรง, amb un 70,95% de sรญ i un 24,32% de no. El 5,73% es va declarar abstinent. La Constituciรณ va entrar en vigor lโ1 de gener de 1994.
Usage
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained("ericrisco/gemma-maia-12b", revision="20261104-0036-12b-k-canon", load_in_4bit=True)
Quantized GGUF (Q4_K_M) for llama.cpp or Ollama: maia-12b-Q4_K_M.gguf. With Ollama, use a
Modelfile with FROM ./maia-12b-Q4_K_M.gguf, RENDERER gemma4 and PARSER gemma4, and keep the
system message above.
- Downloads last month
- 89
4-bit