Running advanced reasoning models locally is no longer reserved for massive enterprise infrastructure. By combining the DeepSeek R1 VS Code extension workflow through the Continue extension and Ollama, developers can harness state-of-the-art open-source reasoning capabilities right inside their editors for completely free and 100% offline.

Whether you are working on proprietary codebases with strict data privacy requirements or simply want to experiment with cutting-edge reasoning models without paying subscription fees, this comprehensive tutorial will walk you through the exact setup process from scratch.

Why Use DeepSeek R1 Locally in VS Code?

DeepSeek R1 has completely disrupted the artificial intelligence landscape by offering reasoning capabilities that rival proprietary models like OpenAI’s o1. However, sending your source code to third-party cloud APIs often presents security and privacy hurdles. By running DeepSeek R1 locally, you gain several distinct advantages:

  • Complete Privacy: Your code never leaves your local machine, making it ideal for enterprise environments and NDA-bound projects.
  • Zero Cost: No API fees, subscription models, or rate limits. Run inferences as much as you want.
  • Offline Capability: Code on a plane, a train, or during an internet outage without losing your AI assistant.
  • Deep Integration: Using Continue inside VS Code allows you to chat, highlight code, generate inline edits, and refactor seamlessly.

Prerequisites and System Requirements

Before diving into the installation, ensure your hardware is capable of running a quantized version of DeepSeek R1. Model sizes vary significantly, so choose the variant that matches your available VRAM or RAM:

Model Variant Parameters Recommended RAM / VRAM Best For
DeepSeek-R1-Distill-Qwen-1.5B 1.5 Billion 8 GB Laptops, entry-level hardware
DeepSeek-R1-Distill-Qwen-7B 7 Billion 16 GB Standard developer workstations
DeepSeek-R1-Distill-Qwen-14B 14 Billion 24 GB+ High-end GPUs (Mac Studio / RTX 4090)

Make sure you have administrative access to install software and sufficient disk space (ranging from 2GB to 10GB depending on the model size you choose).

Step 1: Install and Configure Ollama

Ollama is the premier tool for running large language models locally on macOS, Linux, and Windows. It handles model loading, memory management, and provides a clean local API endpoint that extensions like Continue can easily talk to.

  1. Navigate to the official Ollama website and download the installer for your operating system.
  2. Run the installer and ensure the Ollama daemon is running in your system tray or menu bar.
  3. Open your terminal or command prompt to verify the installation by running a basic command:

ollama –version

Once verified, you need to pull your preferred DeepSeek R1 distilled model. For most standard developer laptops with 16GB of RAM, the 7B parameter model strikes the best balance between speed and reasoning quality. Run the following command in your terminal:

ollama run deepseek-r1:7b

Ollama will automatically download the weight files. Once the download completes, you will see an interactive prompt. You can test a quick prompt or simply type /bye to exit the prompt, leaving the background server running on port 11434.

Step 2: Install the Continue Extension in VS Code

Continue is an open-source AI code assistant that connects to any LLM and allows you to build custom workflows directly inside your development environment.

  1. Open Visual Studio Code.
  2. Click on the Extensions icon in the Activity Bar on the left side of the window (or press Ctrl+Shift+X on Windows/Linux or Cmd+Shift+X on macOS).
  3. Search for Continue in the marketplace search bar.
  4. Click Install.

Once installed, you will notice a new Continue icon (a small glowing box) appear in your VS Code sidebar. Clicking it opens the chat interface.

Step 3: Connect DeepSeek R1 to Continue

By default, Continue may prompt you to log in or configure cloud providers. We want to point it directly to our local Ollama instance running DeepSeek R1.

  1. Click on the Continue icon in your sidebar to open the extension panel.
  2. Click the gear icon (Settings) in the bottom right corner of the Continue panel. This will open your config.json file located in your ~/.continue/ directory.
  3. Update the configuration file to include Ollama as your model provider and specify DeepSeek R1 as your chat model.

Your config.json file should look similar to this configuration snippet:

{
"models": [
{
"title": "DeepSeek R1 (7B)",
"provider": "ollama",
"model": "deepseek-r1:7b"
}
],
"tabAutocompleteModel": {
"title": "DeepSeek R1 (1.5B)",
"provider": "ollama",
"model": "deepseek-r1:1.5b"
}
}

Save the config.json file. Continue will automatically reload its configuration and establish a connection with your local Ollama instance.

Step 4: Using DeepSeek R1 for Daily Development Tasks

Now that your setup is complete, you can leverage DeepSeek R1’s powerful reasoning capabilities directly within your coding workflow.

  • Chatting with Code: Press Ctrl+I (or Cmd+I on Mac) to highlight a block of code, open the inline prompt box, and ask DeepSeek R1 to refactor, explain, or optimize it.
  • Debugging Errors: Copy traceback errors into the Continue sidebar chat panel and ask DeepSeek R1 to diagnose the root cause and provide a fixed implementation.
  • Writing Unit Tests: Highlight a complex function, open the chat, and prompt the model to generate comprehensive unit tests using your framework of choice (e.g., Jest, PyTest, JUnit).

Note that because DeepSeek R1 is a reasoning model, it will output its “thought process” inside <think> tags before providing the final answer. This transparency allows you to audit how the model arrived at a particular coding solution.

Troubleshooting Common Issues

If you run into trouble during setup, check the following common pitfalls:

  • Connection Refused: Ensure Ollama is actively running in your system tray. If you restarted your computer, you may need to relaunch the Ollama application.
  • High Latency / Slow Generation: If token generation is extremely slow, your hardware may be struggling with the model size. Try stepping down from the 7B model to the 1.5B distilled model in your config.json.
  • Out of Memory Errors: Close heavy applications like web browsers or Docker containers to free up RAM before launching larger model variants.

Conclusion

Setting up DeepSeek R1 in VS Code via Continue and Ollama gives you an enterprise-grade, privacy-first AI coding assistant without spending a dime. By keeping your codebase local and harnessing open-source reasoning weights, you can supercharge your development workflow securely and efficiently.

Frequently Asked Questions

Can I use DeepSeek R1 for inline tab autocomplete in VS Code?

Yes, you can configure a smaller model like deepseek-r1:1.5b as your tabAutocompleteModel in your Continue configuration file. However, keep in mind that reasoning models are primarily optimized for deep thinking and chat rather than ultra-fast sub-100ms inline autocompletions.

Do I need an internet connection to use DeepSeek R1 locally?

No. Once you have downloaded Ollama and pulled the DeepSeek R1 model weights onto your machine, everything runs entirely offline. You can disconnect from the internet and continue coding with full AI assistance.

How much RAM or VRAM do I need to run DeepSeek R1?

Requirements depend on the model size. The 1.5B distilled version requires roughly 8GB of system RAM, while the 7B version functions smoothly on 16GB RAM systems. For the larger 14B and 32B models, you will need a dedicated GPU with 24GB+ of VRAM or an Apple Silicon Mac with unified memory.

Is DeepSeek R1 free for commercial use?

Yes, DeepSeek models are released under permissive licenses that allow developers to use them for both personal and commercial projects, though you should always review the specific license terms on their official repository before deployment.

Related reading