What it is and how to install and run locally the LLM AI: deepseek-r1

DeepSeek-R1DeepSeek-R1

DeepSeek-R1 is a state-of-the-art large language model (LLM) developed by DeepSeek, officially released on January 21, 2025. This model is designed to enhance reasoning capabilities through a unique training methodology that emphasizes reinforcement learning (RL) over traditional supervised fine-tuning (SFT).

Key features of DeepSeek-R1 include:

  • Mixture-of-Experts Architecture: The model comprises 671 billion parameters, with 16 expert networks, activating 37 billion parameters per token. This architecture allows for efficient processing and improved performance across various tasks.
  • Reinforcement Learning Training: DeepSeek-R1 is trained entirely via RL, starting with cold-start fine-tuning on curated Chain-of-Thought (CoT) data, followed by RL phases to enhance reasoning depth. This approach enables the model to develop advanced reasoning patterns and align with human preferences.
  • Extensive Pretraining Data: The model was pretrained on approximately 4.8 trillion tokens across 52 languages and technical domains, including STEM papers and GitHub repositories, ensuring robust performance in technical and multilingual tasks.
  • Distillation Techniques: To make the model more accessible, DeepSeek-R1 has been distilled into smaller variants ranging from 1.5B to 70B parameters. These distilled models transfer the reasoning capabilities of the larger model into more deployable architectures, such as Qwen and Llama.

DeepSeek-R1 has demonstrated exceptional performance across various benchmarks:

  • Mathematical Reasoning: Achieved 79.8% to 86.7% pass@1 on the AIME 2024, 97.3% on MATH-500, and 90.45% on the MATH dataset. On GSM8K, accuracy is 96.13%, and in MMLU Formal Logic, it reaches 97.62%.
  • Medical and Clinical Decision Support: Scored 0.862 in Chinese and 0.808 in English complex ophthalmology multiple-choice questions, outperforming models like Gemini 2.0 Pro and OpenAI o1.
  • Sentiment Analysis: Delivered 91.29% accuracy on 5-class Amazon Reviews via the 671B model distilled 32B Qwen2.5-based variant achieves 80.45% under 50-shot settings.
  • Relational and Graph Reasoning: Demonstrated superior F1 scores across structured family tree and graph reasoning benchmarks up to moderate problem sizes F1-score for HasSister(x) at n=10 reaches 0.803.

When compared to other leading LLMs, DeepSeek-R1 exhibits competitive or superior performance across various tasks. The following table provides a comparison of DeepSeek-R1 with other prominent models:

Model AIME 2024 (pass@1) MATH-500 (pass@1) GPQA Diamond (pass@1) LiveCodeBench (pass@1) CodeForces Rating
GPT-4o-0513 9.3% 74.6% 49.9% 32.9% 759
Claude-3.5-Sonnet-1022 16.0% 78.3% 65.0% 38.9% 717
o1-mini 63.6% 90.0% 60.0% 53.8% 1820
QwQ-32B-Preview 44.0% 90.6% 54.5% 41.9% 1316
DeepSeek-R1-Distill-Qwen-1.5B 28.9% 83.9% 33.8% 16.9% 954
DeepSeek-R1-Distill-Qwen-7B 55.5% 92.8% 49.1% 37.6% 1189

These benchmarks highlight DeepSeek-R1s strong performance in mathematical reasoning and coding tasks, positioning it as a leading model in the LLM landscape.

Usage License

DeepSeek-R1 is released under the MIT License, a permissive open-source license that allows for free use, modification, and distribution, including commercial applications. This means that individuals and organizations can integrate DeepSeek-R1 into their projects without significant restrictions, fostering innovation and collaboration within the AI community. The full text of the MIT License applied to the DeepSeek-R1 repository is available in the LICENSE file of the repository. For more details, please refer to the official DeepSeek-R1 GitHub repository.

Advantages and Disadvantages of Running DeepSeek-R1 Locally

Advantages

  • Privacy: Running DeepSeek-R1 on local hardware ensures that sensitive data remains within your infrastructure, reducing the risk of data breaches associated with cloud-based solutions.
  • Offline Operation: Local deployment allows for uninterrupted use of DeepSeek-R1 without the need for an internet connection, ensuring availability in environments with limited or no connectivity.
  • Portability: Deploying DeepSeek-R1 on a laptop enables mobility, allowing users to utilize the model in various settings, including those without power sources, by relying on battery power.
  • Customization: Local deployment provides the flexibility to fine-tune the model to specific tasks or datasets, enhancing performance for particular applications.
  • Reduced Latency: Processing data locally can lead to faster response times compared to cloud-based solutions, as it eliminates the need for data transmission over the internet.

