Instructions to use br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", trust_remote_code=True, device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder
- SGLang
How to use br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder with Docker Model Runner:
docker model run hf.co/br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder
Use Docker
docker model run hf.co/br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder🧠 NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder
A Fine-Tuned Model for Enhanced Tool Calling, Code Generation, and Reasoning
- Author: Bruno Pistone
- Repository: br1-pist/NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder
- License: NVIDIA Nemotron Open Model License (inherited from the base model)
- Base model: nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16
Model Description
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.
Highlights
- Post-trained with DPO using chosen/rejected pairs harvested from real agentic sessions
- Preference data reflects actual tool-calling traces, not synthetic prompts
- LoRA adapters merged into the base weights — usable as a standard
transformerscheckpoint - Retains the base model's thinking mode and 262K context window
- Excellent balance between tool use, code generation, and reasoning
🚀 Direct Use
NVIDIA-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)
⚠️ Out-of-Scope Use
- ❌ Highly sensitive or confidential data
- ❌ Domains requiring expert-level specialization
- ❌ Tasks where full explainability is mandatory
💻 Getting Started
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).
🧠 Training Details
Training Procedure
Phase 1 — Post-Training - Direct Preference Optimization (DPO)
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):
5248tokens (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 size2per device) - Max grad norm:
0.5 - Weight decay:
0.01 - Gradient checkpointing: enabled
- Precision:
bfloat16(bf16: true,tf32: true) - Evaluation: every
10steps - Checkpointing: every
10steps (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
bfloat16base)
Distributed strategy (FSDP)
full_shard auto_wrap- Wrapped layer class:
NemotronHBlock reshard_after_forward: true(FSDP2)- CPU offload / CPU RAM-efficient loading: disabled
DPO Data
- Chosen/rejected response pairs collected from real conversations with my agentic coding tool
- Chosen samples: responses that produced correct tool calls, valid code, and coherent reasoning in the actual session
- Rejected samples: failed or degraded turns from the same sessions (wrong/malformed tool calls, incoherent or verbose answers)
Objective
- Encourage the model to prefer chosen completions
- Improve clarity, correctness, and helpfulness
- Reduce hallucinations, malformed tool calls, and verbosity
🖥️ Technical Specifications
Model Architecture
- Model type: Causal language model — hybrid Mamba-2 / Attention / MoE (
NemotronHForCausalLM) - Parameters: ~30B total, ~3B active per token (A3B)
- Layers: 52 (
MEMEM*EMEMEM*...— Mamba-2M, self-attention*, MoEE) - Hidden size: 2688 · attention heads: 32 · KV heads: 2 (GQA)
- MoE: 128 routed experts, top-6 routing + 1 shared expert
- Vocabulary: 131,072 tokens
- Context length: 262,144 tokens (~256K)
- Precision:
bfloat16 - Thinking mode: Enabled
Compute Infrastructure
Hardware
- 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
🧾 Citation
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
🧭 Recommendations
- Tool use accuracy depends on task complexity
- Code generation may occasionally produce minor syntax issues
- Reasoning strongest in structured, logical, and mathematical contexts
- DPO data comes from a single agentic tool, so preferences may reflect that tool's conventions
- Avoid using this model for confidential or safety-critical applications
- Use of this model is subject to the NVIDIA Nemotron Open Model License
🧠 NVIDIA-Nemotron-3-Nano-30B-A3B-AgentCoder — created by Bruno Pistone
Enhanced reasoning, tool calling, and code generation — refined with DPO alignment
- Downloads last month
- 20
Model tree for br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder
Base model
nvidia/NVIDIA-Nemotron-3-Nano-30B-A3B-BF16
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "br1-pist/NVIDA-Nemotron-3-30B-Nano-AgentCoder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'