zagreus-3B-sft-v3.2 (private preview)
zagreus-3B is a 3B-parameter bilingual (Italian / English) language model trained from scratch.
This repository holds SFT v3.2: the instruction-tuned, tool-calling, hybrid-thinking version.
Its sister checkpoint is giux78/zagreus-3B-sft-v3.
Status: private test preview, shared for testing only. This is not a release: the license and final recipe are not decided yet, and a newer SFT (math + parallel-call repair) is planned. Feedback on failures is the most useful thing you can send back.
v3 vs v3.2 in one line
| v3 | v3.2 (this model) | |
|---|---|---|
| Personality | Eager tool caller | Calibrated tool caller |
| Strong at | Parallel / multiple calls in one turn, BFCL call accuracy | Knowing when not to call: asks for missing arguments, says when no tool fits, answers directly when no tool is needed |
| Weak at | Calls a tool even when it should ask or refuse | Often emits only the first of several parallel calls |
If you test both, run the same prompts through each. The interesting differences show up in edge cases: missing argument, no suitable tool, and several calls needed at once.
Model details
| Parameters | ~3B |
| Context | 64k tokens with YaRN rope scaling (native 32,768; see "Long context" below) |
| Tokenizer | Llama-3.2 (vocab 128,256) |
| Languages | Italian, English (pretraining also saw ES / FR / PT and code) |
| Pretraining | More than 3 trillion tokens from scratch with nanotron on Seeweb. Stages: base, continued pretraining with more Italian, code and math, a 50B-token anneal, then a 10B-token extension to 32k context |
| SFT | ~13.6B tokens, 8.77M rows, 6,573 steps; LR 5e-5 cosine (min 0.1), warmup 3%, 32k packed sequences, ~2.1M tokens/step, 8 Seeweb nodes |
| SFT data | Italian/English chat (omnia), reasoning traces (think mode), math and code, instruction following, agentic/tool-calling data (Agentic-v2/v4, Italian tool data, When2Call, xLAM, Glaive), and a 20–25% "no-call" block (ask for missing info, decline unavailable tools, answer without tools) |
What changed from v3 to v3.2
- v3.1 added a balanced no-call block, because v3 almost always called a tool. In v3, a missing argument or an unavailable tool was handled correctly 0% of the time on our robot test.
- v3.2 = v3.1 + restored When2Call / xLAM / Glaive rows, with argument types coerced to the schema (numbers and booleans as JSON values, not strings).
How to use
Prompt format
- Llama-3 headers (
<|start_header_id|>…<|end_header_id|>), turns end with<|eot_id|>. - Thinking switch: the system message ends with
/thinkor/no_think.- The default is
/no_think: the template inserts it when you give no flag. - Pass
enable_thinking=Truetoapply_chat_template, or end your system message with/think, to get reasoning in<think>…</think>before the answer.
- The default is
- Tools: pass
tools=[...](OpenAI/JSON-schema function format) toapply_chat_template. The template writes the Hermes-style system prompt the model was trained on, with the tool list inside<tools></tools>.- The model answers with one or more blocks of this form:
<tool_call> {"name": "get_weather", "arguments": {"city": "Roma"}} </tool_call> - Send results back as messages with
role: "tool", one per call, in call order. - Assistant turns with
tool_callsare rendered back into<tool_call>text by the template.
- The model answers with one or more blocks of this form:
- BOS: the template does not emit
<|begin_of_text|>, because the tokenizer adds it. Render withtokenize=False, then calltokenizer(text), to get exactly one BOS (this is how we evaluate).
transformers
import json, re, torch
from transformers import AutoTokenizer, AutoModelForCausalLM
repo = "giux78/zagreus-3B-sft-v3.2"
tok = AutoTokenizer.from_pretrained(repo)
model = AutoModelForCausalLM.from_pretrained(repo, torch_dtype=torch.bfloat16, device_map="auto")
def chat(messages, tools=None, think=False, max_new_tokens=1024):
text = tok.apply_chat_template(messages, tools=tools, add_generation_prompt=True,
enable_thinking=think, tokenize=False)
inputs = tok(text, return_tensors="pt").to(model.device) # adds the single BOS
out = model.generate(**inputs, max_new_tokens=max_new_tokens, do_sample=False)
return tok.decode(out[0, inputs["input_ids"].shape[1]:], skip_special_tokens=True)
# plain chat
print(chat([{"role": "user", "content": "Spiegami in tre frasi cos'è la fotosintesi."}]))
# tool calling
tools = [{"type": "function", "function": {
"name": "get_weather", "description": "Meteo attuale di una città",
"parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}}]
msgs = [{"role": "user", "content": "Che tempo fa a Bologna?"}]
reply = chat(msgs, tools=tools)
calls = [json.loads(m) for m in re.findall(r"<tool_call>\s*(\{.*?\})\s*</tool_call>", reply, re.S)]
print(calls) # [{'name': 'get_weather', 'arguments': {'city': 'Bologna'}}]
# send the result back and get the final answer
msgs += [{"role": "assistant", "content": reply},
{"role": "tool", "content": json.dumps({"temp_c": 14, "sky": "sereno"})}]
print(chat(msgs, tools=tools))
vLLM
vllm serve giux78/zagreus-3B-sft-v3.2 --max-model-len 32768
- With the OpenAI chat endpoint, add
"add_special_tokens": trueto the request body, so the BOS is added. - Pass
"chat_template_kwargs": {"enable_thinking": true}for think mode. - Tool calls arrive as
<tool_call>text incontent. Parse them client-side with the regex above. We have not validated vLLM's built-in tool parsers with this tokenizer:<tool_call>is plain text, not a special token.
Long context (64k)
The model was trained at 32k context and extends to 64k with YaRN rope scaling, with no extra training. On RULER (13 long-context tasks), YaRN ×4 at 64k scores 0.548, close to the native 32k score of 0.578. Single-needle retrieval at 64k is 0.88–1.0.
| RULER (mean of 13 tasks) | 4k | 8k | 16k | 32k | 64k (YaRN ×4) |
|---|---|---|---|---|---|
| zagreus-3B | 0.806 | 0.745 | 0.710 | 0.578 | 0.548 |
(Measured on the pretrained base after the 32k extension. The SFT models share the same weights lineage.)
To enable 64k, set this in config.json, or pass the same values when loading:
"rope_parameters": {"rope_type": "yarn", "factor": 4.0, "original_max_position_embeddings": 32768, "rope_theta": 1000000.0},
"max_position_embeddings": 65536
With vLLM:
vllm serve giux78/zagreus-3B-sft-v3.2 --max-model-len 65536 \
--hf-overrides '{"rope_parameters": {"rope_type": "yarn", "factor": 4.0, "original_max_position_embeddings": 32768, "rope_theta": 1000000.0}, "max_position_embeddings": 65536}'
Keep the default config for prompts under 32k: YaRN is only needed beyond that.
Decoding
- We evaluate with greedy decoding. For tool use, keep
temperature=0. - For chat, light sampling works (for example temperature 0.6–0.7, top_p 0.9–0.95).
- In think mode, prefer sampling (temperature ~0.6) and a generous
max_new_tokens(4–8k). Greedy thinking can loop (see Limitations).
Evaluation (internal harness)
All numbers are %. Greedy decoding. These are our own harness and formulas, not official leaderboard submissions.
| v3.2 | v3 | Villanova2-2B | Domyn-Edge-SFT 4B | |
|---|---|---|---|---|
| BFCL overall (our formula¹) | 37.6 | 38.0 | 40.3 | n/a |
| BFCL non-live / live | 56.4 / 61.5 | 66.2 / 67.7 | 78.1 / 62.0 | n/a |
| BFCL irrelevance (should NOT call) | 82.5 | 68.3 | 81.9 | n/a |
| BFCL parallel / parallel-multiple | 45.0 / 34.0 | 65.5 / 49.0 | – | n/a |
| Robot assistant, bilingual function calling | 80.5 | 71.0 | – | 82.7 |
| Agentic-100 (IT/EN tool battery, no-think) | 95 | 95 | – | 89 |
| WorkBench (multi-step tasks) | 18.5 | 16.1 | 20.2 | n/a |
| Agentic dev sets en / it / v4 | 61.5 / 66.0 / 63.6 | 61.0 / 64.1 / 63.2 | 43.9 / 38.9 / 52.2 | n/a |
| IFEval (inst-level loose) | 77.0 | 79.0 | 83.1 | 84.8 |
| MMLU / MMLU-it | 54.8 / 51.4 | 54.4 / 51.1 | 53.3 / 50.9 | 59.9 / 49.9 |
| HellaSwag / HellaSwag-it² | 66.2 / 60.2 | 66.1 / 60.2 | 69.0 / 62.1 | 63.7 / 47.4 |
| ARC-Challenge / ARC-it² | 45.9 / 45.0 | 46.8 / 44.9 | 47.5 / 47.1 | 37.5 / 32.6 |
| HumanEval (pass@1) | 46.3 | 45.1 | 43.3 | 38.4 |
| MBPP (3-shot, pass@1) | 36.0 | 36.2 | 41.6 | 41.8 |
¹ BFCL overall = (non-live + live + irrelevance + 3 × multi-turn) / 6, on the same prompt format as training.
² Academic rows use lm-eval-harness, bf16, without the chat template: MMLU / MMLU-it 5-shot accuracy, HellaSwag and ARC 0-shot acc_norm, HumanEval 0-shot, MBPP 3-shot. Domyn-Edge-SFT is run with its BOS token added (its tokenizer does not prepend it, and without it the model collapses on these tests).
Robot benchmark, v3 → v3.2: function calling IT 63.4 → 73.8, EN 69.6 → 84.0; conversation IT 77.1 → 81.2, EN 89.6 → 87.5. Most of the gain comes from cases where the right move is to ask or decline: v3 scored 0/6 on both "missing argument" and "unavailable tool". Correct abstention is what v3.2 was built for.
Known limitations
- Parallel calls: when a request needs several calls at once, v3.2 often emits only the first call and stops. v3 is better here.
- Multi-turn BFCL is low (5–12%) for every version so far.
- Math / arithmetic over tool results: the model can mis-total numbers it got from tools (prices, currencies, scaling a recipe). Double-check computed numbers. A dedicated math evaluation is running now.
- Think mode can produce very long traces, loop ("Wait…"), and drift into English while reasoning, even on Italian prompts. Use no-think mode for everyday use.
- Knowledge is bounded by a 3B model (MMLU ~55). It can state wrong facts confidently. Instruction following (IFEval) is behind some 2–4B peers.
- Not safety-tuned beyond the SFT data (no RLHF/DPO yet). Do not use for medical, legal or financial decisions.
- Not yet evaluated on v3.2: chat LLM judge, healthcare battery, ARC / HumanEval / MBPP. v3's numbers for these are in its model card.
Contact
Private preview by the zagreus project. Please report bad outputs together with the exact messages, tools and settings you used.