Back to articles
AI & Cloud

Complete Guide to Creating a Local DeepSeek R1 Agent for Automatic Code Fixing in IDEs with ContinueDev and Ollama

A detailed guide on setting up and using a local DeepSeek R1 agent to automatically fix code in IDEs with ContinueDev and Ollama. The guide covers installation, configuration,...

DPTCloud Engineering4 min read
Complete Guide to Creating a Local DeepSeek R1 Agent for Automatic Code Fixing in IDEs with ContinueDev and Ollama

Introduction

DeepSeek R1 is a powerful large language model (LLM) designed to assist with programming tasks such as automatic code fixing, code generation, and error analysis. With tools like ContinueDev and Ollama, users can deploy DeepSeek R1 locally and integrate it directly into their development environment (IDE), enabling automatic code fixes and improving productivity. This guide walks you through setting up and using a local DeepSeek R1 agent with ContinueDev and Ollama.

Prerequisites

  • Personal computer or VPS with at least 16GB RAM (recommended 32GB or more).
  • Operating system: Ubuntu 22.04 or equivalent.
  • Docker and Docker Compose installed.
  • Ollama and ContinueDev installed.
  • Stable internet connection to download the DeepSeek R1 model.

Setting Up the Local DeepSeek R1 Agent with Ollama and ContinueDev

Step 1: Install Ollama

Ensure Ollama is installed on your system. If not, run the following command:

curl -fsSL https://ollama.com/install.sh | sh

Step 2: Download the DeepSeek R1 Model

Run the following command to download the DeepSeek R1 model into Ollama:

ollama pull deepseek-r1

Step 3: Configure ContinueDev

Launch ContinueDev within your IDE (Visual Studio Code, JetBrains, etc.). In the settings, select Ollama as the LLM source and configure the API URL to http://localhost:11434.

Step 4: Set Up the DeepSeek R1 Agent

In ContinueDev, create a new agent and select the deepseek-r1 model. Configure the agent to perform tasks such as fixing errors, writing new functions, or optimizing code.

Testing and Usage

After setup, you can test the agent by:

  1. Opening a source code file in your IDE.
  2. Selecting a code segment with errors or needing improvement.
  3. Issuing commands to the agent such as "Fix this error" or "Optimize this function".
  4. The agent will analyze and return the corrected code.

Troubleshooting

  • Model not downloading: Check your internet connection and ensure Ollama is running. Run ollama list to verify the model is downloaded.
  • Agent not responding: Verify the connection between ContinueDev and Ollama. Ensure port 11434 is not blocked.
  • Low performance: The DeepSeek R1 model requires significant resources. If your system is slow, reduce load or upgrade RAM.

References

DPTCloud Tier III Infrastructure

High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02Recommended

VPS-4E

297.000 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe
ECO · vn-02

VPS-5E

614.900 ₫ / mo

10% VAT included

  • CPU: 8 vCPU
  • RAM: 16 GB
  • SSD: 100 GB NVMe
ADVANCED · vn-03Recommended

VPS-4T

548.900 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478