DeepSeek Offline Setup: Run V4 and R1 on Your Own Hardware

Run DeepSeek offline on your own hardware. Step-by-step setup for V4.1-Flash, V4-Pro, R1 distills, Ollama and vLLM — start your private deployment today.

Tutorials·April 25, 2026·By DS Guide Editorial
DeepSeek offline-setup title card: eyebrow 'Tutorial · Offline / Self-host', title 'Offline Setup', tagline 'R1 distills on a desktop; V4.1-Flash on a GPU server.', and four stats: 5.2GB R1 8B in Ollama, 510GB V4.1-Flash files, 893GB V4-Pro files, and MIT V4 weights, beside a compact-desktop illustration.

Can you actually run DeepSeek without sending a single token to a Chinese server? Yes — and a working DeepSeek offline setup is the most direct answer to the privacy and compliance questions that keep coming up about the hosted service. The current open weights, DeepSeek-V4.1-Flash-1017 and DeepSeek-V4-Pro-0813, are on Hugging Face under the MIT licence; the harder question is which model your hardware can realistically host, and which runtime to use.

This guide walks through three deployment paths: a small distilled R1 on a single consumer GPU, DeepSeek-V4.1-Flash-1017 on a multi-GPU server, and what it takes to host DeepSeek-V4-Pro-0813. The commands and hardware figures come from DeepSeek’s model cards, the vLLM Recipes pages and Ollama’s documentation, each linked where it is used.

What you’ll build

Illustration: laptop in airplane mode showing a terminal with a fictional 'local-run deepseek-v4' command and a reply saying it runs locally without an internet connection; not a real command or capture.

By the end of this tutorial you will have a DeepSeek model running on hardware you control, exposing an OpenAI-compatible endpoint on localhost. Your prompts will not leave the machine. You will be able to swap your existing OpenAI client over by changing two lines: base_url and model.

Three deployment tiers, by hardware budget:

  • Tier 1 — Laptop / single consumer GPU. A DeepSeek R1 distill (1.5B to 32B) via Ollama.
  • Tier 2 — Multi-GPU server. DeepSeek-V4.1-Flash-1017 via vLLM. The current Flash model, MIT-licensed weights, OpenAI-compatible API.
  • Tier 3 — Large multi-GPU node. DeepSeek-V4-Pro-0813 via vLLM or SGLang. Not a desktop install.

If you want a comparison of the API hosted by DeepSeek vs running it yourself, see the AI comparison hub and the DeepSeek privacy writeup.

Prerequisites

  • Operating system: macOS, Windows or Linux for Ollama; Linux for vLLM, which its GPU installation guide lists as the supported OS.
  • Disk: 1.1–20 GB for the R1 distills in Tier 1, about 510 GB for DeepSeek-V4.1-Flash-1017 and about 893 GB for DeepSeek-V4-Pro-0813 (sum of the current files in each Hugging Face repo, checked 24 October 2026).
  • Python: 3.11 to 3.14 for vLLM, per the same guide.
  • GPUs: NVIDIA GPUs with compute capability 7.5 or higher for vLLM; Tier 2 and Tier 3 need data-centre GPUs (see below). Apple Silicon needs nothing extra for Ollama.
  • A Hugging Face account is optional. The DeepSeek-V4.1-Flash-1017 and DeepSeek-V4-Pro-0813 repos are not gated (checked 24 October 2026), and the R1 distills can be pulled via Ollama.
  • Optional but recommended: DeepSeek hardware calculator to size your GPU before you commit to a checkpoint.

Hardware reality check

The phrase “run DeepSeek locally” hides an order-of-magnitude difference between models. Pick from this table before you start downloading anything.

