How to Install DeepSeek Locally on Windows, macOS, or Linux

Learn how to install DeepSeek locally with Ollama, vLLM, or Hugging Face. Hardware specs, V4 weights, and step-by-step commands. Start in minutes.

Tutorials·April 25, 2026·By DS Guide Editorial
DeepSeek, Locally title card: R1 distills on laptops, full V4-family weights on servers, with four sizes — 1.1GB for R1 1.5B on Ollama, 5.2GB for R1 8B on Ollama, 510GB for V4.1-Flash-1017 and 893GB for V4-Pro-0813.

You want your prompts to stay on your machine, your latency to stop depending on someone else’s data centre, and your bill to stop depending on token counts. That is what learning how to install DeepSeek locally buys you — at the cost of disk space, GPU memory, and an evening of setup. The catch in 2026 is that DeepSeek’s current flagship checkpoints are enormous: on Hugging Face, the DeepSeek-V4.1-Flash-1017 repository holds about 510 GB of files and the DeepSeek-V4-Pro-0813 repository about 893 GB (checked 23 October 2026), and both models support a one-million-token context. So most readers will pick a smaller distilled R1 variant for laptops and reserve the full V4-family weights for serious GPU servers. This tutorial walks through both paths — Ollama for the easy route, vLLM and Hugging Face for the server route — with the hardware reality checks in between.

What you will end up with

Pull an R1 distill title card: ollama pull deepseek-r1:8b, then chat offline, with four stats — Ollama port 11434, 1.1GB 1.5B download, 5.2GB 8B download and 43GB 70B download.

By the end of this guide you will have a DeepSeek model serving completions on http://localhost:11434 (Ollama) or http://localhost:8000/v1 (vLLM), reachable from any OpenAI-compatible client by changing two lines of code. You will know which DeepSeek variant fits your hardware, how to download it without surprises, and how to verify it is running properly. The same setup powers offline coding assistants, private chatbots, and local RAG pipelines — see our DeepSeek RAG tutorial for that follow-on.

Two facts before you start. First, the DeepSeek API is a separate hosted service: it speaks POST /chat/completions at https://api.deepseek.com and is stateless, meaning the client resends the conversation history every call. Local servers such as Ollama and vLLM expose the same OpenAI-style wire format on your own machine. Second, DeepSeek-V4.1-Flash-1017 and DeepSeek-V4-Pro-0813 are open-weight under MIT, but neither is laptop-class — even the Flash model is a serious multi-GPU deployment. Plan accordingly.

Prerequisites

  • Operating system: Windows 10/11, macOS 12+ (Apple Silicon strongly preferred), or a recent Linux (Ubuntu 22.04/24.04, Rocky 10, Debian 13).
  • Disk space: about 1 GB for the smallest distilled R1, 20–45 GB for mid-size and large distills, and roughly 510 GB (V4.1-Flash-1017) to 893 GB (V4-Pro-0813) for the full current weights.
  • RAM/VRAM: see the hardware table below.
  • GPU drivers: recent NVIDIA driver + CUDA 12.x for Linux GPU paths; nothing extra for Apple Silicon (Metal is built in).
  • Software: Python 3.10+, git, git-lfs, plus either Ollama (easy path) or pip for vLLM (advanced path).
  • Optional: a Hugging Face account if you want the official upstream weights instead of community quantizations.

Pick the right DeepSeek variant for your hardware

This is the step most tutorials skip. The “DeepSeek” you can actually run depends on what GPU or unified memory you have. The V4-family rows draw on the official model cards and Hugging Face; the distill hardware column is a rough rule of thumb for 4-bit quantised builds, not an official requirement.

Model Total params Active params Rough minimum hardware Best for
DeepSeek-R1-Distill-Qwen 1.5B 1.5B 1.5B 4 GB RAM, CPU-only OK Quick experiments, scripts
DeepSeek-R1-0528-Qwen3-8B (Ollama’s deepseek-r1:8b) 8B 8B 8–16 GB RAM, optional 8 GB VRAM Laptop reasoning, offline Q&A
DeepSeek-R1-Distill-Qwen 32B 32B 32B 24 GB VRAM (RTX 3090/4090) at 4-bit Serious local coding
DeepSeek-R1-Distill-Llama 70B 70B 70B 2× 24 GB GPUs or 64 GB unified memory Workstation reasoning
DeepSeek-V4.1-Flash-1017 Not stated on its card — Multi-GPU server; about 510 GB of weights Server self-hosting
DeepSeek-V4-Pro-0813 Not stated on its card — Multi-GPU node (the card’s vLLM example uses 4× GB300); about 893 GB of weights Large-scale self-hosting, labs

