15 Downloads Updated 2 days ago
ollama run dna5rm/granite4.2:3b-8k
dna5rm/granite4.2:3b-8k is a context-optimized derivative of granite4.2:3b that caps the default context window at 8,192 tokens. The base Granite 4.2 3B ships with a 128K context window. Loading at that default on a 12 GB GPU alongside other models causes VRAM pressure from KV cache. This variant sets a conservative 8K default so the model loads predictably without requiring clients to pass options.num_ctx on every request.
No weights are modified. The model retains the full 3.7B parameters (Q4_K_M quantization, 2.2 GB on disk) and all base model capabilities: completion, tool use, and thinking. The full IBM Granite chat template — including document-grounded RAG and function calling with XML-tagged tool call syntax — is preserved.
Same pattern as dna5rm/granite4.1:3b-8k.
| Property | Value |
|---|---|
| Architecture | granite |
| Parameters | 3.7B |
| Quantization | Q4_K_M |
| File Size | 2.2 GB |
| Context Length (native) | 131,072 tokens |
| Context Length (default) | 8,192 tokens |
| Embedding Length | 2,560 |
| License | Apache 2.0 |
<tool_call> syntax<think>…</think> reasoning (Granite 4.2 new vs 4.1)The Granite chat template includes built-in support for:
<tools> XML tags; model responds with <tool_call> JSON blocksdocument role are formatted into <documents> XML and the system prompt instructs the model to answer strictly from provided documentsenable_thinking / reasoning_effort; Ollama /set think and options.think{
"num_ctx": 8192,
"temperature": 1,
"top_p": 0.95
}
Sampling matches upstream Granite 4.2 (temperature 1, top_p 0.95), not the 4.1 enterprise 0.7 default.
For lightweight tool-use, disable thinking per request (think: false or /set nothink) so tokens go to the tool call instead of a chain-of-thought.
The upstream granite4.2:3b defaults to 128K context. The 3B weights are small enough that full context will not overflow a 12 GB card by itself, but 128K still allocates a large KV cache that competes with other models.
On a 12 GB GPU (approx):
| Context | Weights | KV Cache (approx) | Total VRAM |
|---|---|---|---|
| 8,192 | ~2.2 GB | ~0.4 GB | ~2.6 GB |
| 131,072 | ~2.2 GB | ~6.3 GB | ~8.5 GB |
The 8K default keeps the footprint minimal, leaving VRAM headroom for a larger primary model on the same GPU. Clients can still request larger contexts per-call via options.num_ctx.
# Pull
ollama pull dna5rm/granite4.2:3b-8k
# Run
ollama run dna5rm/granite4.2:3b-8k
# API — simple chat (thinking off)
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "dna5rm/granite4.2:3b-8k",
"messages": [{"role": "user", "content": "Write a Python function to check if a number is prime."}],
"think": false
}'
# API — tool use
curl http://localhost:11434/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "dna5rm/granite4.2:3b-8k",
"messages": [{"role": "user", "content": "What is the weather in Charlotte NC?"}],
"think": false,
"tools": [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get current weather for a location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City and state"}
},
"required": ["location"]
}
}
}]
}'
Native Ollama chat API: pass "think": false (or "options": {"think": false} depending on client).
Lightweight agentic and tool-use workloads where a fast, small model is preferred over a large one:
English, German, Spanish, French, Japanese, Portuguese, Arabic, Czech, Italian, Korean, Dutch, Chinese.
Built from granite4.2:3b by IBM. Granite 4.2 is a dense decoder-only family with native multilingual, RAG, tool use, structured JSON, and thinking. Apache 2.0. See the upstream model card for training details.
Sibling variant: dna5rm/granite4.1:3b-8k (3.4B, no thinking capability).