How to Run DeepSeek on a Raspberry Pi 5: Step-by-Step Guide
by Elecrow in Circuits > Raspberry Pi
119 Views, 1 Favorites, 0 Comments
How to Run DeepSeek on a Raspberry Pi 5: Step-by-Step Guide

DeepSeek has recently become a hot topic on the stage. As a powerful open-source large language model designed for various AI applications, from natural language processing to content generation, it comes in multiple model sizes, making it adaptable to different computing environments.
While DeepSeek-R1 is typically run on high-performance hardware, it can also be deployed on a Raspberry Pi 5 with proper optimization. This guide will walk you through setting up a compatible environment, installing necessary tools, and running DeepSeek-R1 on the Raspberry Pi 5 using the Ollama platform. Whether you're looking for a lightweight model for quick responses or a more advanced version for better accuracy, this tutorial will help you get started.
Supplies
Setting Up a Virtual Environment
To prevent conflicts with the system’s default settings, it’s best to create a virtual environment for model deployment. This ensures that any changes made for DeepSeek do not affect other applications.
Creating a Project Directory and Virtual Environment
Open a terminal and run the following commands:
Activating the Virtual Environment
Once the virtual environment is created, activate it:
To deactivate the virtual environment, use:
Make sure to perform all model setup steps within this virtual environment.
Installing the Ollama Platform
DeepSeek-R1 can be run using the Ollama platform, which supports GGUF-format model files. If you choose a safetensors format model, you’ll need to convert it to GGUF using llama.cpp.
Checking System Compatibility
Before proceeding, confirm that your Raspberry Pi’s system is 64-bit by running the command of uname -m
Installing Ollama
First, update your system:
Then, install curl (required for downloading Ollama):
Now, download and install the Ollama platform:
Verifying the Installation
Check if Ollama was installed successfully:
Now that Ollama is ready, let’s proceed with downloading a DeepSeek-R1 model.
Running DeepSeek-R1 on Ollama





There are two ways to get the DeepSeek-R1 model:
- Download and run it directly from Ollama.
- Download a model from HuggingFace, then import it into Ollama.
Regardless of the method, Ollama is required.
Method 1: Download and Run Directly from Ollama
Ollama offers pre-configured models, making it the easiest way to start.
Search for DeepSeek-R1 on the Ollama website and find an appropriate model size.
To run a 1.5B model:
Ask the model a question, like "Explain quantum entanglement in simple terms." It will respond immediately while also displaying its thought process.
Method 2: Download a Model from HuggingFace
Downloading from HuggingFace allows you to select a specific model size. This is helpful because the Raspberry Pi 5 (even with 16GB RAM) cannot handle larger models efficiently.
Choosing a Model from HuggingFace
- Visit HuggingFace and search for DeepSeek-R1.
- Select a smaller distilled version suitable for the Raspberry Pi 5.
- For this guide, we’ll use DeepSeek-R1-Distill-Llama-8B-GGUF, which has 8 billion parameters and is optimized for performance.
- Download the Q8_0 model file (~8.54GB), as it balances quality and efficiency.
Transferring Model Files to Raspberry Pi
After downloading the three files, transfer them to your Raspberry Pi using FileZilla or another file transfer tool
Importing the GGUF Model Into Ollama



Once the model files are on the Raspberry Pi, we need to import them into Ollama.
Creating a Modelfile
First, create a Modelfile in the model folder and grant it full permissions:
Adding Model Configuration
Open the Modelfile and add:
Now, create the model in Ollama:
Verify that the model is available:
Now, start the model:
Ask it a question and observe its response.
Comparison of Model Options

We have tested two versions of DeepSeek-R1:
- DeepSeek-R1-1.5B (downloaded directly from Ollama).
- DeepSeek-R1-Distill-Llama-8B (downloaded from HuggingFace).
If you prioritize faster responses, use DeepSeek-R1-1.5B. If you want higher-quality answers, use DeepSeek-R1-Distill-Llama-8B, but be mindful of RAM limitations.
Conclusion
By following this guide, you can successfully run DeepSeek-R1 on a Raspberry Pi 5 using the Ollama platform. If you want an easy setup, downloading directly from Ollama is best. However, if you need a specific model size, HuggingFace provides more flexibility.
Now, experiment with your model and see what it can do!
In this tutorial, we use the new CrowPi 2 with Raspberry Pi 5. CrowPi 2 is a portable Raspberry Pi-powered laptop with an IPS screen, a 2MP camera, a microphone, and built-in stereo speakers. It features a detachable magnetic keyboard and a compartment for a power bank or extra components, making it ideal for learning and working on the go.