37 6 days ago

Q4_K_M and BF16 quantizations of NVIDIA Nemotron Nano 9B v2, NVIDIA’s open 9B reasoning model. Q4 quantized locally from the BF16 source and tuned for a single 16 GB GPU card with maximum KV cache.

tools thinking
ollama run oamazonasgabriel/nemotron-nano-9b-v2:bf16

Details

1 week ago

007175a6bfc3 · 18GB ·

nemotron_h
·
8.89B
·
BF16
You are NVIDIA Nemotron Nano 9B v2, a fast, helpful, and honest AI assistant developed by NVIDIA. Yo
NVIDIA Open Model License Copyright (c) 2025 NVIDIA Corporation. All rights reserved. By using this
{ "num_ctx": 131072, "num_gpu": 99, "num_predict": 4096, "repeat_penalty": 1, "t

Readme

NVIDIA Nemotron Nano 9B v2 — Ollama Model (Q4_K_M, single 16 GB GPU)

Model: oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU

Ollama Built by impacte.tech


DESCRIPTION

A Q4_K_M build of NVIDIA Nemotron Nano 9B v2, NVIDIA’s open 9B reasoning model, quantized locally from the BF16 source and tuned for a single 16 GB GPU card with maximum KV cache. The Q4_K_M weights (6.53 GB) fit entirely on a 16 GB GPU — verified 100% GPU / 0% CPU offload — leaving ~9 GB of VRAM for a large KV cache. Uses the hybrid Mamba-2 + attention architecture for efficient long-context inference.

The ideal single-16GB-GPU reasoning companion for: RTX 5060 Ti 16GB · RTX 4080 · RTX 5080 · RTX 4090 · any NVIDIA setup with 16 GB VRAM

Key Features

  • Q4_K_M quantization: 6.53 GB weights — fits entirely on a single 16 GB GPU with ~9 GB left for KV cache
  • Hybrid Mamba-2 + Attention: dense 9B model with efficient long-context inference
  • 128K native context (131,072 tokens)
  • Thinking mode: On by default — thinking… response reasoning blocks, returned by Ollama as message.thinking
  • Native tool calling: <tool_call> XML format, parseable with the qwen3_coder parser used by agent harnesses (OpenCode, OpenClaw, Hermes Agent, Claude Code)
  • /think & /no_think controls: force or skip extended reasoning per request
  • NVIDIA Open Model License: free for commercial and personal use

Architecture

Property Value
Architecture nemotron_h — hybrid Mamba-2 + Attention (dense, non-MoE)
Total Parameters 8.89B (all active)
Layers 56
Hidden Size 4,480
Native Context 131,072 tokens (128K)
Modalities Text
Quantization Q4_K_M (~6.53 GB)
Model Size ~6.53 GB (weights)
License NVIDIA Open Model License
Upstream nvidia/NVIDIA-Nemotron-Nano-9B-v2

REQUIREMENTS

Resource Minimum Recommended
GPU Memory 16 GB VRAM 16 GB+ VRAM
System RAM 16 GB 32 GB
Disk Space 8 GB free 16 GB+ free
NVIDIA Driver 525+ 550+
Ollama Version 0.30.6+ Latest

Platform support: - NVIDIA GPU (single): 16 GB VRAM (RTX 5060 Ti 16GB, RTX 4080, RTX 5080) — verified 100% GPU / 0% CPU - NVIDIA GPU (dual): 16 GB + 8 GB (RTX 5060 Ti + RTX 4060 Ti) - Apple Silicon: Mac with 16 GB+ unified memory

💡 Why Q4_K_M? This build quantizes the 17.8 GB BF16 source down to 6.53 GB Q4_K_M, so it fits entirely on a single 16 GB GPU with ~9 GB left for KV cache. For the full 128K context, use --no-kv-offload (KV cache in system RAM) via the llama.cpp config in the Hugging Face repo.


QUICK START

1. Install Ollama

# macOS (Homebrew)
brew install ollama

# Linux
curl -fsSL https://ollama.com/install.sh | sh

# Windows
# Download from https://ollama.com/download

2. Pull & Run

# Pull the model (downloads ~6.5 GB)
ollama pull oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU

# Run interactively
ollama run oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU

# Single prompt
ollama run oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU \
  "Explain the difference between Mamba and Transformer architectures"

💡 latest tag: This model is also available as oamazonasgabriel/nemotron-nano-9b-v2 (defaults to latest, the BF16 weights).


USAGE

CLI

# Interactive chat (thinking on by default)
ollama run oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU

# Force extended reasoning
ollama run oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU "/think Solve this step by step: ..."

# Skip reasoning for a direct answer
ollama run oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU "/no_think What is 2+2?"

REST API

# Chat completion
curl -s http://127.0.0.1:11434/api/chat \
  -d '{
    "model": "oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

# OpenAI-compatible endpoint
curl -s http://127.0.0.1:11434/v1/chat/completions \
  -d '{
    "model": "oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU",
    "messages": [{"role": "user", "content": "Hello!"}],
    "stream": false
  }'

