127.0.0.1:11434---
1. A working DeepSeek chat on your own machine — no subscription, no limits, no internet. The model is picked for your hardware: from 1.5B on an old laptop to 32B on a box with 24 GB of VRAM.
2. A script, deepseek-local.sh (Linux/macOS) or deepseek-local.ps1 (Windows) — it reads your RAM and VRAM, installs Ollama, pulls the right size, starts the service and prints tokens per second. One command instead of ten steps.
3. A test, test-local.py — 6 tasks (code generation, bug hunting, JSON extraction, text compression, arithmetic, Russian-language editing) checked automatically, with a report. It answers “does this model actually solve my tasks or just write nicely” with a number, not a feeling.
4. A ready system prompt and 5 task presets, so the local model works as an assistant from minute one instead of being a demo.
Two commands and you have a local DeepSeek. The first installs the engine, the second pulls a model and opens the chat.
Windows (PowerShell):
irm https://ollama.com/install.ps1 | iex
ollama run deepseek-r1:8bLinux / macOS:
curl -fsSL https://ollama.com/install.sh | sh
ollama run deepseek-r1:8bdeepseek-r1:8b is the right size for a laptop with 16 GB of RAM and 8 GB of VRAM. Different hardware needs a different model — see the table in Step 2. To leave the chat: /bye.
Optional accelerator. Three files ship with this guide and remove the guesswork:
bash deepseek-local.sh # Linux/macOS
powershell -ExecutionPolicy Bypass -File .\deepseek-local.ps1 # Windows
python3 test-local.py --model deepseek-r1:8b # task checkRead on for how it all works, which model fits your machine, and how to verify it on your own tasks.
Local inference is three independent layers, and confusing them causes 90% of the problems.
1. Model weights — a file of numbers (GGUF format). It is downloaded once and then read locally. The file size decides whether the model fits in memory.
2. Inference engine — the program that does the math: Ollama (a wrapper around llama.cpp), llama.cpp directly, LM Studio, vLLM. It keeps the model in RAM/VRAM and streams tokens back.
3. Client — what you actually use: a terminal, a browser, VS Code, a script. It talks to the engine over HTTP on 127.0.0.1:11434, including the OpenAI-compatible /v1 path.
The internet is needed only to download the weights. After that, packets go nowhere: 127.0.0.1 is loopback, traffic never leaves the machine. That is where “free” (you pay for electricity) and “no limits” come from.
The honest part, without which this guide is useless. “DeepSeek on a laptop” and “DeepSeek V4.1” are different things:
| What you pull | What it really is | Fits in |
|---|---|---|
| `deepseek-r1:1.5b`–`32b` | distills: Qwen2.5/Qwen3 models trained on R1 reasoning traces, under their base licences | an ordinary laptop |
| `deepseek-r1:70b` | a Llama 3.3 distill, Llama licence | 48 GB of VRAM or a 64 GB Mac |
| `deepseek-r1:671b` | the real DeepSeek-R1-0528 (MoE 671B/37B), MIT, ~404 GB | a 512 GB server |
| `DeepSeek-V4.1-Flash-1017` | the current open model, MIT, 552B backbone, 1M context | 128 GB of RAM + fast NVMe |
| `deepseek-v4.1-flash:cloud` | not local: requests go to Ollama servers, account and payment required | — |
So on budget hardware you get not the frontier model but its compressed student. An 8B distill writes code, extracts data and holds a conversation reliably, but loses to the cloud V4.1-Flash on hard multi-step tasks. The rest of this guide is about squeezing the most out of what actually fits, and measuring it.

