DEV Community

Cover image for DeepSeek's AI Coding Assistant: Install DeepSeek-R1-32B-Cline Locally with Ollama and VSCode
Aditi Bindal for NodeShift

Posted on

DeepSeek's AI Coding Assistant: Install DeepSeek-R1-32B-Cline Locally with Ollama and VSCode

By now, you must have seen and heard a lot about DeepSeek-R1's powerful reasoning and logical capabilities. However, if you're looking to leverage its capabilities in your code, DeepSeek-R1-32B-Cline is here for you. It is an advanced AI model for coding assistance powered by DeepSeek-R1 to elevate your development experience by offering intelligent code suggestions, error detection, productivity enhancements, and much more. It delivers real-time coding support that aligns with modern development workflows. It is particularly suitable for developers who want to harness the power of AI locally, ensuring data privacy and reduced latency compared to third-party coding assistants.

hero-image
(Source: SitePoint)

In this guide, we’ll walk you through the steps to install DeepSeek-R1-32B-Cline locally using Ollama and seamlessly integrate it with VSCode using the Cline extension (previously Claude Dev).

Prerequisites

The minimum system requirements for this use case are:

  • GPUs: RTX 4090 or RTX A6000 (for smooth execution).

  • Disk Space: 300 GB

  • RAM: At least 48 GB.

  • Nvidia Cuda installed

Note: The prerequisites for this are highly variable across use cases. A high-end configuration could be used for a large-scale deployment.

Step-by-step process to set up DeepSeek-R1-32B-Cline locally

For the purpose of this tutorial, we’ll use a GPU-powered Virtual Machine by NodeShift since it provides high compute Virtual Machines at a very affordable cost on a scale that meets GDPR, SOC2, and ISO27001 requirements. Also, it offers an intuitive and user-friendly interface, making it easier for beginners to get started with Cloud deployments. However, feel free to use any cloud provider of your choice and follow the same steps for the rest of the tutorial.

Step 1: Setting up a NodeShift Account

Visit app.nodeshift.com and create an account by filling in basic details, or continue signing up with your Google/GitHub account.

If you already have an account, login straight to your dashboard.

Image-step1-1

Step 2: Create a GPU Node

After accessing your account, you should see a dashboard (see image), now:

1) Navigate to the menu on the left side.

2) Click on the GPU Nodes option.

Image-step2-1

3) Click on Start to start creating your very first GPU node.

Image-step2-2

These GPU nodes are GPU-powered virtual machines by NodeShift. These nodes are highly customizable and let you control different environmental configurations for GPUs ranging from H100s to A100s, CPUs, RAM, and storage, according to your needs.

Step 3: Selecting configuration for GPU (model, region, storage)

1) For this tutorial, we’ll be using the RTX 4090 GPU; however, you can choose any GPU of your choice based on your needs.

2) Similarly, we’ll opt for 500GB storage by sliding the bar. You can also select the region where you want your GPU to reside from the available ones.

Image-step3-1

Step 4: Choose GPU Configuration and Authentication method

1) After selecting your required configuration options, you'll see the available VMs in your region and according to (or very close to) your configuration. In our case, we'll choose a 1x RTX 4090 GPU node with 12 vCPUs/96GB RAM/500 GB SSD.

Image-step4-1

2) Next, you'll need to select an authentication method. Two methods are available: Password and SSH Key. We recommend using SSH keys, as they are a more secure option. To create one, head over to our official documentation.

Image-step4-2

Step 5: Choose an Image

The final step would be to choose an image for the VM, which in our case is Nvidia Cuda, on which we’ll deploy and run the inference of our model.

Image-step5-1

That's it! You are now ready to deploy the node. Finalize the configuration summary, and if it looks good, click Create to deploy the node.

Image-step5-2

Image-step5-3

Step 6: Connect to active Compute Node using SSH

1) As soon as you create the node, it will be deployed in a few seconds or a minute. Once deployed, you will see a status Running in green, meaning that our Compute node is ready to use!

2) Once your GPU shows this status, navigate to the three dots on the right and click on Connect with SSH. This will open a pop-up box with Host details. Copy and paste that in your local terminal to connect to the remote server via SSH.

Image-step6-1

Next, If you want to check the GPU details, run the following command in the terminal:

!nvidia-smi
Enter fullscreen mode Exit fullscreen mode

Step 7: Install Ollama

1) Update the Ubuntu package source-list for the latest versions of repositories.

apt update
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step7-1

2) Install Dependencies for Ollama.

apt install pciutils lshw
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step7-2

3) Install Ollama

curl -fsSL https://ollama.com/install.sh | sh
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step7-3

4) Start Ollama server.

ollama serve
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step7-4

5) Open a new terminal, connect to the remote server using SSH, and check if you're able to sync with the Ollama server.

ollama --version
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step7-5

If it successfully shows the version, it means Ollama is installed correctly and is up and running.

Step 8: Install DeepSeek-R1-32B-Cline

1) Install the model using the Ollama command.

ollama run nvjob/DeepSeek-R1-32B-Cline
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step8-1

Since we just want to download it and not run it on the terminal, type /bye to exit the model console.

2) Confirm the model in the Ollama models list.

ollama list
Enter fullscreen mode Exit fullscreen mode

Output:

Image-step8-2

Step 9: Set up Cline on VSCode

To integrate the DeepSeek-R1-32B-Cline model with the Cline extension, you'll need to install the Cline extension on Visual Studio Code.

1) For this, you'll first need to connect your local VS Code editor to your Ubuntu server via SSH with the following steps:

a) Install the “Remote-SSH” Extension by Microsoft on VS Code.
b) Type “Remote-SSH: Connect to Host” on the Command Palette.
c) Enter the host details, such as username and SSH password, and you should be connected.

2) Next, install the Cline extension, as shown below.

Image-step9-2

3) Once the extension is installed, you'll see the Cline icon on the left sidebar.

4) Click on the icon to Configure the model settings.

5) Select Ollama as the API Provider and nvjob/DeepSeek-R1-32B-Cline in the Model ID.

Image-step9-3

6) Once everything is done, click on Let's go! then Done to save the configuration.

Step 10: Use the Coding Assistant in your code

Now, to demonstrate how you can use this AI coding assistant with your code, we have created a sample code file named test_app.py with the following example code.

Image-step10-1

Image-step10-2

1) Next, with the code file opened, click on the Cline icon and Start a new task.

2) Type the task you want the assistant to perform. For e.g.:

"Describe the code in @/test_app.py in detail."

Here's the response generated by the Coding assistant for the prompt above:

Image-step10-3

Image-step10-4

Image-step10-5

Image-step10-6

As you may observe, the assistant has nicely described the code in the file, detailing each import and function and the tasks they perform. Similarly, you can ask the assistant to help with various other tasks, from finding bugs to fixing them and much more!

Conclusion

In this guide, we've covered how to install and configure DeepSeek-R1-32B-Cline locally using Ollama and integrate it with VSCode for a seamless AI-powered coding experience. This setup not only boosts development efficiency but also ensures data privacy by keeping operations local. We deployed our model through NodeShift's cloud dashboard, which complements this model by providing scalable infrastructure and optimized deployment capabilities, making it easier for developers to manage their AI-driven development environments.

For more information about NodeShift:

Top comments (0)