Python (ollama library)

pip install ollama
import ollama

# Chat (thinking returned as message.thinking)
response = ollama.chat(
    model='oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU',
    messages=[{'role': 'user', 'content': 'Write a Python function to merge two sorted lists'}],
)
print(response.message.content)

JavaScript (ollama.js)

npm install ollama
import ollama from 'ollama'

const response = await ollama.chat({
  model: 'oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU',
  messages: [{ role: 'user', content: 'Explain recursion with an example' }],
})
console.log(response.message.content)

SAMPLING PARAMETERS

These are baked into the model via its Modelfile:

Parameter Value Rationale
num_ctx 32768 32K context (safe on 16 GB; up to ~65K with q4_0 KV)
num_gpu 99 Offload all layers to GPU
temperature 0.7 Balanced creativity vs coherence
top_p 0.95 Standard nucleus sampling
top_k 40 Focused token selection
repeat_penalty 1.0 No repetition penalty
num_predict 4096 Max output tokens

MEMORY & PERFORMANCE

VRAM Budget (single 16 GB GPU)

Component Size
Model weights (Q4_K_M) ~6.53 GB
KV cache (q4_0, 32K context) ~2 GB
Ollama process overhead ~1-1.5 GB
Total (q4_0 + 32K) ~10 GB ✅ plenty of headroom

Context Window Scaling (q4_0 KV)

On a single 16 GB GPU:

Context KV Cache Fits 16 GB? Notes
16,384 ~1 GB ✅ Plenty ~8.5 GB total
32,768 ~2 GB ✅ Recommended ~10 GB total
65,536 ~4 GB ~12 GB total
131,072 (native) ~8 GB ⚠️ Tight ~15.5 GB total

💡 For the full 128K context, use the llama.cpp config with --no-kv-offload (KV cache in system RAM) — see the Hugging Face repo.

Performance

  • Text generation: ~25-40 tok/s (Q4_K_M, all layers on GPU)
  • Model load time: ~20-30 seconds (~6.5 GB load)

Opencode Integration

Add to ~/.config/opencode/opencode.jsonc:

"oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU": {
  "name": "oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU",
  "options": {
    "supportsThinking": true,
    "contextWindow": 131072
  }
}

Use as agent:

"model": "ollama/oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU"

Or launch directly:

ollama launch opencode --model oamazonasgabriel/nemotron-nano-9b-v2:q4-km-16gbGPU

TROUBLESHOOTING

Model fails to load — “unable to allocate buffer”

Cause: Not enough free VRAM. This is a 6.53 GB Q4_K_M model. Fix: Free at least 8 GB before loading, or reduce num_ctx.

CPU offloading detected

Run ollama ps — if CPU% appears, reduce num_ctx or set OLLAMA_KV_CACHE_TYPE=q4_0.

Slow generation

On 16 GB you should get 25-40 tok/s. If slower: - Check for CPU offloading (ollama ps) - Verify GPU is on CUDA (not Vulkan) - Close competing GPU processes

Want the full 128K context?

Ollama keeps the KV cache in VRAM. For 128K context, use the llama.cpp config with --no-kv-offload (KV cache in system RAM) from the Hugging Face repo.


ALTERNATIVE MODELS

# Smaller / faster Nemotron (MoE, needs 24 GB)
ollama pull oamazonasgabriel/nemotron-3.5-lightning:q4-24gbGPU

# Coding-optimized Qwen (needs 16 GB)
ollama pull oamazonasgabriel/qwen3.5-9b:q4-16gbGPU

# Heavy-lift Qwen (needs 32 GB)
ollama pull oamazonasgabriel/qwen3.8-27b:q4-km-32gbGPU

CREDITS

Role Entity
Base Model NVIDIA
Original Model NVIDIA-Nemotron-Nano-9B-v2
GGUF Conversion impacte.tech — BF16 → Q4_K_M (local llama.cpp quantize)
Ollama Packaging impacte.tech
License NVIDIA Open Model License

LINKS

Resource URL
This model on Ollama https://ollama.com/oamazonasgabriel/nemotron-nano-9b-v2
Upstream model (HuggingFace) https://huggingface.co/nvidia/NVIDIA-Nemotron-Nano-9B-v2
GGUF + llama.cpp config https://huggingface.co/impacte/NVIDIA-Nemotron-Nano-9B-v2-GGUF
Ollama documentation https://docs.ollama.com
Built by impacte.tech