Mistral Nemo 12B: 128K Context Local AI with Ollama
ollama run mistral-nemoWhat Is Mistral Nemo 12B?
Mistral Nemo 12B (also called Mistral NeMo) is a 12.2 billion parameter language model jointly released by Mistral AI and NVIDIA in July 2024. It is a drop-in replacement for Mistral 7B with significantly improved capabilities, most notably a 128K token context window -- one of the longest among models in its parameter class.
The model introduces the Tekken tokenizer, which improves upon the SentencePiece tokenizer used by earlier Mistral models. Tekken is trained on over 100 languages and provides better token efficiency, especially for multilingual text and code. Unlike Mistral 7B, Mistral Nemo does not use sliding-window attention: its config sets sliding_window to null, so every layer attends over the full context, and grouped-query attention (8 key-value heads for 32 query heads) is what keeps the cache manageable.
Key Facts at a Glance
- Developer: Mistral AI + NVIDIA
- Released: July 2024
- Parameters: 12.2 billion
- Context: 128K tokens (131,072)
- License: Apache 2.0 (fully open)
- Tokenizer: Tekken (100+ languages)
- Architecture: Decoder-only transformer
- Instruct variant: Mistral-Nemo-Instruct-2407
- HuggingFace: mistralai/Mistral-Nemo-Instruct-2407
- Ollama:
mistral-nemo
Compared to Mistral 7B v0.3, Mistral Nemo offers stronger reasoning, longer context, and better multilingual performance. However, models like Qwen 2.5 14B and Gemma 2 9B score higher on MMLU. Mistral Nemo's main advantages are its 128K context window (Gemma 2 9B has 8K) and its Apache 2.0 license which allows unrestricted commercial use.
Benchmarks Mistral Published (MMLU, HellaSwag, Winogrande)
Mistral Nemo 12B Benchmark Scores
Source: the base-model card, mistralai/Mistral-Nemo-Base-2407. Mistral's own figures; this site has not run them.
MMLU Comparison: Mistral Nemo vs Local Alternatives
All models in the 7B-14B local parameter range. Each MMLU figure is the developer's own 5-shot result, so treat small gaps as noise.
Analysis: Mistral Nemo 12B scores 68.0% on MMLU, which places it above Llama 3.1 8B (66.7%) and the original Mistral 7B (60.1%), but below Gemma 2 9B (71.3%), Phi-3 Medium 14B (78.0%), and Qwen 2.5 14B (79.7%). Where Mistral Nemo stands out is that it pairs a native 128K context window with an Apache 2.0 license: Llama 3.1 8B matches the context but not the license, and Gemma 2 9B has an 8K context.
VRAM Requirements by Quantization
Mistral Nemo 12B VRAM usage depends on quantization level and on context length. File sizes below are the Ollama registry's for the mistral-nemo:12b-instruct-2407-* tags; the VRAM column is arithmetic (file + 0.67 GB of KV cache at Ollama's default 4K context + about 1 GB of buffers), not a measurement.
| Quantization | VRAM Required | File Size | Quality Impact | Recommended For |
|---|---|---|---|---|
| Q4_K_M | ~9.2 GB | 7.5 GB | Minor loss | Best balance: 12GB GPUs (RTX 3060 12GB / 4070); the default q4_0 (7.1 GB) is similar |
| Q5_K_M | ~10.4 GB | 8.7 GB | Minimal loss | Good quality: 12GB GPUs |
| Q8_0 | ~14.7 GB | 13.0 GB | Near lossless | High quality: 16GB GPUs (RTX 4060 Ti 16GB, RTX 4070 Ti Super) |
| FP16 | ~26 GB | 24.5 GB | Full quality | No loss: RTX 5090 (32 GB), A6000; too big for a 24 GB card |
Tip: The default Ollama download (ollama run mistral-nemo) is the 7.1 GB q4_0 build, the same file as mistral-nemo:12b-instruct-2407-q4_0. With its cache it needs about 8.7 GB, so an 8 GB card runs it only with some layers on the CPU; a 12 GB card holds it. For Apple Silicon Macs (M1/M2/M3), the model runs in unified memory, so 16GB total RAM is sufficient.
Key Technical Features
128K Context Window
Mistral Nemo was trained with a 128K token context window and uses full attention in every layer. That is enough for a long report or a sizeable codebase in a single prompt -- useful for:
- -- Analyzing full legal contracts or research papers
- -- Summarizing entire codebases or documentation
- -- Long-form conversation with full memory
- -- Processing multiple documents simultaneously
Note: the KV cache costs 160 KB per token at f16 (40 layers x 8 KV heads x 128 x 2 x 2 bytes), so the full 128K context adds about 21.5 GB on top of the 7.1 GB model: roughly 30 GB in total.
Tekken Tokenizer
Mistral Nemo replaces SentencePiece with the new Tekken tokenizer, trained on over 100 languages. Key improvements:
- -- Better compression for non-English languages
- -- More efficient code tokenization
- -- Improved handling of multilingual documents
- -- ~30% more efficient on code, Chinese, Italian, French, German, Spanish and Russian; 2x on Korean, 3x on Arabic (Mistral's figures)
This means Mistral Nemo can process more text per context window compared to models using SentencePiece or BPE tokenizers.
Apache 2.0 License
Unlike models with restricted licenses (e.g., Llama 3.1's custom license), Mistral Nemo uses the Apache 2.0 license:
- -- Full commercial use with no restrictions
- -- No user count limits
- -- Can modify, distribute, and sublicense
- -- No requirement to share model outputs
Mistral + NVIDIA Collaboration
Mistral Nemo is a joint release between Mistral AI and NVIDIA. This collaboration brings:
- -- Optimized for NVIDIA TensorRT-LLM inference
- -- Available via NVIDIA NIM microservices
- -- Pre-built containers for enterprise deployment
- -- Trained with quantisation awareness for FP8 inference without loss (Mistral)
How to Run Mistral Nemo 12B Locally
The easiest way to run Mistral Nemo 12B is with Ollama. One command downloads the 4-bit q4_0 model (7.1 GB) and starts it.
Install Ollama
Download from ollama.com or use the install script
Run Mistral Nemo
Download and run the model (auto-pulls the 7.1 GB q4_0 build)
Verify the model
List installed models to confirm
Use via API (optional)
Access via Ollama REST API on port 11434
Terminal Example
Python Integration
import ollama
# Simple chat
response = ollama.chat(
model='mistral-nemo',
messages=[{
'role': 'user',
'content': 'Summarize the key features of Apache 2.0 license'
}]
)
print(response['message']['content'])
# Streaming response
for chunk in ollama.chat(
model='mistral-nemo',
messages=[{'role': 'user', 'content': 'Explain grouped-query attention'}],
stream=True
):
print(chunk['message']['content'], end='')
Ollama Modelfile (Custom Settings)
# Create a Modelfile for custom config cat > Modelfile << 'EOF' FROM mistral-nemo # Set parameters PARAMETER temperature 0.7 PARAMETER top_p 0.9 PARAMETER num_ctx 8192 PARAMETER stop "</s>" SYSTEM """You are a helpful assistant focused on clear, accurate responses.""" EOF # Build and run custom model ollama create my-nemo -f Modelfile ollama run my-nemo
Context Window Note: Ollama picks a default context from your VRAM: 4K under 24 GiB and 32K between 24 and 48 GiB, per its documentation. To change it, set num_ctx in a Modelfile or use /set parameter num_ctx 32768 during a chat session. A 32K context adds about 5.4 GB of KV cache and the full 128K about 21.5 GB.
Local AI Alternatives Comparison
How Mistral Nemo compares to other local models you can run via Ollama in the 7B-14B range. All models listed are free to download and run locally.
| Model | Download | Memory | Speed | MMLU (source) | Licence |
|---|---|---|---|---|---|
| Mistral Nemo 12B (mistral-nemo) | 7.1 GB | ~8.7 GB at 4K | ~51 tok/s ceiling | 68.0 (Mistral) | Apache 2.0 |
| Llama 3.1 8B (llama3.1) | 4.9 GB | ~6.4 GB at 4K | ~73 tok/s ceiling | 66.7 (Meta, base) | Llama 3.1 Community |
| Gemma 2 9B (gemma2:9b) | 5.4 GB | ~7.9 GB at 4K | ~66 tok/s ceiling | 71.3 (Google) | Gemma Terms |
| Qwen 2.5 14B (qwen2.5:14b) | 9.0 GB | ~10.8 GB at 4K | ~40 tok/s ceiling | 79.7 (Qwen, base) | Apache 2.0 |
| Phi-3 Medium 14B (phi3:14b) | 7.9 GB | ~9.7 GB at 4K | ~46 tok/s ceiling | 78.0 (Microsoft) | MIT |
Speeds are bandwidth ceilings on an RTX 3060 12GB (360 GB/s ÷ file size), not measurements; real runs land below them.
Detailed Local Alternatives
| Model | MMLU | VRAM (Q4) | Context | Ollama Command | Best For |
|---|---|---|---|---|---|
| Mistral Nemo 12B | 68.0% | ~8.7GB | 128K | ollama run mistral-nemo | Long documents, multilingual |
| Llama 3.1 8B | 66.7% | ~5GB | 128K | ollama run llama3.1 | General purpose, coding |
| Gemma 2 9B | 71.3% | ~6GB | 8K | ollama run gemma2:9b | Reasoning, knowledge tasks |
| Qwen 2.5 14B | 79.7% | ~9GB | 128K | ollama run qwen2.5:14b | Best MMLU, coding, math |
| Phi-3 Medium 14B | 78% | ~8GB | 128K | ollama run phi3:14b | Reasoning, instruction following |
When to choose Mistral Nemo 12B over alternatives:
- -- You need the 128K context window for long documents (Gemma 2 only has 8K)
- -- You want Apache 2.0 license for unrestricted commercial use
- -- You work with multilingual content (Tekken tokenizer excels here)
- -- You already use Mistral models and want a drop-in upgrade from Mistral 7B
Hardware Requirements
System Requirements
Recommended Hardware Setups
Budget Setup (~$0)
- -- Any modern CPU (4+ cores)
- -- 16GB RAM (CPU-only inference)
- -- 10GB free storage
- -- No GPU needed
- -- ~13 tok/s ceiling on dual-channel DDR5-5600
Workable for light use but slow
Recommended Setup
- -- Intel i5/Ryzen 5 or better
- -- 16GB RAM
- -- RTX 3060 12GB (an 8 GB card needs CPU offload)
- -- NVMe SSD
- -- ~51 tok/s ceiling on the RTX 3060 12GB
Good performance for daily use
Apple Silicon Mac
- -- M1/M2/M3 (any variant)
- -- 16GB unified memory (minimum)
- -- 24GB+ for larger quantizations
- -- Built-in GPU acceleration
- -- ~14 tok/s ceiling on M2/M3 (100 GB/s), ~28 on M1/M2 Pro (200 GB/s)
Great experience on Apple Silicon
Practical Use Cases
Long Document Analysis
The 128K context window makes Mistral Nemo ideal for processing long documents that would exceed context limits of other models:
- -- Legal contracts and agreements (full document in one pass)
- -- Research papers and technical documentation
- -- Book chapters and long-form content summarization
- -- Codebase analysis and documentation generation
Multilingual Applications
The Tekken tokenizer, trained on 100+ languages, makes Mistral Nemo particularly effective for:
- -- Translation and cross-language tasks
- -- Multilingual customer support chatbots
- -- Processing documents in non-English languages
- -- Code comments and documentation in any language
Privacy-Sensitive Tasks
Running locally means your data never leaves your machine:
- -- GDPR-compliant document processing
- -- Medical and financial document analysis
- -- Proprietary code review and generation
- -- Air-gapped deployment for sensitive environments
Development and Testing
Mistral Nemo works well as a development model for:
- -- Prototyping LLM-powered applications locally
- -- Testing prompts before deploying to production APIs
- -- Building RAG (Retrieval Augmented Generation) pipelines
- -- Offline development without internet dependency
Troubleshooting
Model runs slowly or uses too much RAM
If Mistral Nemo is running slowly, it is likely running on CPU instead of GPU:
Out of memory when using long context
Using 128K context requires significantly more VRAM. Reduce context if hitting OOM:
How to use a specific quantization level
Ollama defaults to the 7.1 GB q4_0 build. To use a different quantization, pull its tag, or load a GGUF:
Expose Ollama API on the network
By default, Ollama only listens on localhost. To share with other machines:
Frequently Asked Questions
What is the difference between Mistral Nemo and Mistral 7B?
Mistral Nemo is a 12.2B parameter model (vs 7.3B for Mistral 7B) with several key improvements: 128K context window (vs 32K), the new Tekken tokenizer (vs SentencePiece), and higher published scores (MMLU 68.0 vs 60.1). It was co-developed with NVIDIA and is designed as a drop-in replacement for Mistral 7B with stronger performance.
How much VRAM does Mistral Nemo 12B need?
The Ollama default is the 7.1 GB q4_0 build, which needs about 8.7 GB with Ollama's default 4K context. That fits GPUs like the RTX 3060 12GB or Apple Silicon Macs with 16GB+ unified memory; an 8 GB card such as the RTX 4060 runs it with some layers on the CPU. Full FP16 is a 24.5 GB file, so it wants a 32 GB card (RTX 5090) or a 48 GB A6000. CPU-only inference works with 16GB system RAM but is significantly slower.
Can I actually use the full 128K context window?
Yes, but it requires much more memory. Ollama defaults to a 4K context on GPUs with under 24 GiB of VRAM. You can increase it via /set parameter num_ctx 131072 in chat, or in a Modelfile with PARAMETER num_ctx 131072. The full 128K context adds about 21.5 GB of KV cache to the 7.1 GB model, so plan on roughly 30 GB. For practical use, 8K-32K context covers most tasks.
Is Mistral Nemo 12B good for coding?
Mistral does not publish a HumanEval score for Nemo, though its announcement calls the model's coding accuracy state-of-the-art for its size at release, and Tekken is ~30% more efficient on source code than Mistral's older tokenizer. For dedicated coding tasks, Qwen 2.5 Coder or DeepSeek Coder would be stronger choices. Mistral Nemo is better suited for general-purpose tasks, long document processing, and multilingual work rather than pure code generation.
Should I choose Mistral Nemo 12B or Qwen 2.5 14B?
If you need the highest MMLU scores and best overall benchmarks, Qwen 2.5 14B (79.7% MMLU, base) outperforms Mistral Nemo (68.0% MMLU) significantly. Both are Apache 2.0, so licence is not the deciding factor; Mistral Nemo has the advantage of a native 128K context, the Tekken tokenizer for better multilingual performance, and strong NVIDIA ecosystem integration. Choose based on your priority: raw benchmark performance (Qwen) or native long context and multilingual focus (Nemo).
Can Mistral Nemo run on a Mac?
Yes. On Apple Silicon Macs (M1, M2, M3), Ollama uses Metal for GPU acceleration via unified memory. A 16GB Mac can run the default 4-bit build comfortably; generation is bound by memory bandwidth, with a ceiling of about 14 tokens/second on an M2 or M3 (100 GB/s) and about 28 on an M1 or M2 Pro (200 GB/s). 24GB or 32GB Macs can run higher quantizations or larger context windows. Install Ollama from ollama.com and run ollama run mistral-nemo.
Sources
Official Sources
- -- Mistral AI: Mistral NeMo Announcement -- Official blog post with specs and benchmarks
- -- HuggingFace: Mistral-Nemo-Instruct-2407 -- Model card with benchmarks
- -- Mistral AI Documentation -- Official API and model docs
- -- Ollama: mistral-nemo -- Ollama model library page
Benchmark References
- -- Mistral 7B Technical Report (arXiv:2310.06825) -- Foundation architecture paper
- -- Open LLM Leaderboard -- Community benchmark comparisons
- -- LM Evaluation Harness -- Standardized evaluation framework
- -- NVIDIA Developer Blog: Mistral NeMo -- NVIDIA collaboration details
Build Real AI on Your Machine
RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.
Related Resources
Related Mistral Models
Mistral 7B
Smaller, faster predecessor with 32K context window
Mistral Nemo 12B (current)
128K context, Tekken tokenizer, Apache 2.0
Mistral Large 123B
Flagship model requiring 48GB+ VRAM
Go from reading about AI to building with AI
25 structured courses. Hands-on projects. Runs on your machine. Start free.

Written by
Barsha Mohapatra
Founder and Editor, Local AI Master · Founder, Little AI Master
Founder of Little AI Master and the editor behind every course and guide on Local AI Master. Years of tutoring students taught her where AI education actually fails.
Related Guides
Continue your local AI journey with these comprehensive guides
- PILLARLocal AI Hardware Requirements (2026): Complete Guide
- Best Mac for Local AI: Every Apple Silicon Chip Ranked M1–M6
- Ollama System Requirements: Minimum RAM, GPU, Disk Size
- Run an LLM on Your Phone: Offline AI on Android & iPhone
- WizardLM 13B: Evol-Instruct, MMLU 54.6%, 8GB VRAM (Q4)
- "No Kernel Image Is Available" on RTX 50: sm_120 Fix
- Gemma 4 Hardware Requirements: VRAM/RAM per Model
- TinyLlama 1.1B: Model Card, RAM, Ollama & Raspberry Pi
- Llama 2 13B & 7B: Specs, VRAM, Ollama (llama2:13b)
- Mage-VL: Video Understanding on 8GB VRAM
Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide
No spam. Unsubscribe with one click.
Found your model? Now build something with it.
25 hands-on courses — RAG, agents, fine-tuning — all running locally. First chapter free, no card.