Knowledge base

Local Deployment of deepseek on Linux

Introduction

In December of last year, DeepSeek’s DeepSeek-V3 caused a huge stir in the global AI field. With extremely low training costs, it achieved performance comparable to top-tier models like GPT-4 and Claude Sonnet 3.5, stunning the industry. Tencent Tech had conducted an in-depth analysis of this model, explaining its technical background for achieving low-cost and high-efficiency results using simple and straightforward language.

This time is different; the newly released DeepSeek-R1 not only maintains the low cost but also sees significant advancements in technology. Moreover, it is an open-source model. This new model continues to leverage its high cost-effectiveness, achieving GPT-4-level performance at just a tenth of the cost. Consequently, many professionals have even raised the slogan that "DeepSeek will replace OpenAI."

This tutorial includes:

  1. Installing ollama
  2. Downloading and using DeepSeek models in ollama
  3. Interacting with Chatbox for chat functionality

Code exmaple

Installing ollama

Require sudo

sudo curl -fsSL https://ollama.com/install.sh | sh
Downloading and using DeepSeek models in ollama
  1. Start ollama
    ollama start

    or start and put it in the background

    ollama start&
  2. Choose one version to download and run
    DeepSeek-R1-Distill-Qwen-1.5B
    Suggest 4-8GB graphics card memory or a multi-threaded CPU

    ollama run deepseek-r1:1.5b

    DeepSeek-R1-Distill-Qwen-7B
    Suggest 8GB graphics card memory

    ollama run deepseek-r1:7b

    DeepSeek-R1-Distill-Llama-8B
    Suggest 8GB graphics card memory

    ollama run deepseek-r1:8b

    DeepSeek-R1-Distill-Qwen-14B
    Suggest 14GB graphics card memory

    ollama run deepseek-r1:14b

    DeepSeek-R1-Distill-Qwen-32B
    Suggest 24GB graphics card memory

    ollama run deepseek-r1:32b

    DeepSeek-R1-Distill-Llama-70B
    Suggest 4x RTX 4090 or 2x A100 total 80GB

    ollama run deepseek-r1:70b

    DeepSeek-R1 model
    Suggest 8x A100/H100

    ollama run deepseek-r1:671b

    Path of model storage in linux: ~/.ollama/models/
    Start a Conversation

  3. Stop ollama
    pkill -f ollama
Interacting with Chatbox for chat functionality
  1. Download app from website
    https://chatboxai.app/zh#download
    choose linux 64bit version to download
    or copy link to download

    wget https://download.chatboxai.app/releases/Chatbox-1.9.8-x86_64.AppImage
  2. Give software running permissions. File with AppImage format could be run directly.
    chmod a+x Chatbox-1.9.8-x86_64.AppImage

    Run chatbox.
    Make sure that ollama is running before you run chatbox.(See step of "Start ollama")

    ./Chatbox-1.9.8-x86_64.AppImage --no-sandbox
  3. Click setting
    Edit API Host to http://localhost:11434/
    Select your model, edit your max message count, change temperature and save
  4. At last click New Chat to start a new communication

References

https://github.com/ollama/ollama
https://ollama.com/library/deepseek-r1

Leave a Reply

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