Harness the power of AI for your coding projects while maintaining complete privacy by running DeepSeek locally in VSCode. This comprehensive guide walks you through the installation, configuration, and usage of DeepSeek with CodeGPT, empowering you with AI-driven code assistance without relying on cloud-based services.
To get started, you'll need to install two key components: Ollama and CodeGPT.
Ollama simplifies running large language models (LLMs) locally.
Download Ollama: Visit ollama.com and download the installer for your operating system (Windows, macOS, or Linux).
Verify the Installation: After installation, open a terminal and run:
ollama --version
If Ollama is installed correctly, it will display the installed version.
CodeGPT is a VSCode extension that integrates local LLMs for coding assistance.
Ctrl + Shift + X
(or Cmd + Shift + X
on macOS).With both Ollama and CodeGPT installed, you're ready to download and configure DeepSeek.
Now, let's download and set up the DeepSeek models for chat and autocompletion.
deepseek-r1:1.5b
This model is optimized for smaller environments and runs smoothly on most computers.
deepseek-r1:1.5b
.Once installed, you can query the model about your code by highlighting it and using commands like:
/fix
: Fix errors or suggest improvements./refactor
: Clean up and improve code structure./Explain
: Get detailed explanations of code.You can also add extra files to your queries using the #
symbol.
deepseek-coder:1.3b
This model utilizes Fill-In-The-Middle (FIM) technology for intelligent autocompletion suggestions. It predicts and suggests the middle part of a function or method, not just the beginning or the end.
Open a Terminal in VSCode:
Pull the Model: Run the following command:
ollama pull deepseek-coder:1.3b
This downloads the autocompletion model to your machine.
Select in CodeGPT: Navigate to the Autocompletion Models section in CodeGPT and select deepseek-coder:1.3b
.
Now, as you type, the model will provide real-time code suggestions, helping you complete functions, methods, and entire code blocks with ease.
With both models set up, you can now enjoy the benefits of AI-powered coding without relying on external APIs. Everything runs locally, ensuring privacy and control over your coding environment.
By following these steps, you've successfully set up DeepSeek locally in VSCode, providing you with a powerful and private AI copilot to enhance your software development workflow. Explore the various commands and features to maximize your productivity and coding efficiency.
Consider exploring other VSCode extensions for developers to further enhance your coding experience.