DeepSeek R1 Local Deployment
DeepSeek R1 is open source, but the version you can run at home is a distilled small model, not the 671B original. This guide separates the variants, VRAM needs, sampling settings and API usage.
📜 Table of Contents
📖 Keep reading
DeepSeek R1 Local Deployment: Know Which Version You Can Run
DeepSeek R1 was released in early 2025 under MIT. What runs on your desk is almost always a distilled variant, not the 671B model. The gap matters.
Version Map
| Version | Params | 4-bit size (approx.) | Feasible on |
|---|---|---|---|
| R1 full | 671B MoE (~37B active) | Hundreds of GB | Multi-GPU servers only |
| Distill-Qwen-32B | 32B | ~20GB | 24GB GPU |
| Distill-Qwen-14B | 14B | ~9GB | 12-16GB GPU |
| Distill-Llama-8B | 8B | ~5GB | 8GB GPU |
| Distill-Qwen-7B | 7B | ~4.7GB | 8GB GPU or 16GB RAM CPU |
| Distill-Qwen-1.5B | 1.5B | ~1.1GB | Laptops |
Distills copy the "think first, answer later" behavior but not the knowledge or multi-step reliability of the full model.
Fastest Path: Ollama
curl -fsSL https://ollama.com/install.sh | sh
ollama pull deepseek-r1:7b
ollama run deepseek-r1:7b "Your question"
Tags cover 1.5b through 671b. Avoid 70b on normal hardware.
Sampling Settings
- Temperature 0.5-0.7 (0.6 is the usual default),
top_p0.95. Higher temperatures make the reasoning loop. - R1 is not very responsive to system prompts; put instructions in the user message.
- For math, ask for step-by-step reasoning and a separate final answer.
- For JSON output, show a sample instead of describing the schema.
ollama run deepseek-r1:7b --temperature 0.6 --top-p 0.95
Calling It From Code
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama")
resp = client.chat.completions.create(
model="deepseek-r1:7b",
messages=[{"role": "user", "content": "Rewrite this clause in plain Chinese: ..."}],
temperature=0.6,
)
Thinking output differs by version: newer Ollama returns a separate thinking field, older versions inline thinking...<|end▁of▁thinking|>. Handle both:
import re
answer = re.sub(r" thinking.*?<|end▁of▁thinking|>", "", text, flags=re.S).strip()
What It Can Actually Do
- Scripts, regex, error explanation: 7B/8B works, and it shows its steps
- Chinese business writing and summaries: 14B is clearly better
- School-level word problems: usually right, occasionally a bad final arithmetic step
- Competition math and long logic chains: confidently wrong, verify by hand
- Repo-level code understanding: weaker than dedicated coder models
Ask it to state the conclusion first, then derive, then self-check the arithmetic. That catches many small errors.
Other Routes
LM Studio for a GUI, llama.cpp with a GGUF file for control (llama-server -m model.gguf -c 8192), vLLM only for concurrent serving. Quantization: Q4_K_M on 8GB, Q5_K_M/Q6_K on 16GB. Below Q4, reasoning quality degrades noticeably.
FAQ
Same as the official app? No. The hosted service runs much larger models.
14B on 8GB VRAM? Weights alone are ~9GB; partial offload works but drops to a few tokens per second.
Fine-tune it? LoRA works for style and format, not for adding knowledge. Use RAG for knowledge.
R1 vs V3? V3 is the general chat model; R1 spends tokens on a reasoning chain. Use V3 for chat, R1 for problems.
Thinking takes too long? Cap output length or ask for brief reasoning, at some cost to accuracy.
Related
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.