NEW DeepSeek R1 & vLLM 0.6.2 Concurrency Sizing Matrix Released Read Benchmark →
LA
LocalAgentStack Open Inference Lab
models Published: 2026-07-25 Verified: 2026-09-03 5 min read
DeepSeek R1 Local Setup Ollama: Complete Installation & Prompting Guide (2026)

DeepSeek R1 Local Setup Ollama: Complete Installation & Optimization Guide

Quick Answer: To run DeepSeek R1 locally with Ollama, run ollama run deepseek-r1:14b for 16GB GPUs or ollama run deepseek-r1:8b for 8GB GPUs. For maximum reasoning fidelity, configure a custom Modelfile setting temperature 0.6 and top_p 0.95, preserving the <think> reasoning traces without artificial system prompt overrides.

Last Updated: September 3, 2026 | Reviewed by Senior Systems Architect

Key Takeaways

  • Model Variants: DeepSeek R1 distilled checkpoints are available in 1.5B, 7B, 8B, 14B, 32B, and 70B sizes, with the 14B Q4_K_M model offering the best performance-to-VRAM balance on consumer hardware.
  • VRAM Thresholds: The 8B model requires 5.8 GB VRAM; the 14B model requires 9.6 GB VRAM; the 32B model requires 20.2 GB VRAM. Sizing can be verified in our VRAM Requirements Calculator.
  • Prompting Constraint: Do not inject aggressive system instructions instructing the model to suppress thinking; doing so disrupts chain-of-thought mathematical and coding derivation.
  • Production Routing: Integrate Ollama with agent orchestrators via our Custom MCP Server Tutorial or scale to multi-user clusters with vLLM Serving Benchmarks.

1. DeepSeek R1 Local Hardware Requirements Table

Model SizeQuantizationRequired VRAMMinimum Recommended GPUTokens / Sec (RTX 4090)
DeepSeek-R1-1.5BQ4_K_M1.8 GBAny Modern iGPU / GTX 1650145 t/s
DeepSeek-R1-7BQ4_K_M5.2 GBRTX 3060 (12GB) / RTX 406088 t/s
DeepSeek-R1-8BQ4_K_M5.8 GBRTX 3060 (12GB) / Apple M2 (16GB)82 t/s
DeepSeek-R1-14BQ4_K_M9.6 GBRTX 4070 (12GB) / RTX 308058 t/s
DeepSeek-R1-32BQ4_K_M20.2 GBRTX 3090 (24GB) / RTX 409036 t/s
DeepSeek-R1-70BQ4_K_M43.5 GB2x RTX 3090 (48GB) / Mac Studio 64GB19 t/s

DeepSeek R1 Local Setup Ollama Architecture Diagram


2. Step-by-Step Installation Commands

Ensure Ollama is updated to the latest binary release supporting QwQ and DeepSeek architecture optimizations:

# 1. Pull and run the balanced 14B reasoning model
ollama run deepseek-r1:14b

# 2. Test chain-of-thought reasoning in terminal
>>> "Solve the following problem step-by-step: Write a Python function to find the longest palindromic substring."

Ollama automatically initializes GPU layer offloading according to the Ollama Official Release Notes.


3. Creating an Optimized Custom Modelfile

Standard default configurations lack parameter tuning for mathematical reasoning. Create a dedicated Modelfile:

FROM deepseek-r1:14b

# Set optimal sampling parameters for reasoning tasks
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER top_k 40
PARAMETER num_ctx 32768

# Preserve native reasoning token templates
TEMPLATE """{{ if .System }}<|System|>{{ .System }}{{ end }}{{ range .Messages }}{{ if eq .Role "user" }}<|User|>{{ .Content }}<|Assistant|>{{ else if eq .Role "assistant" }}<|thought|>{{ .Content }}{{ end }}{{ end }}"""

Compile and register the model:

ollama create r1-coder -f ./Modelfile
ollama run r1-coder

4. Benchmarking Accuracy and Speed

According to technical disclosures in the DeepSeek R1 Research Paper and the DeepSeek GitHub Architecture Repository, test-time compute scaling delivers parity with proprietary models across AIME and MATH-500 benchmarks.

For developers deploying on Apple hardware, review our unified memory benchmarks in the Mac Studio M4 Max Review.


5. Frequently Asked Questions (FAQ)

Why does DeepSeek R1 output <think> blocks?

The <think> tags contain the raw chain-of-thought reflection where the model verifies assumptions, explores edge cases, and self-corrects before providing the final answer. Removing or masking these tokens degrades output accuracy on logic benchmarks.

How do I expose DeepSeek R1 as an OpenAI-compatible API?

Ollama automatically serves an OpenAI-compatible endpoint on port 11434. Point your applications to http://localhost:11434/v1 using deepseek-r1:14b as the model name.

Can I run the full 671B DeepSeek R1 model locally?

Running the un-distilled 671B MoE model requires approximately 380 GB of VRAM even at 4-bit quantization, necessitating an 8x H100 datacenter cluster or multiple Mac Studio 192GB nodes linked via high-speed cluster networking.

Video Walkthrough & Demonstration

DeepSeek R1 Ollama Local Setup & Optimization Tutorial

Optimal parameter tuning for reasoning models: temperature 0.6, chain-of-thought preservation, and custom Modelfile creation.

Watch on YouTube
Reproducible Local AI Benchmarks Clone benchmark configs, hardware scripts, and empirical test suites on GitHub.
View on GitHub →
Interactive Modelfile Builder

DeepSeek R1 Modelfile & Tuning Generator

Generate an optimized Ollama Modelfile with proven reasoning parameters to prevent chain-of-thought hallucination loops.

Temperature0.6 (Optimal)
Context Window (num_ctx)32768 tokens
Modelfile
FROM deepseek-r1:14b
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER num_ctx 32768
SYSTEM """You are an expert AI engineering assistant. Output your chain-of-thought inside ... tags before answering."""
LA

LocalAgentStack Engineering Collective

VERIFIED

All benchmarks are empirically measured on dedicated physical hardware (NVIDIA RTX 4090, RTX 3090 x2, Apple M4 Max 128GB). Zero simulated estimations.