Nesso-0.4B-Agentic is a bilingual English/Italian Small Language Model (SLM) optimized for function calling, structured output generation, and agentic execution patterns. It is post-trained on top of Zagreus-0.4B-ita, a foundational model trained from scratch by the mii-llm community (Made in Italy – Large Language Model) on the Seeweb HPC infrastructure.
Designed for sovereign edge inference, Nesso-0.4B-Agentic targets deployment scenarios that require reliable tool use, structured JSON output, and multi-step agentic reasoning — all within a compact ~400M parameter footprint.
⚠️ This model is currently at the SFT (Supervised Fine-Tuning) stage. DPO (Direct Preference Optimization) training is planned and updated results will be published upon completion.
Model Details
Property
Value
Architecture
Modified Llama-3.2 (fully dense)
Parameters
~400M
Hidden size
960
Layers
32
Attention heads
15 (KV heads: 5)
Context length
4096 tokens
Tokenizer
Llama-3.2 (vocab_size: 128,256)
Precision
BF16
Languages
English, Italian
Base model
mii-llm/zagreus-0.4B-ita
Post-training framework
Axolotl + FSDP
Chat template
ChatML
Training Details
Base Model Pre-training
Nesso-0.4B-Agentic is built on Zagreus-0.4B-ita, which was pre-trained on approximately 1 trillion tokens using the following data mix:
Token distribution: ~400B English + ~400B Italian + ~200B Code Infrastructure: 64× NVIDIA A100 GPUs (8 nodes × 8 GPUs) on Seeweb HPC Framework: Nanotron (mii-llm fork)
Post-training (SFT)
Post-training was performed using Axolotl with FSDP across 4 nodes (32× A100 GPUs).
The instruction dataset is a proprietary bilingual (English/Italian) corpus curated by the mii-llm team, with dedicated focus on function calling, structured JSON output, tool orchestration, and agentic execution patterns. This dataset was built through years of iteration across domains including finance, cybersecurity, and multi-step agentic workflows, and is considered a strategic research asset not released as open source.
Key hyperparameters:
Hyperparameter
Value
Optimizer
AdamW (fused)
Learning rate
1e-3
LR scheduler
Cosine (constant ratio: 0.8, min ratio: 0.3)
Epochs
3
Micro batch size
1
Gradient accumulation steps
8
Sequence length
4096
Max grad norm
1.0
Precision
BF16 + Flash Attention
FSDP strategy
FULL_SHARD
Chat Template
This model uses the ChatML format:
<|im_start|>system
You are a helpful assistant with access to tools.<|im_end|>
<|im_start|>user
What is the weather in Rome today?<|im_end|>
<|im_start|>assistant
Special tokens:
pad_token: <|im_end|>
eos_token: <|im_end|>
Usage
python
1from transformers import AutoTokenizer, AutoModelForCausalLM
2import torch
34model_id ="mii-llm/nesso-0.4B-agentic"56tokenizer = AutoTokenizer.from_pretrained(model_id)7model = AutoModelForCausalLM.from_pretrained(8 model_id,9 torch_dtype=torch.bfloat16,10 device_map="auto"11)121314import re
1516defchat(messages, tools=None, max_tokens=256):17 prompt = tokenizer.apply_chat_template(18 messages,19 tools=tools,20 tokenize=False,21 add_generation_prompt=True22)2324 inputs = tokenizer(prompt, return_tensors="pt").to(model.device)2526 outputs = model.generate(27**inputs,28 max_new_tokens=max_tokens,29 do_sample=False,30 temperature=0.5,31 top_p=1.0,32 eos_token_id=tokenizer.eos_token_id,33 pad_token_id=tokenizer.eos_token_id,34)3536 text = tokenizer.decode(outputs[0], skip_special_tokens=False)3738 blocks = re.findall(39r"<\|im_start\|>assistant\s*(.*?)<\|im_end\|>",40 text,41 flags=re.S
42)4344 answer = blocks[-1].strip()if blocks else text.strip()4546print("\n=== RAW OUTPUT ===\n")47print(text)48print("\n=== PARSED ASSISTANT ===\n")49print(answer)5051return answer
5253system_prompt =(54"Sei un assistente che può usare strumenti.\n"55"Quando servono informazioni esterne, chiama una funzione.\n"56"Usa ESATTAMENTE il formato <tool_call> previsto."57)5859# ----- TOOL DEFINITIONS -----60tools =[61{62"type":"function",63"function":{64"name":"get_weather",65"description":"Ritorna il meteo per una città",66"parameters":{67"type":"object",68"properties":{69"city":{"type":"string"}70},71"required":["city"]72}73}74}75]7677# ----- MESSAGES -----78messages =[79{"role":"system","content": system_prompt},80{"role":"user","content":"Che tempo fa a Milano?"}81]8283out = chat(messages, tools=tools)
💡 Tip: For function calling and structured output tasks, we recommend using a lower temperature (0.1–0.3) to improve JSON validity and output consistency.
Nesso-0.4B-Agentic is trained with a specialization trade-off: its post-training data prioritizes structured output fidelity, tool calling accuracy, and agentic planning over general benchmark performance. As a result, scores on standard academic benchmarks (IFEval, MMLU, ARC) are lower than the instruct variant, which is expected behavior for a task-specialized model.
Nesso-0.4B-Agentic still outperforms LiquidAI/LFM2-350M across all benchmarks in both languages, confirming its quality as a competitive small model. Its real-world advantage over general-purpose models of similar size is best assessed on agentic and function-calling tasks rather than academic benchmarks.
If you use this model in your research, please cite:
bibtex
1@misc{nesso2025,
2 title = {The Joy and Pain of Training an LLM from Scratch:
3 A Technical Report on the Zagreus and Nesso Model Families},
4 author = {mii-llm community},
5 year = {2025},
6 howpublished = {\url{https://github.com/mii-llm/zagreus-nesso-slm}},
7}
Acknowledgements
Antonio Baldassarra (CEO, Seeweb) and Marco Cristofanilli (Head of AI, Seeweb) for infrastructure sponsorship
The Hugging Face team for Nanotron, datatrove, FineWeb, and FineWeb-2