Instructions to use Stee201/lira-gemma3-1b-ita-sipar-3reg with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-3-1b-it") model = PeftModel.from_pretrained(base_model, "Stee201/lira-gemma3-1b-ita-sipar-3reg") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg 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 Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M # Run inference directly in the terminal: llama cli -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M # Run inference directly in the terminal: llama cli -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
Use Docker
docker model run hf.co/Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Stee201/lira-gemma3-1b-ita-sipar-3reg" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Stee201/lira-gemma3-1b-ita-sipar-3reg", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
- Ollama
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg with Ollama:
ollama run hf.co/Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
- Unsloth Desktop
- Docker Model Runner
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg with Docker Model Runner:
docker model run hf.co/Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
- Lemonade
How to use Stee201/lira-gemma3-1b-ita-sipar-3reg with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
Run and chat with the model
lemonade run user.lira-gemma3-1b-ita-sipar-3reg-Q4_K_M
List all available models
lemonade list
- Atomic Chat
LIRA โ Gemma 3 1B, Italian
Italian personal-finance question answering, grounded in material published by CONSOB, that writes the same answer at three different reading levels.
Design label: gemma3-1b_ita_siaddestr_sipar_3reg โ trained with the retrieved paragraphs in the prompt and
with all three registers. This is the deployed configuration of the LIRA system.
What is in this repository
| file | what it is | size |
|---|---|---|
adapter_model.safetensors + adapter_config.json |
the LoRA adapter for google/gemma-3-1b-it |
26 MB |
lira-gemma3-1b-ita-sipar-3reg-Q8_0.gguf |
base model with the adapter merged in, 8-bit | 1069 MB |
lira-gemma3-1b-ita-sipar-3reg-Q4_K_M.gguf |
the same, 4-bit โ about half the space, for phones | 806 MB |
The two GGUF files are the same model, only quantised differently. Pick Q8_0 unless memory is tight.
How to prompt it โ read this first
The adapter is trained for retrieval-augmented use and will not behave correctly without the retrieved passages. Every training example carries six passages in the system prompt, so it has to be prompted the same way:
Sei un assistente di finanza personale. L'utente ha conoscenze di finanza intermedie. Puoi introdurre alcuni termini tecnici, ma sempre accompagnati da una spiegazione.
REGOLE: Rispondi SOLO usando i documenti seguenti. Non inventare. Non dare consigli specifici di investimento. Rispondi in italiano in modo conciso.
DOCUMENTO [<id del passaggio>]:
<testo del passaggio>
DOCUMENTO [<id del passaggio>]:
<testo del passaggio>
... sei in tutto ...
followed by the user's question as a normal user turn.
The sentence about the reader's level is what selects the register. There are three, and they are the exact strings the model was trained on:
| register | sentence |
|---|---|
base |
L'utente ha conoscenze base di finanza. Usa spiegazioni semplici e esempi pratici. Evita termini tecnici o complessi. |
intermediate |
L'utente ha conoscenze di finanza intermedie. Puoi introdurre alcuni termini tecnici, ma sempre accompagnati da una spiegazione. |
advanced |
L'utente ha conoscenze avanzate di finanza personale. Evita spiegazioni eccessivamente basilari, puoi usare termini tecnici e spiegazioni piรน approfondite. |
Swap that sentence and the same question comes back rewritten for that reader โ
shorter and plainer for base, roughly three times longer for advanced.
Quick start
With llama.cpp (4-bit):
llama-server -hf Stee201/lira-gemma3-1b-ita-sipar-3reg:Q4_K_M
With transformers + peft (the adapter on top of the base model):
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
base = "google/gemma-3-1b-it"
model = AutoModelForCausalLM.from_pretrained(base, dtype="float16", device_map="auto")
model = PeftModel.from_pretrained(model, "Stee201/lira-gemma3-1b-ita-sipar-3reg")
tok = AutoTokenizer.from_pretrained(base)
messages = [
{"role": "system", "content": system_prompt_with_six_passages},
{"role": "user", "content": question},
]
ids = tok.apply_chat_template(messages, add_generation_prompt=True, return_tensors="pt")
print(tok.decode(model.generate(ids.to(model.device), max_new_tokens=512)[0]))
Retrieval in the paper is plain BM25 Okapi over 522 CONSOB paragraphs, top 6 โ the same retriever at training and at serving time.
How well it does
| register | correctness | groundedness |
|---|---|---|
| base | 2.83 | 4.21 |
| intermediate | 3.35 | 4.77 |
| advanced | 2.86 | 3.95 |
Judge: Unbabel/M-Prometheus-14B, 1โ5, on 174 held-out questions that appear nowhere in training.
Without the retrieved passages, correctness at intermediate drops to 1.92 (from 3.35): the model is trained to compose its answer out of the documents, so it depends on them.
Groundedness at advanced is lower than at intermediate across all six models. That is
a property of the register, not invention: of the words used in the answers the judge
marked down, only ~1.6% appear in none of the six passages โ the same share as in the
answers it approved.
Training
LoRA rank 8, alpha 16, dropout 0.05, on the attention and feed-forward projections, loss on the answer tokens only. 4 epochs, learning rate 5e-5, checkpoint chosen by lowest validation loss. Passage order is shuffled per example and per epoch.
Training examples are byte-for-byte identical in shape to what the server sends
(persona + level instruction + six documents + question); the base and advanced
variants of each answer were generated by a language model constrained to rephrase only
the aligned source paragraph, then filtered by six automatic checks.
Limitations
- It needs its passages. Correctness without them is far below the numbers above.
- It is grounded in CONSOB material only, and answers nothing outside it.
- It gives no specific investment advice, by construction, and must not be used as financial advice.
- The judge is a model (
M-Prometheus-14B), not a human panel.
The other five models
Stee201/lira-gemma3-270m-ita-sipar-3regโ Gemma 3 270M, ItalianStee201/lira-gemma3-270m-ing-sipar-3regโ Gemma 3 270M, EnglishStee201/lira-gemma3-1b-ing-sipar-3regโ Gemma 3 1B, EnglishStee201/lira-smollm3-3b-ita-sipar-3regโ SmolLM3 3B, ItalianStee201/lira-smollm3-3b-ing-sipar-3regโ SmolLM3 3B, English
The GGUF files contain Gemma 3 weights with the adapter merged in, so they are governed by the Gemma Terms of Use and the Prohibited Use Policy, which carry over to anyone who downloads them. The LoRA adapter alone is our own work.
Replaces Stee201/gemma3-1b-finance-it, which held
the same adapter under the older naming and only the 8-bit file.
- Downloads last month
- 90
4-bit
8-bit