Disadvantages

  • Resource Intensity: DeepSeek-R1 is a large model that requires substantial computational resources, which may strain lower-end systems and necessitate investment in high-performance hardware.
  • Maintenance Overhead: Managing and updating the model locally requires technical expertise and ongoing maintenance to ensure optimal performance and security.
  • Security Risks: Running AI models locally introduces unique security challenges, such as potential vulnerabilities that could be exploited if not properly managed. Implementing robust security measures is essential to mitigate these risks.

For a comprehensive understanding of the safety considerations when running DeepSeek-R1 locally, including key security risks and essential security measures, please refer to the article Running Deepseek R1 Locally: Safety Explained available at TechForMe.

OllamaRun deepseek-r1 with Ollama

Run the deepseek-r1 model locally with Ollama to work in private, offline and with low latency. Model page: deepseek-r1 on Ollama.

Windows Install Ollama on Windows and run deepseek-r1

  1. Install Ollama with Winget:
winget install Ollama.Ollama
  1. Open PowerShell or Terminal and run the model:
ollama run deepseek-r1

Compatible with Windows 10 and Windows 11. Ideal for professional desktops, content creation, and local workflows without internet.

macOSInstall Ollama on MacOS and run deepseek-r1

  1. Install Ollama with Homebrew (Intel or Apple Silicon):
brew install ollama
  1. Run the model:
ollama run deepseek-r1

On macOS Monterey, Ventura and Sonoma, deepseek-r1 performs very well on Apple Silicon (M1/M2/M3) for writing, development and study totally offline.

LinuxLinux: install Ollama and run deepseek-r1

Install the LLM deepseek-r1 on Ubuntu, Debian, Fedora, Kali Linux, openSUSE, Linux Mint, Pop!_OS, Arch and Manjaro with a single command:

