CLOSE
megamenu-tech
CLOSE
service-image
CLOSE
Blogs
Exploring DeepSeek: A Comprehensive Installation Guide for the R1 Model via Ollama

Exploring DeepSeek: A Comprehensive Installation Guide for the R1 Model via Ollama

Exploring DeepSeek: A Comprehensive Installation Guide for the R1 Model via Ollama

#DeepSeek

#AI model

#LLMs

Technology, Published On : 04 February 2025
DeepSeek

In a remarkable turn of events, China has responded to U.S. semiconductor restrictions not just by developing its own AI model, but by doing so at a fraction of the typical cost. While open AI invests billions in AI development, Chinese company DeepSeek created their model for an estimated $5 million - and then took the unprecedented step of making it open source. DeepSeek's breakthrough could reshape how we think about AI development and accessibility.

What is DeepSeek?

Deepseek is a China based startup that creates open weight LLMs. As a primary step, their first R1-Zero model was trained on large-scale reinforcement learning (RL) without supervised fine-tuning (SFT) The model showed remarkable reasoning ability but encountered numerous challenges such as language mixing and poor readability.  To address this problem, the model was further trained on multi-stage training and cold-start data before reinforcement learning. This enhanced approach led to the development of DeepSeek-R1, which achieved a significant milestone by matching the reasoning capabilities of OpenAI's models.

The models they’ve developed so far are;

  • DeepSeek R1/R1-Zero (271B)
  • DeepSeek V3 (271B Mixture of Models)
  • DeepSeekMath
  • DeepSeek-Coder
  • DeepSeek-MoE
Deep seek 1

Source: https://arxiv.org/pdf/2501.12948

Running DeepSeek-R1 Locally: A Step-by-Step Guide

If you want to run R1 with 617B parameters in your local machine, then behold the hardware requirements:

You need some enterprise grade hardware with 16x NVIDIA H100/A100 (80GB VRAM each) with 8-bit quantization. 512GB–1TB system memory.

However, in a viral video the R1 model is running locally with the help of 7 M4 pro Mac minis and 1 M4 MacBook pro with the combined memory of 496GB. 

While mortgaging your house for enterprise hardware is one way to go, let's explore a more wallet-friendly approach: running a 1.5B parameter model locally via Ollama.

Installation Steps

  1. Install Ollama

First, we need to install Ollama, which will manage our DeepSeek-R1 model:

  • Visit ollama.com/download
  • Download and install the version for your operating system
  • Open your terminal/command line interface
  • Verify installation by running:

ollama --version

  1. Install DeepSeek-R1 Model

Now let's get the DeepSeek-R1 model running:

  • Visit ollama.com/library/deepseek-r1
  • Choose your preferred model size. 
  • Run the installation command:

ollama pull deepseek-r1:1.5b

deep seek 2

  1. Using DeepSeek-R1

Once installation is complete, you can start using the model. Here are some example commands:

Basic Usage

ollama run deepseek-r1:1.5b "What is quantum computing?"

Advanced Parameters

You can customize the model's behaviour using various parameters:

ollama run deepseek-r1:1.5b temperature 0.7 top-p 0.9 "Explain the theory of relativity"

Common parameters:

temperature: Controls randomness (0.0 to 1.0)

top-p: Controls diversity of responses (0.0 to 1.0)

top-k: Limits vocabulary choices (1 to 100)

Interactive Mode

For a chat-like experience:

deep seek 3

ollama run deepseek-r1:1.5b

This opens an interactive session where you can type messages and receive responses.

To query the file:

ollama run deepseek-r1 "$(echo -e 'Answer questions based on this text:\n'; cat your_file.txt; echo '\n\nQuestion: YOUR_QUERY_HERE')"

Example: 

ollama run deepseek-r1 "$(echo -e 'Answer questions based on this text:\n'; cat sample1.txt; echo '\n\nQuestion: What is the file about?')"

Note: The above approach is optimal for small files. (<4k tokens)

For Optimal Performance

  • Monitor your system resources while running the model
  • Close unnecessary applications to free up RAM
  • Start with shorter prompts to test performance
  • Adjust parameters gradually to find your optimal settings

To sum it up, DeepSeek is a standout tool for finding highly specific and hard-to-find information, especially with its advanced search features and ability to dig into the deep web. Its strengths—like pinpoint precision, pulling from multiple sources at once, and accessing exclusive content—make it a game-changer for professionals in research-heavy fields. Additionally, DeepSeek’s open-source models highlight the growing need for hardware innovation, emphasizing accessibility and affordability for developers. These models also point to the urgent demand for AI-powered computers capable of handling hardware-intensive tasks. That said, there are some challenges to keep in mind, such as its complexity, potential legal issues, the risk of information overload, and the cost of access. For those who can manage its features and navigate these hurdles, DeepSeek offers tremendous value, especially when precision and rare data are essential.

Pooja

Pooja HP

Junior Software Engineer

A Junior software engineer with a keen interest in AI and technical writing. Passionate about exploring the world of data and AI through problem-solving lens.

Modal_img.max-3000x1500

Discover Next-Generation AI Solutions for Your Business!

Let's collaborate to turn your business challenges into AI-powered success stories.

Get Started