Simon Willison’s Weblog

Subscribe

DeepSeek-R1 and exploring DeepSeek-R1-Distill-Llama-8B

20th January 2025

DeepSeek are the Chinese AI lab who dropped the best currently available open weights LLM on Christmas day, DeepSeek v3. That model was trained in part using their unreleased R1 “reasoning” model. Today they’ve released R1 itself, along with a whole family of new models derived from that base.

There’s a whole lot of stuff in the new release.

DeepSeek-R1-Zero appears to be the base model. It’s over 650GB in size and, like most of their other releases, is under a clean MIT license. DeepSeek warn that “DeepSeek-R1-Zero encounters challenges such as endless repetition, poor readability, and language mixing.” ... so they also released:

DeepSeek-R1—which “incorporates cold-start data before RL” and “achieves performance comparable to OpenAI-o1 across math, code, and reasoning tasks”. That one is also MIT licensed, and is a similar size.

I don’t have the ability to run models larger than about 50GB (I have an M2 with 64GB of RAM), so neither of these two models are something I can easily play with myself. That’s where the new distilled models come in.

To support the research community, we have open-sourced DeepSeek-R1-Zero, DeepSeek-R1, and six dense models distilled from DeepSeek-R1 based on Llama and Qwen.

This is a fascinating flex! They have models based on Qwen 2.5 (14B, 32B, Math 1.5B and Math 7B) and Llama 3 (Llama-3.1 8B and Llama 3.3 70B Instruct).

Weirdly those Llama models have an MIT license attached, which I’m not sure is compatible with the underlying Llama license. Qwen models are Apache licensed so maybe MIT is OK?

(I also just noticed the MIT license files say “Copyright (c) 2023 DeepSeek” so they may need to pay a little bit more attention to how they copied those in.)

Licensing aside, these distilled models are fascinating beasts.

Running DeepSeek-R1-Distill-Llama-8B-GGUF

Quantized versions are already starting to show up. So far I’ve tried just one of those— unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF released by Unsloth AI—and it’s really fun to play with.

I’m running it using the combination of Ollama, LLM and the llm-ollama plugin.

First I fetched and ran the model using Ollama itself:

ollama run hf.co/unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF:Q8_0

This downloads around 8.5GB of model data and starts an interactive chat interface.

Once the model has been fetched, LLM can talk to it as well. I prefer using LLM for experiments because it logs everything to SQLite for later exploration.

I installed the plugin and ran it like this:

llm install llm-ollama
llm -m 'hf.co/unsloth/DeepSeek-R1-Distill-Llama-8B-GGUF:Q8_0' \
  'a joke about a pelican and a walrus who run a tea room together'

Each response starts with a <think>...</think> pseudo-XML tag containing the chain of thought used to help generate the response. For “a joke about a pelican and a walrus who run a tea room together” that started like this:

<think>
Okay, so I need to come up with a joke about a pelican and a walrus running a tea room together. Hmm, that’s an interesting combination. Let me think about how these two characters might interact in a humorous situation.

First, let’s consider their characteristics. Pelicans are known for their long beaks and Webbed feet, often seen near the beach or water. Walruses have big teeth, thick fur, and they’re generally found in colder climates, like icebergs or snowy areas. So, combining these two into a tea room setting is already a funny image.

[...]

It then thought for 20 paragraphs before outputting the joke! Here’s the full transcript and here’s the output at the end, after the </think> tag:

The Joke:

A pelican and a walrus decide to open a quaint little tea room together. The walrus, with its big size, struggles to find comfortable chairs, so it sits on the table by accident, knocking over the teapot. Meanwhile, the pelican, trying to help, uses its beak to place saucers on the table, causing a few spills.

After a series of comical mishaps, the walrus looks up and says with a grin, “This isn’t so fishy anymore.” The pelican smirks and remarks, “Maybe not, but we do have a lot of krill in our tea!”

Explanation:

  • Setup: Pelican and Walrus run an unlikely tea room. Their sizes lead to comedic chaos.
  • Punchline: “This isn’t so fishy anymore” is a pun on the situation becoming less absurd. The follow-up joke introduces “krill,” a play on words that ties into both marine life (“fish”) and tea, making it humorous while fitting the theme.

So yeah, the joke is awful. But the process of getting there was such an interesting insight into how these new models work.

This was a relatively small 8B model. I’m looking forward to trying out the Llama 70B version, which isn’t yet available in a GGUF I can run with Ollama. Given the strength of Llama 3.3 70B—currently my favourite GPT-4 class model that I’ve run on my own machine—I have high expectations.

Can it draw a pelican?

I tried my classic Generate an SVG of a pelican riding a bicycle prompt too. It did not do very well:

Blue square, abstract white shape on it

It looked to me like it got the order of the elements wrong, so I followed up with:

the background ended up covering the rest of the image

It thought some more and gave me this:

Blue square, abstract white shape on it

As with the earlier joke, the chain of thought in the transcript was far more interesting than the end result.

This is DeepSeek-R1 and exploring DeepSeek-R1-Distill-Llama-8B by Simon Willison, posted on 20th January 2025.

Part of series LLMs on personal devices

  1. Running Llama 3.2 Vision and Phi-3.5 Vision on a Mac with mistral.rs - Oct. 19, 2024, 4:14 p.m.
  2. Qwen2.5-Coder-32B is an LLM that can code well that runs on my Mac - Nov. 12, 2024, 11:37 p.m.
  3. I can now run a GPT-4 class model on my laptop - Dec. 9, 2024, 3:08 p.m.
  4. DeepSeek-R1 and exploring DeepSeek-R1-Distill-Llama-8B - Jan. 20, 2025, 3:20 p.m.

Previous: My AI/LLM predictions for the next 1, 3 and 6 years, for Oxide and Friends