curl -fsSL [https://ollama.com/install.sh](https://ollama.com/install.sh)  sh
  1. Run the model on your distro (Ubuntu/Debian/Fedora/Kali/openSUSE/Mint/Pop!_OS/Arch/Manjaro):
ollama run deepseek-r1

Perfect for Linux servers and laptops: automate workflows with scripts, draft content and test prompts without relying on the internet.

BSDBSD (FreeBSD, OpenBSD, NetBSD): run deepseek-r1 with Ollama in a container

The simplest way on BSD is to use a container (Docker/Podman) to isolate the environment:

docker run -d --name ollama -p 11434:11434 -v ollama:/root/.ollama ollama/ollama docker exec -it ollama ollama run deepseek-r1

Valid for FreeBSD, OpenBSD and NetBSD in labs and security environments with local AI.

How to remove the model in Ollama

ollama rm deepseek-r1

Delete the model files to free up disk space when you no longer need it.

Available models and tags

  • Model name: deepseek-r1
  • Tags (Model): deepseek-r1:latest deepseek-r1:1.5b deepseek-r1:7b deepseek-r1:8b deepseek-r1:14b deepseek-r1:32b deepseek-r1:70b deepseek-r1:671b

LM Run deepseek-r1 in LM Studio

LM Studio offers a graphical interface to download and run local models. Download the app according to your system from the official website: LM Studio (official download). Then search for deepseek-r1, download and click Run.

WindowsInstall LM Studio on Windows and run deepseek-r1

  1. Download LM Studio for Windows from lmstudio.ai and install it (compatible with Windows 10 and Windows 11).
  2. In Models, search for deepseek-r1 and click Download.
  3. Start the model with Run to chat locally without connection.

LM Studio on Windows simplifies model management and private sessions for productivity tasks, technical blogging, and prompt testing.

macOSInstall LM Studio on MacOS to run deepseek-r1

  1. Download LM Studio for macOS from lmstudio.ai (Intel or Apple Silicon).
  2. Open the app, search for deepseek-r1, download and click Run.

Smooth experience on Monterey, Ventura and Sonoma, with outstanding performance on Apple Silicon chips for creative and technical work without internet.

LinuxInstall LM Studio on Linux and run deepseek-r1

  1. Download LM Studio (AppImage/package) from lmstudio.ai and follow the instructions for your distro.
  2. Open the app, search for deepseek-r1, download and click Run.

Works on Ubuntu, Debian, Fedora, Kali Linux, openSUSE, Linux Mint, Pop!_OS, Arch and Manjaro, enabling local and private AI sessions for desktops and workstations.

Install LM Studio on BSD and its variants to run deepseek-r1

Run LM Studio via compatibility or a container. Once inside the app, search for deepseek-r1, download and click Run to start the local session.

In FreeBSD, OpenBSD and NetBSD, it is a practical approach for labs and audits where local AI is a requirement.

How to delete the model in LM Studio

  1. Go to Models > Installed.
  2. Find deepseek-r1 and click Delete to remove the downloaded files.

Hardware Required to Run the LLM DeepSeek-R1

Model Version Parameter Size Required Memory Optimal Memory GPU Requirements Alternative CPU RAM Setup
deepseek-r1:1.5b 1.5 Billion 8 GB RAM 16 GB RAM Optional Modern CPU with 8 GB RAM
deepseek-r1:7b 7 Billion 16 GB RAM 32 GB RAM GPU with 6 GB VRAM (e.g., NVIDIA GTX 1060) Modern CPU with 16 GB RAM
deepseek-r1:8b 8 Billion 16 GB RAM 32 GB RAM GPU with 6 GB VRAM (e.g., NVIDIA GTX 1060) Modern CPU with 16 GB RAM
deepseek-r1:14b 14 Billion 32 GB RAM 64 GB RAM GPU with 16 GB VRAM (e.g., NVIDIA RTX 2060) Modern CPU with 32 GB RAM
deepseek-r1:32b 32 Billion 32 GB RAM 64 GB RAM GPU with 24 GB VRAM (e.g., NVIDIA RTX 3090) Not recommended due to performance constraints
deepseek-r1:70b 70 Billion 64 GB RAM 128 GB RAM GPU with 48 GB VRAM (e.g., NVIDIA RTX 4090) Not recommended due to performance constraints
deepseek-r1:671b 671 Billion 128 GB RAM 256 GB RAM Multiple GPUs with 480 GB total VRAM (e.g., 6x NVIDIA H100) Not feasible due to hardware limitations

Understanding Quantization in LLMs

Quantization is a technique used to reduce the memory and computational requirements of large language models (LLMs) by converting their weights and activations from high-precision formats (like FP32) to lower-precision formats such as int8, int4, or even int2. This process decreases the models size and speeds up inference, making it feasible to deploy LLMs on hardware with limited resources.

How Quantization Works

Quantization involves mapping continuous real-valued model weights and activations into a finite set of discrete values. This can be achieved through various methods:

  • Post-Training Quantization (PTQ): Applying quantization after the model has been trained, without further training.
  • Quantization-Aware Training (QAT): Incorporating quantization into the training process, allowing the model to adapt to lower precision during training.
  • Dynamic Quantization: Applying quantization at runtime, adjusting precision based on the input data.

By reducing the number of bits used to represent each parameter, quantization significantly decreases the models memory footprint and computational load, enabling faster inference and deployment on less powerful hardware.

Quantizations Impact on DeepSeek-R1

For DeepSeek-R1 models, quantization can be particularly beneficial. For instance, quantizing a 7B model from FP32 to int8 can reduce memory usage from approximately 28 GB to 14 GB, allowing it to run on GPUs with less VRAM or even on CPUs with sufficient RAM. However, its important to note that while quantization reduces resource requirements, it may introduce a slight decrease in model accuracy. The extent of this impact depends on the quantization method used and the specific model architecture.

Optimal Setup for Running DeepSeek-R1 Models Locally

To run DeepSeek-R1 models locally, the following setups are recommended:

  • deepseek-r1:1.5b: Modern CPU with 8 GB RAM GPU optional.
  • deepseek-r1:7b and 8b: Modern CPU with 16 GB RAM GPU with at least 6 GB VRAM (e.g., NVIDIA GTX 1060) recommended for better performance.
  • deepseek-r1:14b: Modern CPU with 32 GB RAM GPU with at least 16 GB VRAM (e.g., NVIDIA RTX 2060) essential.
  • deepseek-r1:32b: High-end CPU with 32 GB RAM GPU with at least 24 GB VRAM (e.g., NVIDIA RTX 3090) essential.
  • deepseek-r1:70b: High-end CPU with 64 GB RAM GPU with at least 48 GB VRAM (e.g., NVIDIA RTX 4090) essential.
  • deepseek-r1:671b: Server-grade hardware with multiple GPUs totaling 480 GB VRAM (e.g., 6x NVIDIA H100) not feasible for typical local setups.

Minimum Cost-Effective Setup

For users seeking a budget-friendly setup to run DeepSeek-R1 models, the following configuration is recommended:

  • Model: deepseek-r1:1.5b
  • CPU: Modern multi-core processor (e.g., AMD Ryzen 5 or Intel Core i5)
  • RAM: 8 GB
  • GPU: Optional if available, a GPU with at least 4 GB VRAM can improve performance.

This setup allows for running the 1.5B parameter model effectively without significant investment in hardware.

Potential Applications of DeepSeek-R1

DeepSeek-R1 models can be utilized in various applications, including:

  • Natural Language Understanding: Enhancing chatbots and virtual assistants with improved comprehension and response generation.
  • Content Generation: Producing high-quality text for articles, blogs, and creative writing.
  • Code Generation: Assisting in software development by generating code snippets or entire functions based on natural language descriptions.
  • Language Translation: Providing accurate translations between multiple languages.
  • Sentiment Analysis: Analyzing customer feedback and social media posts to gauge public sentiment.

By selecting the appropriate model size and hardware setup, users can leverage DeepSeek-R1 to meet their specific needs effectively.

Like

Be the first to leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *