How to Run DeepSeek on Ollama: Local Setup, Models, and Tips

You want a DeepSeek model on your laptop — answering prompts without sending tokens to a remote API, working on a flight, or just keeping a private notebook of experiments. Running DeepSeek on Ollama is the most direct way to get there: one binary, one pull, and a chat session in the terminal. By the end of this guide you will have picked a DeepSeek variant that fits your hardware, pulled it through Ollama, run a first prompt, exposed it to VS Code or a Python script, and learned where local hits a wall and Ollama’s cloud tags or DeepSeek’s hosted API take over. Model tags and sizes below are as listed in the Ollama library on 23 October 2026.
What you’ll build

By the end of this tutorial you will have:
- Ollama installed on macOS, Windows or Linux, with the background service listening on
http://localhost:11434. - At least one DeepSeek model — an R1 distill or DeepSeek Coder running locally, or the cloud-hosted
deepseek-v4.1-flash/deepseek-v4-protags via Ollama’s cloud. - A working REST call against Ollama’s API, plus a Python snippet using the
ollamapackage. - An honest sense of when running DeepSeek on Ollama is the right call, and when you should be hitting DeepSeek’s hosted API instead.
Two notes before we start. First, “DeepSeek” on Ollama is a family — R1 and its distills, the older V3 and V3.1, DeepSeek Coder and DeepSeek-OCR as downloadable models, plus cloud-only tags for the current V4.1-Flash and V4-Pro. They have very different hardware profiles. Second, Ollama is not the DeepSeek API. The official hosted API on https://api.deepseek.com is OpenAI-compatible and has its own pricing, parameter set, and thinking-mode parameters described in the DeepSeek API documentation. Local and hosted are complementary, not interchangeable.
Prerequisites
- Operating system: macOS 14 Sonoma or newer, Windows 10 22H2 or newer, or a recent Linux distribution (Ollama’s system requirements, checked 23 October 2026).
- Disk space: 5 GB minimum for a small distill, 40 GB+ for mid-range models, 400 GB+ for the full R1 671B weights.
- RAM: 8 GB will run a 1.5B distill; 16 GB is the practical floor for 7B–8B; 32 GB+ for anything in the 14B–32B range.
- GPU (recommended): a CUDA-capable NVIDIA GPU, an Apple Silicon Mac, or an AMD ROCm-supported card. CPU-only works but is slow.
- Optional: an Ollama account if you want to use cloud-hosted DeepSeek models (Ollama says most cloud models need a paid plan or purchased credits); a DeepSeek API key if you intend to fall back to DeepSeek’s hosted API. See get a DeepSeek API key.
If you are unsure what your machine can handle, our DeepSeek hardware calculator estimates VRAM and RAM needs by model size and quantisation.
Pick the right DeepSeek model for your hardware
This is the step most people skip and then regret. The DeepSeek family on Ollama spans three orders of magnitude in size. The table below summarises the variants you are most likely to pull; sizes on disk are the ones the Ollama library lists, and the memory figures are rough guidance.
| Ollama tag | Type | Approx. size on disk | Best for | Runs locally? |
|---|---|---|---|---|
deepseek-r1:1.5b |
R1 distill (Qwen base) | ~1.1 GB | Quick math/logic, low-end laptops | Yes — 8 GB RAM |
deepseek-r1:8b |
R1-0528 distill (Qwen3-8B base) | ~5.2 GB | General reasoning on a 16 GB machine | Yes — 16 GB RAM / 8 GB VRAM |
deepseek-r1:14b |
R1 distill (Qwen base) | ~9 GB | Stronger reasoning, mid-range GPU | Yes — 24 GB RAM / 12 GB VRAM |
deepseek-r1:32b |
R1 distill (Qwen base) | ~20 GB | Workstation-grade reasoning | Yes — 32 GB+ RAM / 24 GB VRAM |
deepseek-r1:671b |
Full R1 MoE | ~404 GB | Multi-GPU servers | Rarely — server-class only |
deepseek-coder:6.7b |
Code completion | ~3.8 GB | FIM and code chat | Yes — 16 GB RAM |
deepseek-v4.1-flash:cloud |
Cloud-hosted DeepSeek-V4.1-Flash (text and image input) | n/a (cloud) | Current DeepSeek Flash model without local hardware | Cloud only |
deepseek-v4-pro:cloud |
Cloud-hosted DeepSeek-V4-Pro | n/a (cloud) | Agentic and coding workflows | Cloud only |
About the distills. Ollama’s DeepSeek-R1 page explains that DeepSeek’s team showed the reasoning patterns of larger models can be distilled into smaller dense models, which then perform well on benchmarks. The 8b tag is now DeepSeek-R1-0528-Qwen3-8B; the other small tags are DeepSeek-R1-Distill-Qwen models (and 70b is a Llama-based distill). Licensing differs by layer: the DeepSeek-R1 weights are MIT-licensed and allow commercial use and derivative works, while the Qwen distills derive from Qwen-2.5 (originally Apache 2.0) and the Llama distills from Llama 3.x under Meta’s licence. For a deeper look at the distill family, see DeepSeek R1 Distill.
About V4 on Ollama. As of 23 October 2026 the Ollama library lists two current DeepSeek V4-family entries, both cloud-only: deepseek-v4.1-flash (tags :cloud and :1017-cloud, with a 1M-token context and text and image input) and deepseek-v4-pro (tags :cloud and :0813-cloud, 1M-token context, text input). Requests run on Ollama’s servers, not your machine, so you need an Ollama account. The older deepseek-v4-flash entry was retired on 25 September 2026 and deepseek-v3.2 on 15 July 2026, according to their Ollama pages. Running the V4 open weights yourself is server work: DeepSeek’s V4-Pro-0813 model card uses a 4×GB300 node as its vLLM example.
Step 1 — Install Ollama
Ollama publishes installers for macOS, Windows and Linux. On macOS or Linux, the one-line installer is the simplest path:
curl -fsSL https://ollama.com/install.sh | sh
On Windows, run the PowerShell equivalent, irm https://ollama.com/install.ps1 | iex. macOS and Windows users can also download a GUI installer from ollama.com/download; this guide focuses on the command-line tool.
Verify the install:
ollama --version
ollama list
The Ollama service should be running in the background — normally you don’t need to start it manually, and it listens on port 11434 by default. If ollama list errors out with a connection refused, start the daemon with ollama serve in another terminal.
Step 2 — Pull a DeepSeek model
Pulling a model downloads the weights and registers them with the local Ollama daemon. For a first run on a 16 GB laptop, the 8B R1 distill is a good balance of capability and size:
ollama pull deepseek-r1:8b
If you have less RAM, swap in deepseek-r1:1.5b. If you are coding and want completion plus chat, pull deepseek-coder:6.7b instead — Ollama describes DeepSeek Coder as trained on two trillion code and natural-language tokens, and lists a 16K context window for its tags. For broader context on the coder line, see our DeepSeek Coder V2 page.
To use the cloud-hosted V4.1-Flash through Ollama, sign in first, then run the cloud tag:
ollama signin
ollama run deepseek-v4.1-flash:cloud
Cloud tags do not download weights to your disk; they route requests through Ollama’s hosted infrastructure. That is useful when your hardware cannot fit the model but you want to keep the same client code path. Ollama’s model pages list per-token costs for these tags — for deepseek-v4.1-flash, $0.30 input / $1.20 output per 1M tokens at peak and $0.15 / $0.60 off-peak, the same as DeepSeek’s own deepseek-flash rates.
Step 3 — Run your first prompt

The fastest sanity check is an interactive session:
ollama run deepseek-r1:8b
You will get a chat prompt where each message is sent to the local model. Ask it something deliberately reasoning-flavoured — “If a train leaves Manchester at 14:05 travelling at 90 km/h…” — and you should see R1’s thinking-style output before the final answer. Type /bye to exit.
For a one-shot prompt without entering interactive mode, append the prompt directly:
ollama run deepseek-r1:8b "Summarise the CAP theorem in 80 words."
Step 4 — Call the local API from code
Ollama exposes an HTTP API on port 11434. The chat endpoint mirrors OpenAI’s request shape closely enough that wiring up clients is trivial.
A minimal curl call:
curl http://localhost:11434/api/chat -d '{
"model": "deepseek-r1:8b",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": false
}'
The same call from Python using the official ollama package (pip install ollama):
from ollama import chat
response = chat(
model="deepseek-r1:8b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.message.content)
Both shapes are taken from the model’s own page on the Ollama library; the JS equivalent uses npm i ollama and the same chat() call. To call a cloud tag directly from code, Ollama’s model pages point the client at https://ollama.com with an OLLAMA_API_KEY bearer token. For a deeper Python walk-through that goes beyond a hello-world, see our DeepSeek Python integration guide.
Local vs hosted, in one paragraph. The Ollama endpoint above runs on your machine and has no per-token cost. The hosted DeepSeek API at https://api.deepseek.com is a different surface entirely — chat requests there hit POST /chat/completions, the OpenAI-compatible endpoint, and the API is stateless: clients must resend the full conversation history with every request. It serves two models, deepseek-flash (DeepSeek-V4.1-Flash-1017) and deepseek-v4-pro (DeepSeek-V4-Pro-0813), each with a 1M-token context and up to 384K output tokens. Thinking mode is a request parameter, on by default — reasoning_effort="high" with extra_body={"thinking": {"type": "enabled"}} in the OpenAI Python SDK — not a separate model ID, and the response returns reasoning_content alongside the final content.
Step 5 — Wire it into your editor
The most common reason to run DeepSeek locally is code assistance without leaking source to a third party. Two paths work well:
- VS Code with a local-LLM extension. Continue, Cline, and similar plugins accept an Ollama base URL and a model name. Point them at
http://localhost:11434and thedeepseek-coder:6.7bordeepseek-r1:14bmodel. Full walk-through in our DeepSeek with VS Code tutorial. - Ollama’s
launchintegrations.ollama launchconnects Ollama models to agents such as Claude Code, OpenCode and OpenClaw. The DeepSeek model pages give examples likeollama launch claude --model deepseek-v4.1-flash:cloudandollama launch opencode --model deepseek-v4-pro:cloud.
Verify it worked
Three quick checks confirm a healthy local install:
ollama listshows your DeepSeek model with a non-zero size.ollama psshows the models currently loaded into memory after a request, including a PROCESSOR column with the CPU/GPU split — useful when you want to know why your VRAM is full.- The curl call from Step 4 returns JSON with a non-empty
message.content.
Common errors and fixes
| Symptom | Likely cause | Fix |
|---|---|---|
Error: connection refused on port 11434 |
Daemon not running | Run ollama serve in a separate terminal, or restart the desktop app |
| Model loads but generates one token per second | Layers spilling to CPU | Pick a smaller model or quantisation, e.g. deepseek-r1:8b over :14b |
out of memory at first prompt |
Context window too large for VRAM | Lower num_ctx in the request, or close other GPU apps |
| Cloud tag fails with “unauthorised” | Not signed in to Ollama, or no cloud plan/credits | Run ollama signin or set OLLAMA_API_KEY; check your Ollama plan |
Old deepseek-v4-flash:cloud or deepseek-v3.2:cloud tag no longer works |
Retired in the Ollama library | Switch to deepseek-v4.1-flash:cloud or deepseek-v4-pro:cloud |
| R1 emits long <think> sections that get cut off | Output token cap too low | Raise num_predict / max_tokens in the request body |
When local is the wrong answer

Running DeepSeek on Ollama is the right tool for privacy-sensitive work, offline use, and latency-bound workflows on capable hardware. It is the wrong tool for three cases.
First, top-end quality. The 8B and 14B distills are not the same model as DeepSeek-V4-Pro-0813, DeepSeek-V4.1-Flash-1017 or even full R1. If you need the current models, use Ollama’s cloud tags or DeepSeek’s hosted API, and read our DeepSeek V4-Pro notes for the trade-offs.
Second, 1M-token context. Both hosted DeepSeek models offer a 1M-token context window with up to 384K output tokens. The R1 distill tags list a 128K window in the Ollama library (160K for the full 671b tag), and long contexts need a lot of extra memory on a local machine.
Third, cost-per-call at scale. Your own hardware and electricity are not free, and hosted rates are low: as of October 2026, deepseek-flash lists $0.30 input (cache miss) / $1.20 output per 1M tokens at peak and $0.15 / $0.60 off-peak, and deepseek-v4-pro $1.32 / $3.96 at peak and $0.66 / $1.98 off-peak. See DeepSeek API pricing for the full table, and use our DeepSeek pricing calculator for your own shape of traffic.
Next steps
Three things to do next, in order of likely value:
- If you want a fully air-gapped setup, follow the DeepSeek offline setup guide.
- If your goal is document Q&A on local files, the DeepSeek RAG tutorial shows how to plug an Ollama-hosted DeepSeek into a vector store.
- If you also want to compare against other open-weight families on the same machine, browse the DeepSeek tutorials hub for parallel walk-throughs and the DeepSeek models hub for the full lineup.
How do I install DeepSeek R1 on Ollama?
Install Ollama from ollama.com/download (or via the macOS/Linux one-liner curl -fsSL https://ollama.com/install.sh | sh), then pull the size that fits your machine: ollama pull deepseek-r1:8b for a 16 GB laptop, :1.5b for low-end hardware, :14b or :32b for a workstation. Run it with ollama run deepseek-r1:8b. For a fuller local-first walk-through, see our guide on how to install DeepSeek locally.
What hardware do I need to run DeepSeek on Ollama?
The 1.5B distill runs on 8 GB of RAM, the 8B distill needs 16 GB of RAM or roughly 8 GB of VRAM, the 14B needs 24 GB, and 32B comfortably uses a workstation with 24 GB+ of VRAM. The full 671B R1 (about 404 GB on disk) is server-class and effectively unrunnable on consumer hardware, and the V4-family models are cloud-only on Ollama. Our DeepSeek hardware calculator gives a per-model estimate and our DeepSeek system requirements page covers GPU and OS specifics.
Is running DeepSeek on Ollama free?
Yes for the local tags. Ollama itself is free, the R1 weights are MIT-licensed (the distills also carry their Qwen or Llama base licences), and you pay nothing per token because inference runs on your hardware. Cloud tags like deepseek-v4.1-flash:cloud and deepseek-v4-pro:cloud run on Ollama’s servers; Ollama lists per-token costs for them, and says most cloud models need a paid plan or purchased credits. Hosted access through DeepSeek’s own API is metered separately. See is DeepSeek free for the broader picture across surfaces.
Can I use DeepSeek with VS Code through Ollama?
Yes. Install a local-LLM extension such as Continue or Cline, point its provider settings at http://localhost:11434, and select a pulled DeepSeek tag — deepseek-coder:6.7b for completion, or deepseek-r1:14b for chat reasoning. Ollama also ships a launch command that wires popular agents to Ollama models. Step-by-step instructions live in our DeepSeek with VS Code tutorial.
Why is my Ollama DeepSeek response so slow?
Usually because the model does not fit in VRAM and layers are spilling to CPU. Run ollama ps after a prompt — if the PROCESSOR column shows a CPU percentage above zero, drop down a size (e.g. from :14b to :8b) or switch to a smaller quantisation. Closing browser tabs and other GPU consumers helps too. The general DeepSeek troubleshooting guide has more diagnostic steps.
Sources & Methodology
Primary sources
- OfficialDeepSeek API documentationEndpoints, request/response shape, model IDsLast checked: October 23, 2026
- RepositoryOllama download pageCross-platform Ollama installers (macOS/Linux shell one-liner, Windows PowerShell) and the note that most cloud models need a paid plan or creditsLast checked: October 23, 2026
- RepositoryOllama library: deepseek-r1R1 and distill tags, sizes on disk, base models and licence notesLast checked: October 23, 2026
- RepositoryOllama library: deepseek-v4.1-flashCloud tags, context, input types, listed peak/off-peak costs and ollama launch examplesLast checked: October 23, 2026
- RepositoryOllama library: deepseek-v4-proCloud tags and ollama launch examples for V4-ProLast checked: October 23, 2026
- Official documentationDeepSeek API pricing pageHosted model names, context, max output and peak/off-peak pricesLast checked: October 23, 2026
Technical references
- Technical reportDeepSeek-V3 technical report (arXiv:2412.19437)V3 architecture and training methodologyLast checked: October 23, 2026
- Technical reportDeepSeek-R1 paper (arXiv:2501.12948)R1 reasoning approach, distillation resultsLast 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.