The full R1 model has 671 billion parameters and requires serious GPU infrastructure. For practical local use, DeepSeek released distilled variants based on Qwen 2.5 and Llama architectures, ranging from 1.5B to 70B parameters, and in May 2025 added DeepSeek-R1-0528-Qwen3-8B, which Ollama’s deepseek-r1:8b tag now serves. The distilled models carry over much of R1’s step-by-step reasoning behaviour while running on commodity hardware. If you want to size your rig before downloading, our DeepSeek hardware calculator takes a model ID and returns realistic VRAM and disk numbers.

Quick rule: if you are on a laptop, install an R1 distill via Ollama. If you have a 24 GB GPU or a 64 GB+ Apple Silicon Mac, you can stretch to 32B or 70B. If you have multi-GPU servers, you can attempt V4.1-Flash-1017. V4-Pro-0813 needs a large multi-GPU node.

Path A — Install DeepSeek locally with Ollama (easiest)

Ollama is the fastest way to go from zero to a running model. It manages model weights, automatically downloads and organizes model files in GGUF format, optimizes hardware by auto-detecting GPU acceleration (NVIDIA, AMD, Apple Silicon), and provides an API exposing a REST endpoint compatible with OpenAI libraries. If all you want is to chat with DeepSeek offline, stop here.

Step 1: Install Ollama

Download the installer for your platform from ollama.com. On macOS and Windows it is a normal app installer. On Linux, run the official one-line shell installer. After install, restart your terminal so ollama is on your PATH, then verify with this Bash command:

ollama --version

Step 2: Pull a DeepSeek model

Pick a tag that matches your hardware. For a laptop, the 8B distilled R1 is the practical sweet spot. Run this in your terminal:

ollama pull deepseek-r1:8b

The download is about 5.2 GB, according to Ollama’s library page; on a 100 Mbps connection that is roughly 7 minutes at full line speed. Larger variants (deepseek-r1:32b at 20 GB, deepseek-r1:70b at 43 GB) take proportionally longer and need correspondingly more RAM/VRAM. For DeepSeek-V4.1-Flash, Ollama’s library lists only cloud tags (deepseek-v4.1-flash:cloud and deepseek-v4.1-flash:1017-cloud, checked 23 October 2026); those run inference on Ollama’s cloud, not your machine.

Step 3: Run an interactive session

Start chatting from the terminal:

ollama run deepseek-r1:8b

The first run takes a little while to load the model into memory. After that, you get a prompt where you can type questions. Type /bye to exit the session. R1 distills write out their reasoning before the final answer (wrapped in <think> tags in the raw model output); on DeepSeek’s hosted API the equivalent arrives as a separate reasoning_content field alongside the final content.

Step 4: Use the OpenAI-compatible API

Ollama exposes a REST server on port 11434 by default. Any OpenAI SDK can talk to it by overriding base_url. Here is a minimal Python example:

from openai import OpenAI

client = OpenAI(
    base_url="http://localhost:11434/v1",
    api_key="ollama",  # Ollama ignores the key, but the SDK requires one
)

resp = client.chat.completions.create(
    model="deepseek-r1:8b",
    messages=[{"role": "user", "content": "Explain MoE in two sentences."}],
    temperature=0.6,
)
print(resp.choices[0].message.content)

The same pattern works in Node.js, Go, and any other language with an OpenAI client. For a deeper walkthrough of the parameters, see our running DeepSeek on Ollama tutorial.

Path B — Install DeepSeek V4 locally with vLLM (production)

V4-Pro on vLLM title card: the model card's command targets one 4×GB300 node, with four stats — vLLM port 8000, 1M context window, 384K max output and MIT weights licence.

