How To Run DeepSeek Locally With Easy Steps

Everyone is talking about Deepeek, it is doing this and that. But as a developer if you are not running this model in local and creating amazing project then what is the use of these LLM model. So in this article we are going to install deepseek model in local window machine and try to give some tricky questions to check is Deepseek working properly.

There are different ways to install deepseek in locally but we will go with very basic and easy approach. We will be using Ollama. Ollama simplifies the process of running models by handling dependencies and providing an easy-to-use interface. Below is a step-by-step guide to run DeepSeek using Ollama on a Windows machine.


Step 1: Install Ollama

  • Download Ollama:
  1. Go to the Ollama Official Website or the official website.
  2. Download the latest release for Windows.


  • Install Ollama:
  1. Run the installer and follow the on-screen instructions.
  2. Ensure Ollama is added to your system PATH.


  • Verify Installation:
  1. Open Command Prompt and run:
    • ollama --version
  2. This should display the installed Ollama version.


Step 2: Pull the DeepSeek Model

  1. Pull the Model:
  • If DeepSeek is available, pull it using:
    • ollama pull deepseek
  • There are different variation of the deepseek mode based on the parameter. so you can choose the model that you want. By default, this above command downloads the main DeepSeek R1 model (which is large). If you’re interested in a specific distilled variant (e.g., 1.5B, 7B, 14B), just specify its tag, like:
    • ollama pull deepseek-r1:1.5b

Step 3: Run the DeepSeek Model

  1. Start the Model:
  • Run the DeepSeek model using:
    • ollama run deepseek
  • This will start an interactive session with the model.
  1. Interact with the Model:
  • You can now type prompts and receive responses from the DeepSeek model.
  • Example:
    >>> What is the capital of India?

Step 4: Use Ollama API (Optional)

If you want to integrate DeepSeek into your applications, you can use the Ollama API.

  1. Start the Ollama Server:
  • Run the following command to start the Ollama server:
    • ollama serve
  1. Send API Requests:
  • Use tools like curl or Python’s requests library to interact with the API.
  • Example using curl:
    • curl http://localhost:11434/api/generate -d '{ "model": "deepseek", "prompt": "What is the capital of France?" }'
  1. Example Python Script:
   import requests

   url = "http://localhost:11434/api/generate"
   data = {
       "model": "deepseek",
       "prompt": "What is the capital of France?"
   }

   response = requests.post(url, json=data)
   print(response.json())

Step 5: Stop the Ollama Server

  1. Stop the Server:
  • If you started the Ollama server, you can stop it by pressing Ctrl + C in the terminal.

Practical usage tips

Command-line automation

Wrap your Ollama commands in shell scripts to automate repetitive tasks. For instance, you could create a script like:

#!/usr/bin/env bash
PROMPT="$*"
ollama run deepseek-r1:7b "$PROMPT"

Now you can fire off requests quickly:

./ask-deepseek.sh "Explain how to write a regex for email validation"

By following these steps, you should be able to run the DeepSeek model locally using Ollama on your Windows machine. Let me know if you need any other help.


FAQ

Q: Which version of DeepSeek R1 should I choose?

A: If you have a powerful GPU or CPU and need top-tier performance, use the main DeepSeek R1 model. If you’re on limited hardware or prefer faster generation, pick a distilled variant (e.g., 1.5B, 14B).

Q: Can I run DeepSeek R1 in a Docker container or on a remote server?

A: Yes. As long as Ollama can be installed, you can run DeepSeek R1 in Docker, on cloud VMs, or on-prem servers.

Q: Is it possible to fine-tune DeepSeek R1 further?

A: Yes. Both the main and distilled models are licensed to allow modifications or derivative works. Be sure to check the license specifics for Qwen- and Llama-based variants.

Q: Do these models support commercial use?

A: Yes. DeepSeek R1 series models are MIT-licensed, and the Qwen-distilled variants are under Apache 2.0 from their original base. For Llama-based variants, check the Llama license details. All are relatively permissive, but read the exact wording to confirm your planned use.

Leave a Reply

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