# How do you run a distilled DeepSeek-R1 model with Ollama?

Date: 2025-02-04 · Author: Robert Scales · https://guidetoartificialintelligence.com/en/learn/run-distilled-deepseek-r1-model-ollama/

**Answer:** Install Ollama, open a terminal and type "ollama run deepseek-r1", which downloads the 4.7 GB 7B distilled model and starts a chat on your own machine. Swap in a size tag such as deepseek-r1:1.5b or deepseek-r1:14b to match your computer's memory.

Running DeepSeek-R1 on your own computer means your questions never leave it. There's no account to create, no server abroad storing your chats, and it keeps working without an internet connection. The catch is that the full R1 is far too large for a personal computer. What you can run is one of its distilled versions, and Ollama, a free tool for running language models locally, makes that a two-command job.

## What "distilled" means

Distillation is a way of passing skills from a large model to a smaller one. The large model, called the teacher, produces many worked answers; a smaller model, the student, is then fine-tuned (given extra training) on those answers so it learns to imitate them. The student ends up far better at the teacher's specialty than it was, though not as good as the teacher.

DeepSeek did exactly this with R1. It took open models from two existing families, Alibaba's Qwen 2.5 and Meta's Llama, and trained them on reasoning examples generated by R1, about 800,000 samples for the Qwen versions. The result is six distilled models from 1.5 billion to 70 billion parameters (the adjustable numbers a model learns; more parameters usually means more capable and more demanding). They behave like small reasoning models: before answering, they write out their thinking, wrapped in `<think>` tags, and then give a final answer.

## A worked install, step by step

**1. Install Ollama.** On a Mac or Windows PC, download the installer from ollama.com and run it. On Linux, the project's documented one-line install is:

```bash
curl -fsSL https://ollama.com/install.sh | sh
```

**2. Download and start the model.** Open a terminal (Terminal on a Mac, PowerShell on Windows) and type:

```bash
ollama run deepseek-r1
```

Without a size tag, Ollama fetches its default version, the 7B model distilled into Qwen, a 4.7 GB download. When it finishes, you get a `>>>` prompt where you can type.

**3. Ask a question that needs reasoning.**

```prompt
I have 3 boxes. One holds only apples, one only oranges, and one a mix. All three labels are wrong. I may take one fruit from one box. Which box should I pick from to relabel all three correctly? Put your final answer in one sentence at the end.
```

You'll see the model's reasoning scroll past first, often several paragraphs of it, then the answer. Read the thinking: it shows you how the model approached the puzzle, and where it went astray if it did. Type `/bye` to leave the chat.

**4. Manage your models.** A few more commands cover everyday use:

```bash
ollama run deepseek-r1:1.5b   # a different size: add a tag
ollama list                   # models you have downloaded
ollama ps                     # models currently loaded in memory
ollama rm deepseek-r1:1.5b    # delete one to free disk space
```

DeepSeek's own advice for these models: avoid a system prompt and put every instruction in your message, use a temperature (the randomness setting) around 0.6, and for math, ask for the final answer in a clearly marked place.

> **Try it:** Run the same fruit-box puzzle on deepseek-r1:1.5b and on the default 7b model. Compare the length of the thinking, the time each takes, and whether both reach the right answer.

## Which size fits your computer?

Memory is the deciding factor. A model has to fit in your computer's RAM (or a graphics card's memory) while it runs, with room left for everything else you have open. Ollama's documentation gives a rule of thumb of at least 8 GB of RAM for 7B models, 16 GB for 13B models and 32 GB for 33B models. Applied to the sizes Ollama offers for R1, that gives this rough guide:

| Tag | Based on | Download | Suggested RAM |
|---|---|---|---|
| deepseek-r1:1.5b | Qwen 2.5 | 1.1 GB | 8 GB or less |
| deepseek-r1:7b (default) | Qwen 2.5 | 4.7 GB | 8 GB |
| deepseek-r1:8b | Llama 3.1 | 4.9 GB | 8 to 16 GB |
| deepseek-r1:14b | Qwen 2.5 | 9.0 GB | 16 GB |
| deepseek-r1:32b | Qwen 2.5 | 20 GB | 32 GB |
| deepseek-r1:70b | Llama 3.3 | 43 GB | 64 GB |
| deepseek-r1:671b | full R1 | 404 GB | server hardware |

The RAM column is a guide extrapolated from Ollama's rule, not a guarantee; speed also depends heavily on your processor and graphics card. On a typical 8 GB laptop, start with 1.5b or 7b. With 16 GB, try 14b, which reasons noticeably better on multi-step problems. The 32b and 70b models are where the distilled versions start to approach the quality DeepSeek reports for its larger systems, but they need a well-equipped workstation or a high-memory Mac.

A simple way to decide: start one size below what you think you can handle. If answers arrive at a comfortable reading pace and your computer stays responsive, step up one size. If the fan roars and words appear one every few seconds, step down. Whatever you choose, remember that a small distilled model is a learner's version of R1: good for practice, private drafts and puzzles, and less reliable than the full model on hard questions.

## Sources

- deepseek-r1 (Ollama model library): https://ollama.com/library/deepseek-r1
- DeepSeek-R1 (README): https://github.com/deepseek-ai/DeepSeek-R1
- Ollama README (commit of February 3, 2025): https://github.com/ollama/ollama/blob/d4d338c2248ad015334e7b94c4ddb8cc744083a2/README.md