If you have multi-GPU Linux hardware and want the official weights, vLLM is a standard serving stack: it gives you an OpenAI-compatible server on port 8000 backed by the upstream checkpoint. The example below uses DeepSeek-V4-Pro-0813, because its model card publishes a vLLM launch command; the DeepSeek-V4.1-Flash-1017 card points instead to the inference folder in its repository for weight conversion and local inference.

Step 1: Install system dependencies (Linux)

You need recent NVIDIA drivers, CUDA, and Python with build tools. Install with apt: git, git-lfs, python3, python3-venv, python3-pip, then run git lfs install and pip install -U huggingface_hub. Create a virtual environment to keep things tidy:

python3 -m venv dsv4-env
source dsv4-env/bin/activate
pip install -U pip wheel setuptools
pip install -U huggingface_hub torch transformers safetensors vllm

Step 2: Download the weights from Hugging Face

Use the hf command-line tool that ships with huggingface_hub to pull the official repository into the Hugging Face cache. Point HF_HOME at a large data disk first — the V4-Pro-0813 repository holds about 893 GB (V4.1-Flash-1017: about 510 GB) — so you do not fill your system disk:

export HF_HOME=/data/hf
hf download deepseek-ai/DeepSeek-V4-Pro-0813

Step 3: Serve the model with vLLM

vLLM ships an OpenAI-compatible server. DeepSeek’s V4-Pro-0813 model card gives this command for a single 4×GB300 node, with the DSpark speculative-decoding module switched on through --speculative-config:

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 server listens on port 8000 by default. For other hardware configurations the card links to the vLLM recipe and the SGLang cookbook. Both current models support a context of up to 1M tokens, but only if you have the KV-cache headroom; for the high and max reasoning-effort levels, the V4-Pro-0813 card recommends a maximum output length of 384K tokens.

Step 4: Set sampling parameters correctly

DeepSeek’s model cards set the local sampling defaults. The V4-Pro-0813 card recommends temperature = 1.0, with top_p = 0.95 for agentic scenarios and top_p = 1.0 otherwise; the V4.1-Flash-1017 card lists temperature 1.0, top_p 1.0 and max_tokens of at least 256K. DeepSeek’s task-specific temperatures for the hosted API (0.0 for code and maths, 1.0 for data analysis, 1.3 for general conversation and translation, 1.5 for creative writing) apply to non-thinking mode only; thinking mode, the hosted default, ignores temperature.

Verify the install worked

Whichever path you took, run a smoke test against your local endpoint with curl:

curl http://localhost:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "deepseek-r1:8b",
    "messages": [{"role": "user", "content": "Reply with the single word OK."}]
  }'

For vLLM, swap the port to 8000 and the model name to deepseek-ai/DeepSeek-V4-Pro-0813. A clean response with an "OK" in choices[0].message.content means the stack is healthy. If you get a connection refused, the server is not running. If you get a CUDA out-of-memory error, drop to a smaller variant or shorter context length.

Common errors and fixes

Error Likely cause Fix
CUDA out of memory Model + KV cache exceed VRAM Use a smaller variant, lower --max-model-len, or add GPUs
Connection refused on 11434/8000 Server not started or crashed Re-run the launch command; check logs for OOM or driver errors
No module named vllm Wrong Python environment Re-activate your venv; pip install -U vllm
Hugging Face 401 Repo gated or token missing Run hf auth login with a valid access token
Slow generation on CPU No GPU acceleration available Expect slow output; switch to a 1.5B variant or rent a GPU
Garbled output from V4-family weights Wrong sampling defaults Use the model card’s values (temperature=1.0; top_p=1.0, or 0.95 for agentic use on V4-Pro-0813)

Local install vs the hosted API

Self-hosting is the right answer for privacy, offline work, and long-term volume. It is the wrong answer when you want the latest model behaviour, no GPU bills, or a one-off experiment. The hosted DeepSeek API uses two model IDs — deepseek-flash (served by DeepSeek-V4.1-Flash-1017) and deepseek-v4-pro (DeepSeek-V4-Pro-0813). The legacy deepseek-chat and deepseek-reasoner IDs were scheduled for retirement on 2026-07-24 at 15:59 UTC and are no longer listed in the official docs. Chat requests hit POST /chat/completions, the OpenAI-compatible endpoint at https://api.deepseek.com; an Anthropic-compatible surface lives at https://api.deepseek.com/anthropic.

On the hosted side you pay per token: as of October 2026, deepseek-flash lists $0.30 cache-miss input and $1.20 output per 1M tokens at peak, and $0.15 / $0.60 off-peak (peak hours are 01:00–04:00 and 06:00–10:00 UTC on weekdays, excluding Chinese public holidays). Compare a monthly API estimate with the amortised cost of a workstation GPU plus electricity. For low-volume personal use, the hosted API usually wins on dollars; for high-volume or sensitive workloads, local can win. For worked estimates, see our DeepSeek API pricing reference and the DeepSeek free vs paid guide.

Plug your local install into real tools

Title card 'Laptop vs server' (Tutorial · Local install): R1 distills fit laptops, V4-family weights need servers — 1.1GB for the r1:1.5b download, 5.2GB for r1:8b, 510GB of V4.1-Flash files and 893GB of V4-Pro files.

Once Ollama or vLLM is exposing an OpenAI-compatible endpoint, you can wire it into almost anything:

Next steps

You now have a working local install. The next moves are: tune prompts (our DeepSeek prompt engineering guide is the fast track), build a retrieval layer for your own documents, or fine-tune a smaller distill on domain data. For the broader catalogue of walkthroughs, browse the DeepSeek tutorials hub. If you decide cloud beats local for your case after all, our DeepSeek API getting started guide gets you on the hosted endpoint in five minutes.

Can I install DeepSeek V4 on a laptop?

Not the full current models — the DeepSeek-V4-Pro-0813 and DeepSeek-V4.1-Flash-1017 weights take about 893 GB and 510 GB on Hugging Face and need server-class GPUs. On a laptop, install a DeepSeek-R1 distilled variant via Ollama instead; the 1.5B and 8B distills run on CPU or modest GPUs. For Apple Silicon Macs with 64 GB+ unified memory, heavily quantized 32B or 70B distills are realistic. See our DeepSeek system requirements page for specifics.

Is DeepSeek free to install locally?

Yes. Every recent DeepSeek release — V4.1-Flash-1017, V4-Pro-0813, V4.1-Flash, V3.2, V3.1 and R1 — publishes both code and model weights under the MIT license, so you can download and run them at no cost beyond your own hardware and electricity. The R1 distills most people install locally inherit their base models’ licences as well: Apache 2.0 for the Qwen-based ones and Meta’s Llama licence for the Llama-based ones. Some older releases (V3 base, Coder-V2, VL2) split MIT-licensed code from a separate DeepSeek Model License for weights; check each Hugging Face repo. More detail in is DeepSeek open source.

How much disk space do I need to install DeepSeek locally?

It depends on the variant. In Ollama’s library the 1.5B distill is a 1.1 GB download, the 8B distill 5.2 GB, the 32B 20 GB and the 70B 43 GB. The full DeepSeek-V4.1-Flash-1017 repository holds about 510 GB on Hugging Face and DeepSeek-V4-Pro-0813 about 893 GB. Always provision extra space for converted weights and the Hugging Face cache. Our DeepSeek hardware calculator helps size this.

Does a local install work offline?

Yes, once the model is downloaded. Ollama and vLLM both load weights from disk and run inference locally; no outbound network call is required for completions (Ollama’s :cloud tags are the exception — they run remotely). You only need internet for the initial model pull and for software updates. For an air-gapped workflow with traffic blocking and version pinning, follow our DeepSeek offline setup walkthrough.

What is the difference between local DeepSeek and the DeepSeek API?

The API is a hosted, stateless service at https://api.deepseek.com serving deepseek-flash and deepseek-v4-pro; you pay per token but get the latest weights with no hardware. A local install runs the open-weight version on your own GPU, which costs nothing per token but limits you to the snapshot you downloaded. The wire format is the same — both speak POST /chat/completions. See our DeepSeek API documentation for the hosted side.

Sources & Methodology

Last source check: October 23, 2026

Primary sources

Technical references

Context sources

  • DocumentationDeepSeek API Change LogCurrent model IDs and release dates; legacy-ID retirementLast checked: October 23, 2026

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 *