22 Downloads Updated 2 weeks ago
ollama run brnpistone/NVIDIA-Nemotron-3-Nano-30-AgentCoder-q5-k-m
ollama launch claude --model brnpistone/NVIDIA-Nemotron-3-Nano-30-AgentCoder-q5-k-m
ollama launch opencode --model brnpistone/NVIDIA-Nemotron-3-Nano-30-AgentCoder-q5-k-m
ollama launch hermes --model brnpistone/NVIDIA-Nemotron-3-Nano-30-AgentCoder-q5-k-m
ollama launch openclaw --model brnpistone/NVIDIA-Nemotron-3-Nano-30-AgentCoder-q5-k-m
NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder is a fine-tuned version of the NVIDIA Nemotron-3-Nano-30B-A3B hybrid Mamba-2 / Attention / MoE model, optimized for: - 🧮 Complex reasoning tasks - 🧰 Tool calling - 💻 Code generation
The model was post-trained with Direct Preference Optimization (DPO) on preference pairs collected from real conversations with my own agentic coding tool, to improve alignment, coherence, and reasoning accuracy on agentic workflows.
transformers checkpointNVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder can be used directly for: - ✅ Tool calling in complex, multi-step agentic tasks - ✅ Code generation for Python, JS, and other languages - ✅ Multi-domain reasoning (math, logic, Q&A)
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
model_name = "br1-pist/NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(
model_name,
torch_dtype="auto",
device_map="auto",
trust_remote_code=True
)
prompt = "Give me a short introduction to large language models."
messages = [{"role": "user", "content": prompt}]
text = tokenizer.apply_chat_template(
messages,
tokenize=False,
add_generation_prompt=True,
enable_thinking=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
generated_ids = model.generate(**model_inputs, max_new_tokens=1024)
output = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
print(output)
The chat template supports tool calling (pass tools=[...] to apply_chat_template) and thinking mode
(enable_thinking=True / False, with truncate_history_thinking to drop reasoning traces from previous turns).
The model underwent a DPO phase to enhance response alignment, reasoning robustness, and factual consistency on agentic tool-calling tasks. Training used LoRA adapters under FSDP full sharding, later merged into the base weights.
DPO objective
- Beta: 0.1 (KL penalty strength)
- Loss type: sigmoid
- Max sequence length (prompt + completion): 5248 tokens (p95 of the dataset)
- Attention implementation: kernels-community/flash-attn3
Optimization
- Learning rate: 2.45e-6
- LR scheduler: cosine
- Warmup steps: 4
- Epochs: 1
- Per-device train / eval batch size: 1
- Gradient accumulation: 2 (effective batch size 2 per device)
- Max grad norm: 0.5
- Weight decay: 0.01
- Gradient checkpointing: enabled
- Precision: bfloat16 (bf16: true, tf32: true)
- Evaluation: every 10 steps
- Checkpointing: every 10 steps (save_total_limit: 1)
LoRA configuration
- Rank (r): 16
- Alpha: 32
- Dropout: 0.1
- Target modules: q_proj, k_proj, v_proj, o_proj, in_proj, out_proj
(attention projections + Mamba-2 in/out projections)
- Quantization: none (no 4-bit / MXFP4 — full bfloat16 base)
Distributed strategy (FSDP)
- full_shard auto_wrap
- Wrapped layer class: NemotronHBlock
- reshard_after_forward: true (FSDP2)
- CPU offload / CPU RAM-efficient loading: disabled
Objective - Encourage the model to prefer chosen completions - Improve clarity, correctness, and helpfulness - Reduce hallucinations, malformed tool calls, and verbosity
NemotronHForCausalLM)MEMEM*EMEMEM*... — Mamba-2 M, self-attention *, MoE E)bfloat16Hardware - GPU: NVIDIA H100 (80 GB VRAM) - System RAM: 2 TiB - Memory per vCPU: 10.67 GiB
Software
- Python: 3.12
- Transformers: 5.13.1
- Libraries: peft, trl, torch, safetensors, accelerate, kernels, flash-attn3, tokenizers, psutil
BibTeX
@article{nemotron3-nano-30b-a3b-agentcoder,
title={NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder: A Fine-Tuned Model for Enhanced Tool Calling, Code Generation, and Reasoning},
author={Bruno Pistone},
year={2026},
journal={Hugging Face Model Hub}
}
APA
Bruno Pistone. (2026). NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder: A Fine-Tuned Model for Enhanced Tool Calling, Code Generation, and Reasoning. Hugging Face Model Hub. https://huggingface.co/br1-pist/NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder
🧠 NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder — created by Bruno Pistone
Enhanced reasoning, tool calling, and code generation — refined with DPO alignment