Model Download size What it needs Source
R1 Distill 1.5B (deepseek-r1:1.5b) 1.1 GB Any modern laptop Ollama library
R1-0528-Qwen3-8B (deepseek-r1:8b) 5.2 GB A GPU or Apple Silicon Mac with more memory than the file size Ollama library
R1 Distill 14B (deepseek-r1:14b) 9.0 GB A consumer GPU with more VRAM than the file size Ollama library
R1 Distill 32B (deepseek-r1:32b) 20 GB A 24 GB-class GPU or a Mac with 32 GB+ unified memory Ollama library
R1 Distill 70B (deepseek-r1:70b) 43 GB Multiple GPUs or a large-memory Mac Ollama library
DeepSeek-V4.1-Flash-1017 ≈510 GB About 614 GB of GPU memory: one 8-GPU H200 node, one GB200 NVL4 tray, or 4× H200 with Engram tables offloaded to CPU memory vLLM Recipes
DeepSeek-V4-Pro-0813 ≈893 GB DeepSeek’s example serves it on a single 4× GB300 node DeepSeek model card
Ollama sizes from the deepseek-r1 tags page; V4 sizes are the sum of the current files on Hugging Face; GPU-memory figures from the vLLM Recipes page and DeepSeek’s model card. All checked 24 October 2026. Always leave headroom for the KV cache.

Two facts worth absorbing. First, the full weights have to fit in GPU memory (or be partly offloaded), so total memory dominates the cost even though these MoE models activate only a fraction of their parameters per token. DeepSeek’s own minimal-inference notes describe weight conversion, one checkpoint file per tensor-parallel rank and torchrun execution, with multi-node options — a very different operating model from a desktop app or an Ollama pull. Second, the KV cache still needs memory: the vLLM recipe puts V4.1-Flash’s global KV cache at 890 bytes per token, under 1 GB for a full 1M-token prompt plus a sliding window per layer, but advises measuring before assuming a given context and batch size fits.

Tier 1: DeepSeek R1 distill via Ollama

This is the simplest DeepSeek offline setup and the right starting point for almost everyone. According to the Ollama library page, the deepseek-r1 distill tags are small dense models fine-tuned on reasoning data generated by DeepSeek-R1: 8b is DeepSeek-R1-0528-Qwen3-8B, the 1.5B–32B tags are R1-Distill-Qwen models and 70b is R1-Distill-Llama-70B. They run on consumer hardware. The page lists the weights as MIT-licensed, but notes that the Qwen distills derive from Qwen-2.5 (originally Apache 2.0) and the Llama distills from Llama 3.1-8B-Base and Llama 3.3-70B-Instruct (originally under the Llama 3.1 and 3.3 licences).

Step 1 — Install Ollama

Run the appropriate shell command (the install scripts are from ollama.com/download; Homebrew also packages Ollama):

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

# macOS — or use the desktop app from ollama.com, or:
brew install ollama

# Windows (PowerShell)
irm https://ollama.com/install.ps1 | iex

Step 2 — Pull a model

Pick the largest variant that fits your VRAM with room to spare. For 12 GB cards, the 14B; for 24 GB cards, the 32B; for everything else, 8B.

ollama pull deepseek-r1:8b      # 5.2 GB on disk
ollama pull deepseek-r1:14b     # 9.0 GB on disk
ollama pull deepseek-r1:32b     # 20 GB on disk

Avoid the deepseek-v4.1-flash and deepseek-v4-pro tags for an offline setup: on Ollama they are cloud-only, so prompts sent through them leave your machine.

Step 3 — Run it

ollama run deepseek-r1:14b 'A bat and a ball cost $1.10. The bat costs $1 more than the ball. How much is the ball?'

These are thinking models: Ollama’s thinking documentation says thinking-capable models return their reasoning trace in a separate thinking field from the final answer, so you will see the reasoning before the answer (here, $0.05).

Step 4 — Expose an OpenAI-compatible endpoint

Ollama already serves one. Its OpenAI compatibility endpoint is at http://localhost:11434/v1/. Point the OpenAI SDK at this URL and use deepseek-r1:14b as the model name. The SDK requires an API key, but Ollama ignores it, so any string works.

