Self-Hosted DeepSeek R1 is an unofficial extension that brings AI-assisted code insights and explanations directly into your editor. It can be configured to use cloud-based DeepSeek (via API key) or run self-hosted (e.g., via Ollama on localhost).
-
Sidebar & Floating Chat
- Converse with DeepSeek in a collapsible sidebar or in a floating panel.
- Real-time streaming responses—messages appear word by word.
- Stop Generation button to abort streaming output mid-response.
- Reset Conversation button to clear the context.
-
Right-Click “Ask DeepSeek”
- Select code, right-click, and choose “Ask DeepSeek” to get an explanation or debug suggestions.
-
Code Block Actions
- Responses often include code blocks with automatic syntax highlighting.
- Copy button: Copies the code snippet to your clipboard.
- Insert button: Inserts the code snippet into your active document at the cursor.
-
Multi-Round Conversations
- When enabled, each response is remembered. You can build up context in a session.
-
Configurable for Cloud or Self-Hosted
- Provide a DeepSeek API Key (if using cloud).
- Set your local hosting URL (for self-hosted).
- Choose from popular local model families and sizes (Ollama), or specify a custom model tag via the
deepseek.modelSelectionsetting (see Configuration below)
- Clone or Download Extension: Download this repository to test or deploy locally. Maybe install it from the VSCode Marketplace (if/when published).
-
To quickly test the downloaded extension repository, locally:
- Open the folder in VSCode.
- Run
npm installto install dependencies. - Build the extension:
npm run compile. - Launch the extension by pressing
F5or via “Run Extension” in VSCode’s debug panel.
-
To deploy the extension for use locally, in any VSCode window:
- Install vsce:
npm install -g @vscode/vsce
- Navigate to the DeepSeek extension:
cd path/to/deepseek/extension-folder - Install the .vsix File Locally:
vsce package
- Install the .vsix File Locally: open command palette with Ctrl+Shift+P or Cmd+Shift+P on macOS. Type and select
Extensions: Install from VSIX.... Locate and select the DeepSeek .vsix file (e.g., deepseek-gp-vscode-0.1.0.vsix), output by the package command. - Verify the Extension Installation: Open the Extensions view, command Ctrl+Shift+X or Cmd+Shift+X on macOS. Find the DeepSeek extension in the list. It should now be installed and enabled. Enjoy!
- Install vsce:
- Run DeepSeek Locally on Ollama:
- For a full guide, view the
How to run DeepSeek Locally on Ollama.mdin the repo, otherwise:
-
Download and Install Ollama:
- Visit the Ollama website to download the installer for your operating system.
- Run the installer and follow the instructions to complete the installation.
-
Install a model:
-
You can use any supported chat/coding capable model. Popular choices include:
- DeepSeek Reasoning:
deepseek-r1(sizes: 1.5b, 7b, 14b, 32b, 70b) - Llama 3.1 Chat:
llama3.1(sizes: 8b, 70b) - Qwen 2.5 Coder:
qwen2.5-coder(sizes: 0.5b, 1.5b, 3b, 7b, 14b, 32b) - Qwen 2.5 Chat:
qwen2.5(sizes: 7b, 14b, 32b, 72b) - Mistral:
mistral(sizes: 7b, 12b) - Gemma 2:
gemma2(sizes: 2b, 9b, 27b)
- DeepSeek Reasoning:
-
Example installations:
ollama pull deepseek-r1:7b ollama pull llama3.1:8b ollama pull qwen2.5-coder:7b ollama pull mistral:7b ollama list
-
-
Run the Server:
- In the terminal, execute the following command to start your selected model server:
ollama run llama3.1:8b
- Default port is
11434, otherwise linux and mac users can choose your preferred port, see guide. - You will also need to start the Ollama interface server in a new terminal to interact with DeepSeek:
ollama serve
- For help run
ollama -h', or see trouble shooting section in theHow to run DeepSeek Locally on Ollama.md` guide.
- In the terminal, execute the following command to start your selected model server:
Use hotkey use CTRL + SHIFT + P and type DeepSeek: Config
Or to mouse click navigate to the extension settings in VSCode, go to:
File → Preferences → Settings → type
deepseek.
Or use hotkey CTRL + , to open config in VSCode and search deepseek..
Or if testing the repository, open your user/workspace settings.json and define:
| Setting | Type | Default | Description |
|---|---|---|---|
deepseek.accountType |
string |
self-hosted |
Either "cloud" or "self-hosted". |
deepseek.modelSelection |
string |
deepseek-r1:7b |
Select one curated local model tag (e.g., deepseek-r1:7b, llama3.1:8b, qwen2.5-coder:7b). |
deepseek.optionalCloudApiKey |
string |
"Only for cloud..." |
Your DeepSeek API key (if accountType is cloud). |
deepseek.aiR1SelfHostedUrl |
string |
"http://localhost:11434" |
Local server URL if hosting your own instance (Ollama or another method). |
deepseek.aiR1Model |
— | — | Removed. Use deepseek.modelSelection instead. |
deepseek.aiR1ModelTemperature |
number |
0.3 |
Ranges roughly 0.0 – 1.0, lower is more literal, higher is more creative. |
deepseek.MultiRoundConversationContext |
boolean |
true |
Toggles conversation context (can slow down responses for 'low resource systems'). |
-
Open Chat:
- On the Sidebar Menu click on the DeepSeek Icon, or find
DeepSeekin the "Additional Views" three-dots dropdown menu. - Or via Command Palette: Use hotkey CTRL + SHIFT + P and enter
Show Deepseek. - Or enter
DeepSeek: Floating Chatto open this optional panel (note that both panels share the same chat history).
- On the Sidebar Menu click on the DeepSeek Icon, or find
-
Ask a Question:
- Type your question in the chat text area, press Send. Watch it stream.
-
Ask DeepSeek About Code:
- In any editor, highlight a snippet and then right-click → Ask DeepSeek.
- DeepSeek will reference that code snippet in its response.
-
Stop Generation:
- If the response is streaming too long, click the Stop button.
- This aborts the in-progress request.
-
Reset Conversation:
- Clears previous chat history.
- Useful if you want a fresh context or to “forget” older Q&A data.
To bring up VSCode Command, use hotkeys CTRL + SHIFT + P and then type:
Show Deepseek
Shows the default DeepSeek sidebar.DeepSeek Floating Chat
Opens a floating chat window.Ask DeepSeek
Right-click or from the Command Palette, ask about selected code.DeepSeek Config
Jumps straight to your DeepSeek settings in VSCode.
- Model Startup Time: Larger models (especially self-hosted) can have warm-up delays, more a compute issue...
- Improve Error Responses: Stylise and inject error messages into the chat in a nice bubble message format, provide better error messaging too.
- Ask DeepSeek: Will fix the known issue mentioned above AND will also add a message with user selected-text to the chat window, so users can keep tabs.
- Improve User Message Styling: Will add a decent regex or library to detect code in the users requests, and output the user's messages nicely.
- Multi Window Sessions: I am looking at ways to create a session for window, that keeps the chat message context separate, and a local history. Possibly also storing closed chats.
- Multiple AI model support added to Deepseek configuration options.
- Fixed a bug where the "AskDeepSeek" right click feature would not push the request to the floating chat window. Now either window, when opened, will receive Deepseek's right click chat request from your code.
- Improved error handling for the Deepseek floating window.
- Auto-scrolling for large blocks.
- Expandable “View AI Thought Process” section, cleans up the chat window.
- Added Stop functionality to abort streaming output.
- Initial release of 'Self-Hosted DeepSeek R1' for VSCode.
- Chat in sidebar & floating window; streamed responses with multi-question-context; code block insertions via right click menu. Support for cloud and locally hosted models.
Feel free to open issues or pull requests to improve functionality and user experience. Please follow the VSCode Extension Guidelines.
- Unofficial: This extension is not affiliated with or endorsed by DeepSeek.
- Use at Own Risk: We are not responsible for any outcomes, data exposure, or misuse.
- No Illegal Crap!: We do not condone illegal or malicious/harmful activity.
Enjoy exploring DeepSeek R1 in VSCode, with no one snooping on you!