What to do: run the script from the quick start. It does five things:
1. reads RAM (/proc/meminfo, hw.memsize, Win32_ComputerSystem) and VRAM (nvidia-smi; on Apple Silicon, 70% of unified memory);
2. picks the closest model size using the table in Step 2;
3. installs Ollama if it is missing;
4. starts the service on 127.0.0.1:11434 and pulls the weights;
5. sends a test request and computes tokens per second from eval_count/eval_duration.
How to verify it worked:
ollama list # the model is listed and its size is not zero
ollama ps # PROCESSOR: 100% GPU is good, CPU is bad
curl -s http://127.0.0.1:11434/api/tags | head -c 200ollama ps is the main diagnostic. If the PROCESSOR column contains CPU, some layers did not fit into VRAM and speed drops 5–20×. That is not a failure, it is a signal to pick a smaller size.
Critical parameters worth knowing up front:
| Parameter | Value | Why |
|---|---|---|
| `num_ctx` | 4096–8192 | context length; every extra 8K costs 0.5–1.5 GB of VRAM |
| `num_predict` | 2048+ | on reasoning models the “thinking” eats the budget and the answer gets cut off |
| `OLLAMA_KEEP_ALIVE` | `30m` | keeps the model in memory between requests, otherwise every call pays 5–15 s of loading |
| `OLLAMA_HOST` | `127.0.0.1:11434` | do not expose the service to the LAN unless you must |
| `OLLAMA_FLASH_ATTENTION` | `1` | less memory for context on supported GPUs |
| `temperature` | `0` for code and data extraction | repeatability; `0.6–0.8` for prose |
On Linux Ollama uses CUDA for NVIDIA, Metal on macOS, ROCm on AMD (the supported card list is limited; old AMD and Intel parts fall back to CPU, which is slow).
The table is based on file sizes in the Ollama library (Q4_K_M quantisation) and memory requirements. The rule is simple: the weights must fit entirely in VRAM, otherwise speed collapses.
| Hardware | Model (`ollama pull …`) | File | What you get |
|---|---|---|---|
| 8 GB RAM, no GPU | `deepseek-r1:1.5b` | 1.1 GB | drafts, short answers, simple questions; confused on anything hard |
| 16 GB RAM + 6–8 GB VRAM | `deepseek-r1:8b` | 5.2 GB | the workhorse: code, text, data extraction |
| 24 GB RAM + 12 GB VRAM | `deepseek-r1:14b` | 9.0 GB | noticeably better at following instructions and long documents |
| 32 GB RAM + 24 GB VRAM | `deepseek-r1:32b` | 20 GB | the ceiling for a single consumer card |
| 64 GB (Mac) / 48 GB VRAM | `deepseek-r1:70b` | 43 GB | top of the distills, slow on a laptop |
| 96–128 GB RAM + NVMe | `V4-Flash-0731` UD-IQ1_S | 82.5 GB | the full DeepSeek architecture at 1-bit quantisation |
| 128 GB RAM + fast NVMe | `V4.1-Flash-1017` UD-IQ1_S | 233 GB (122 GB resident) | the newest open DeepSeek, 5–10 tok/s |
| 512 GB and up | `deepseek-r1:671b` | 404 GB | the real R1, server only |
Three conclusions that save you an evening:
Ollama offers V4.1-Flash only as a cloud tag. Locally it runs under llama.cpp, with the Engram table (196.6B parameters) staying on the SSD instead of taking memory:
# 1) build llama.cpp b11870 or newer (deepseek41 architecture support)
git clone https://github.com/ggml-org/llama.cpp && cd llama.cpp
cmake -B build -DGGML_CUDA=ON && cmake --build build -j
# 2) download the 1-bit quant (233 GB)
pip install -U "huggingface_hub[cli]"
hf download unsloth/DeepSeek-V4.1-Flash-1017-GGUF \
--include "UD-IQ1_S/*" --local-dir ~/models/v41-flash
# 3) run with the Engram table memory-mapped from disk
./build/bin/llama-cli \
--model ~/models/v41-flash/UD-IQ1_S/*-00001-of-00005.gguf \
--temp 1.0 --top-p 1.0 --top-k 0 --min-p 0.0 \
--chat-template-kwargs '{"reasoning_effort":75}' \
--load-mode mmap --lazy-mode on \
--override-tensor "per_layer_token_embd.weight=CPU"reasoning_effort (1–100) is the cheapest speed knob you have: on weak hardware, 40–60 instead of 100 shortens the “thinking” without wrecking quality. --override-tensor ... =CPU keeps the Engram table in system memory rather than VRAM. If that is still too much, use V4-Flash-0731 (82.5 GB at IQ1_S): same architecture, less quality, half the requirements.

What to do: run test-local.py and look at two numbers instead of “I like it / I don’t”: how many tasks passed and how many tokens per second you get.
python3 test-local.py --model deepseek-r1:8bThe script asks six tasks and checks the answers automatically:
| Task | What is checked |
|---|---|
| Code generation | a `chunk(items, size)` function exists and returns |
| Bug hunting | the empty-list case is found (`len(xs) == 0` and similar) |
| JSON extraction | the answer parses as JSON and the numbers match: −18, 6, −3 |
| Text compression | ≤ 40 words (the prompt asks for 25) with all three numbers kept |
| Multi-step arithmetic | arrival time 18:25 |
| Russian-language editing | no anglicisms (“апдейт”, “пайплайн”, “фича”…) |
A sample report — measured on a laptop (RTX 4060 Laptop 8 GB, 22 GB RAM, Ollama 0.34, num_ctx=4096, temperature=0), two models on the same hardware:
| Task | `deepseek-r1:1.5b` (1.1 GB) | `deepseek-r1:8b` (5.2 GB) |
|---|---|---|
| Code generation | FAIL — looped for 40,960 tokens, returned nothing | OK, 23.5 s (including model load) |
| Bug hunting | FAIL — same loop | OK, 30.2 s |
| JSON extraction | FAIL — numbers as strings `"-18%"` instead of `-18` | OK, 12.1 s |
| Text compression | FAIL — 40 words instead of 25, anglicism in the answer | OK, 14.3 s |
| Multi-step arithmetic | FAIL — 18:40 instead of 18:25 | OK, 10.1 s |
| Russian-language editing | OK | OK, 16.1 s |
| **Total** | **1/6** | **6/6** |
| Average speed | 162 tok/s on short answers, but two requests took 4.5 minutes | 31.3 tok/s |
That is the answer to “is DeepSeek worth installing on a laptop”: 8B closes all six tasks in under two minutes, 1.5B closes one and falls into endless “thinking” twice.
How to read the result. 5–6 out of 6 — good enough for daily work: code, documents, data extraction. 3–4 — partial: keep it for drafts and check facts. 0–2 — the size is too small for your tasks; go bigger or keep the local model for private text only. Speed below 8 tok/s on 8B means the model fell back to CPU: check ollama ps and the troubleshooting section below.
The measurements matter because “DeepSeek R1 is bad” is usually said by people who tried 1.5B at a low quant: on six typical tasks it scores 1/6, and the whole family gets blamed for it.
Paste into ollama run <model> or into the API. All verified on the 8B distill.
You are a code reviewer. Inspect the snippet and return: (1) the bug, (2) why it shows up, (3) the fixed line. No praise, no restating the code. If there is no bug, say "no bugs found".
[insert code]Compress the document into 7 bullets. One sentence per bullet, 20 words max. Keep every number, date and name. Do not add anything of your own. End with one line "Risks:" listing what the text does not say but the numbers imply.
[insert text]Extract data strictly as JSON, no markdown fence, no commentary. Schema: {"counterparty": str, "amount": number, "currency": "USD"|"EUR"|"RUB", "date": "YYYY-MM-DD", "items": [str]}. If a field is absent, use null. Do not invent anything.
[insert contract or email text]Rewrite the text in plain language without jargon or legalese. Keep the meaning and every fact. Length no longer than the original. Return only the rewritten text.
[insert text]You are a planner. Break the task into steps of 30 minutes or less. For each step give: the action, the result, and how to verify the step is done. If the task needs external data, make that a separate step. Do not invent deadlines that are not in the input.
Task: [describe the task]What to do: turn off Wi-Fi/Ethernet (or enable airplane mode) and repeat a request. This is not a formality: without the check you can stay on a cloud tag and never notice.
# 1) the model answers without a network
ollama run deepseek-r1:8b "What is 17*23? Number only."
# 2) the service listens on loopback only
ss -tlnp | grep 11434 # Linux: 127.0.0.1:11434, not 0.0.0.0
netstat -ano | findstr 11434 # Windows
# 3) no outbound connections while answering
ss -tpn | grep ollama # Linux: local sockets onlyThe “really offline” checklist:
ollama list has no tags containing :cloud;ollama ps shows 100% GPU (or CPU — but your own, local model);ollama.exe (on Windows, add a block rule for ollama.exe and ollama app.exe);deepseek-r1:* is local, deepseek-v4.1-flash:cloud is not.Updating Ollama and pulling new models obviously need the network — but those are separate actions, not the model working.

A system prompt for a local assistant. Built for reasoning models (R1 distills): it demands the answer without the “thinking” in the output, admits uncertainty and does not ramble.
You are a local AI assistant running on my computer. You work without internet, so never cite websites, never invent sources and never suggest "googling". If data is missing, say exactly what is missing and what to paste.
Answer rules:
1. Result first, explanation second. 120 words max unless asked for more.
2. Code must be working and complete, no "..." and no pseudocode. State the language.
3. Copy numbers, dates and names from the input unchanged. Do not round or recompute unless asked.
4. If you do not know, say "I don't know" plus one sentence on what to verify. Do not guess.
5. No flattery, no restating the task. No openers like "Great question".
6. If the task is ambiguous, ask one clarifying question, but first give the best answer under a reasonable assumption and name that assumption.
7. Formatting: plain text and lists. Markdown tables only for comparisons. No headings.
Answer in English unless asked for another language.What to replace before use:
in English → your working language;120 words → your length limit;a local AI assistant → a role (“Python reviewer”, “editor”, “contract analyst”).For code tasks, append: Environment: Python 3.12, standard library only — the model stops suggesting pandas where csv would do.
Cause: the model did not fit in VRAM and layers moved to RAM. Check:
ollama ps
# NAME SIZE PROCESSOR UNTIL
# deepseek-r1:14b 11 GB 62%/38% CPU 4 minutes from nowFix in this order: drop a size (14b → 8b); lower num_ctx to 2048; close the browser and games that hold VRAM; on 8 GB cards keep OLLAMA_NUM_PARALLEL at 1. If CPU still appears, that is the hardware limit, not a setting.
Cause: context plus weights exceed VRAM. 8B at Q4 is 5.2 GB of weights, but with num_ctx=32768 and the KV cache it easily passes 8 GB. Fix:
OLLAMA_CONTEXT_LENGTH=4096 ollama serveand "options": {"num_ctx": 4096} in the request. OLLAMA_FLASH_ATTENTION=1 helps on supported GPUs. Do not set a huge context “just in case”: you pay for it in memory and in speed on every token.
Most likely you pulled 1.5b or 7b and expect a cloud chatbot. Check ollama list: if it says deepseek-r1:1.5b, this is normal behaviour for 1.1 GB of weights. Two options: go up to 8b/14b (needs 16–24 GB of RAM), or keep the small one for drafts and send hard tasks to the cloud. Third option: lower your format expectations — small models do better with short instructions and one example than with a long rulebook.
In our measurements 1.5B looped twice: 40,960 reasoning tokens and an empty answer. That is not an Ollama bug, it is how a small reasoning distill behaves. Constrain it:
ollama run deepseek-r1:8b
>>> /set parameter num_predict 2048Through the API use "options": {"num_predict": 2048, "temperature": 0.3} and add to the prompt: Think for no more than 150 words, then answer. If the answer is still empty, check message.thinking — reasoning models sometimes put the final text there and leave content blank. Above all: loops are a sign the model is too small; 8B answers the same prompts immediately.
That is the network, not the model. Ollama resumes: a repeated ollama pull continues where it stopped. For large quants (80 GB+) hf download --resume plus a GGUF import via Modelfile is more reliable. Check free space: df -h on Linux/macOS, Get-PSDrive on Windows — 233 GB of V4.1-Flash will not fit on a disk with 100 GB free.
The installer updates PATH, but the current terminal does not see it. Close and reopen PowerShell, or run:
$env:Path = [Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [Environment]::GetEnvironmentVariable("Path","User")http://127.0.0.1:11434, model deepseek-r1:8b. Use deepseek-coder:6.7b for autocomplete and a reasoning model for chat.import json, urllib.request
body = json.dumps({
"model": "deepseek-r1:8b",
"messages": [{"role": "user", "content": "Say one word: working"}],
}).encode()
req = urllib.request.Request(
"http://127.0.0.1:11434/v1/chat/completions",
data=body, headers={"Content-Type": "application/json", "Authorization": "Bearer ollama"},
)
print(json.load(urllib.request.urlopen(req))["choices"][0]["message"]["content"])More on the site: how much RAM and VRAM a local model needs, VRAM measurements on an RTX 4060, llama.cpp vs vLLM, downloading a model from Hugging Face, a local server on Strix Halo.
127.0.0.1; traffic stays inside the machine./v1/chat/completions request format that most AI apps understand.Status: practical guide. Some statements come from vendors; verify in your environment.
Run DeepSeek locally: pick a model for your hardware, install Ollama, test it on 6 tasks, verify offline mode and fix common errors. Script and test included.
Machine data: Citation Map JSON · JSON-LD · Semantic Embeddings — separate stage.
| Entity | Type | Role |
|---|---|---|
| DeepSeek | компания | упоминается в заголовке, TL;DR или разделах гайда |
| локальная модель | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Ollama | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| офлайн | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| GGUF | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| без интернета | тема/инструмент | упоминается в заголовке, TL;DR или разделах гайда |
| Windows | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Linux | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| macOS | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
| Python | платформа/технология | упоминается в заголовке, TL;DR или разделах гайда |
No independent confirmation is provided; source claims and editorial conclusions are separated below.
| Source | Type | Role |
|---|---|---|
| ollama.com | внешний источник | ссылка из тела гайда |
| ollama.com | внешний источник | ссылка из тела гайда |
| github.com | внешний источник | ссылка из тела гайда |
Cite as: AI Release. Как установить DeepSeek на свой ПК и работать без интернета: от 8 ГБ ОЗУ до 128 ГБ. ai-release.org.