from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1/", api_key="ollama")
resp = client.chat.completions.create(
    model="deepseek-r1:14b",
    messages=[{"role": "user", "content": "Refactor this Python script."}],
)
print(resp.choices[0].message.content)

For a deeper walkthrough of the Ollama path including Modelfile customisation, see running DeepSeek on Ollama.

Tier 2: DeepSeek V4.1-Flash via vLLM

If you want the current generation rather than R1, DeepSeek-V4.1-Flash-1017 is the model to host yourself. It is a minor update to DeepSeek-V4.1-Flash, released on 17 October 2026 with weights and code under the MIT License, and it is the model the hosted API serves as deepseek-flash. According to the vLLM recipe, the checkpoint is a native mixed-precision release — MXFP4 routed-expert weights, MXFP8 block-quantized dense weights — of roughly 511 GB on disk, and it accepts images as well as text.

Step 1 — Provision the hardware

Configurations the vLLM recipe describes for V4.1-Flash (it lists about 614 GB of GPU memory as the minimum, including headroom):

  • One 8-GPU NVIDIA H200 node (1,128 GB), with room for KV cache
  • 4× NVIDIA H200 at tensor parallel 4, with the Engram tables offloaded to pinned host memory (the recipe’s H200 default)
  • One GB200 NVL4 tray (768 GB) at tensor parallel 4

The recipe also covers B200, B300, GB300 and AMD MI355X/MI325X layouts.

Step 2 — Download the weights

pip install -U huggingface_hub
hf download deepseek-ai/DeepSeek-V4.1-Flash-1017 \
    --local-dir ./DeepSeek-V4.1-Flash-1017

This pulls the full checkpoint (about 510 GB). The repo is not gated, so hf auth login is optional. Alternatively, pass the repo ID to vllm serve and vLLM downloads the weights on first start.

Step 3 — Install vLLM

Use a fresh virtualenv. The recipe lists vLLM 0.31.0 or later as the prerequisite for V4.1-Flash:

python -m venv .venv && source .venv/bin/activate
pip install --upgrade pip
pip install "vllm>=0.31.0"

Step 4 — Serve the model

The command below starts an OpenAI-compatible server on port 8000 on four H200 GPUs. It is assembled from the flags the vLLM recipe documents — the required --tokenizer-mode deepseek_v41 (the repo ships no Jinja chat template), the reasoning and tool-call parsers, and the H200 Engram offload; use the recipe’s command builder for other hardware:

export VLLM_ENGINE_READY_TIMEOUT_S=3600
vllm serve ./DeepSeek-V4.1-Flash-1017 \
    --served-model-name deepseek-ai/DeepSeek-V4.1-Flash-1017 \
    --tokenizer-mode deepseek_v41 \
    --reasoning-parser deepseek_v41 \
    --tool-call-parser deepseek_v41 --enable-auto-tool-choice \
    --tensor-parallel-size 4 \
    --engram-config '{"cpu_offload":true}' \
    --port 8000

Add --language-model-only if your workload is text-only; the recipe says it skips the vision encoder and frees that memory for KV cache. For local sampling, the model card recommends temperature = 1.0, top_p = 1.0, a 1M-token context window and max_tokens of at least 256K.

Step 5 — Talk to it from Python

vLLM exposes the same Chat Completions wire format DeepSeek’s hosted API uses (POST /v1/chat/completions on your server), so the SDK swap is two lines:

from openai import OpenAI
client = OpenAI(base_url="http://localhost:8000/v1", api_key="local")
resp = client.chat.completions.create(
    model="deepseek-ai/DeepSeek-V4.1-Flash-1017",
    messages=[{"role": "user", "content": "Plan the migration."}],
    extra_body={"chat_template_kwargs": {"thinking": True, "reasoning_effort": 50}},
    temperature=1.0,
    top_p=1.0,
    max_tokens=262144,  # model card: at least 256K
)
print(resp.choices[0].message.content)

Local thinking controls differ from the hosted API. The recipe documents thinking on/off and a numeric reasoning_effort (1–100, or low/high/xhigh/max = 25/50/75/100) passed as chat_template_kwargs; with both unset, thinking is on at effort 50. It also notes that DeepSeek’s API maps its low/high/max to 50/75/100, so a request tuned at high on the API runs at 50 locally unless you pass an integer. The reasoning parser returns the trace separately from the final content. Other parameters worth knowing: temperature, top_p and max_tokens; tool calling works through the tool-call parser enabled above.

Step 6 — Verify it worked

Three quick checks:

  1. curl http://localhost:8000/v1/models should return a JSON list including your model ID.
  2. nvidia-smi should show GPU memory allocated across all cards involved in tensor parallel.
  3. A short test prompt should return non-empty content. If it comes back empty with finish_reason=length, the recipe’s explanation is that thinking used up a small max_tokens budget — raise max_tokens or turn thinking off.

Tier 3: DeepSeek V4-Pro on a multi-GPU node

V4-Pro is not a desktop workload. DeepSeek-V4-Pro-0813, released on 13 August 2026, is the official release that superseded the April preview; its weights total about 893 GB. DeepSeek’s model card gives this vLLM command for a single 4× GB300 node, with DSpark speculative decoding enabled, and points to the vLLM recipe for other hardware:

vllm serve deepseek-ai/DeepSeek-V4-Pro-0813 \
  --trust-remote-code --kv-cache-dtype fp8 --block-size 256 \
  --data-parallel-size 4 --enable-expert-parallel \
  --moe-backend deep_gemm_mega_moe \
  --attention-config '{"use_fp4_indexer_cache": true}' \
  --speculative-config '{"method":"dspark","num_speculative_tokens":7,"draft_sample_method":"greedy"}'

The card also gives an SGLang command, and its local-deployment recommendation is temperature = 1.0, with top_p = 0.95 for agentic scenarios and 1.0 otherwise, and a maximum output length of 384K tokens for the high and max effort levels. The vLLM recipe adds --tokenizer-mode deepseek_v4, which applies the built-in DeepSeek-V4 prompt encoding (the 0813 repo ships no Jinja chat template), together with the deepseek_v4 tool-call and reasoning parsers for tool calling and separated reasoning.

The hosted API is usually the cheaper route for occasional V4-Pro work; current per-token rates, with peak and off-peak prices, are on our DeepSeek API pricing page. For most teams, “offline” means tier 1 or tier 2, with the hosted API used as a fallback for the heaviest jobs that do not touch private data.

Common errors and fixes

Symptom Likely cause Fix
CUDA out of memory on vLLM startup Weights plus KV cache do not fit Add GPUs, enable the recipe’s Engram CPU offload, or reduce --max-model-len; restart
Ollama is much slower than expected on a GPU machine Model is running on CPU Run ollama ps to see where the model is loaded; reinstall GPU drivers if the GPU is not used
Empty content with finish_reason=length Thinking used the whole max_tokens budget Raise max_tokens or disable thinking
Reasoning text breaks downstream parsers Reasoning trace mixed into structured output Read the separate reasoning field (vLLM reasoning parser, Ollama thinking field) instead of parsing it out of content
vLLM refuses to load V4.1-Flash weights vLLM version too old Upgrade to 0.31.0+; pip install -U vllm

Local vs hosted: when to switch

Local inference removes the network and the third party from your data path. It does not remove the operations work. Some rules of thumb:

  • Privacy-bound workloads (legal, healthcare, internal source code) → local. Even the smallest R1 distill running offline keeps the prompt off any third party’s servers.
  • Bursty, low-volume traffic → hosted. Hardware that sits idle most of the day is poor economics.
  • High-volume batch processing → run the math both ways, including hardware, power and staff time, against the hosted peak and off-peak rates.
  • Mixed setup → Tier 1 locally for sensitive snippets, hosted deepseek-v4-pro or deepseek-flash for heavy jobs that don’t touch private data.

A note on the API surface

The hosted DeepSeek API behaves differently from the web app: it is stateless, so the client must resend the conversation history with every request. Your local vLLM server works the same way. As of October 2026 the hosted API serves deepseek-flash (DeepSeek-V4.1-Flash-1017) and deepseek-v4-pro (DeepSeek-V4-Pro-0813); the legacy IDs deepseek-chat and deepseek-reasoner were scheduled for retirement on 2026-07-24 at 15:59 UTC and are no longer listed in the official docs. See our DeepSeek API documentation guide for the hosted parameters.

Next steps

Flat diagram of a fully local DeepSeek hardware stack with V4 and R1 weights and no internet dependency.

Once your DeepSeek offline setup is stable, the natural follow-ons are:

Frequently asked questions

Is a DeepSeek offline setup actually private?

Yes, when you run an open-weight checkpoint on hardware you control, prompts and responses stay on your machine. The weight files themselves do not send anything anywhere, but the runtime you use and any remote code you allow (for example vLLM’s --trust-remote-code) do run code, so review what you install, and avoid cloud-only tags such as Ollama’s deepseek-v4.1-flash. The privacy concerns raised about DeepSeek concern the hosted chatbot at chat.deepseek.com and the API, whose data DeepSeek’s Privacy Policy says is stored in China. For a fuller breakdown, see DeepSeek privacy and the is DeepSeek safe guide.

Can I run DeepSeek V4-Pro on a laptop?

No. DeepSeek-V4-Pro-0813’s weights total about 893 GB, and DeepSeek’s own vLLM example serves it on a node with four GB300 GPUs. Realistic smaller offline setups are DeepSeek-V4.1-Flash-1017 on a multi-GPU H200-class server, or the R1 distills on a single consumer GPU. Use the hosted API or a managed cluster for V4-Pro. The DeepSeek V4-Pro page covers the architecture trade-offs.

How does Ollama compare to vLLM for DeepSeek?

Ollama is the simplest path for the R1 distill family — single command to pull, single command to run, sensible defaults. vLLM is what you want for V4.1-Flash, V4-Pro and any production deployment: batching, full control over tensor parallel and context length, and DeepSeek-specific tokenizer, reasoning and tool-call parsers documented in the vLLM recipes. Use Ollama to prototype, vLLM to serve. The running DeepSeek on Ollama tutorial covers the Ollama side in detail.

What hardware do I need to run the DeepSeek R1 32B distill?

Ollama’s deepseek-r1:32b tag is a 20 GB download, so you need more than 20 GB of GPU memory or unified memory, plus room for the context — in practice a 24 GB-class GPU or an Apple Silicon Mac with 32 GB or more of unified memory. See the DeepSeek R1 Distill model page and the DeepSeek system requirements guide.

Why use offline DeepSeek instead of the hosted API?

Three reasons: data residency (prompts never leave your network), no per-token cost once the hardware is paid for, and no dependency on an external API’s uptime or rate limits. The trade-offs are the up-front capital cost, electricity, and operations overhead. For low-volume bursty workloads the hosted API usually wins; for steady high-volume or privacy-bound work, compare your full local costs against the hosted peak and off-peak rates. The DeepSeek tutorials hub has more deployment patterns to compare.

Sources & Methodology

Last source check: October 24, 2026

Primary sources

Technical references

Methodology

Information in this article was checked against the official DeepSeek documentation, the article's cited primary sources, and the deepseekai.guide pricing dataset on the date shown above. Where third-party numbers are quoted, the originating source is linked inline so the reader can verify and re-check.

Data confidence

High for facts cited inline with primary-source links; medium for context narrative.

Editorial note

AI tooling moves quickly. If you spot an outdated number or a broken link, the contact link in the footer is the fastest way to flag it for the editorial team.

Leave a Reply

Your email address will not be published. Required fields are marked *