Skip to content

GeorgeBPrice/DeepSeekR1-VSCode-Extension

Repository files navigation

Self-Hosted DeepSeek R1, VSCode Extension

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).


Key Features

  1. 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.
  2. Right-Click “Ask DeepSeek”

    • Select code, right-click, and choose “Ask DeepSeek” to get an explanation or debug suggestions.
  3. 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.
  4. Multi-Round Conversations

    • When enabled, each response is remembered. You can build up context in a session.
  5. 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.modelSelection setting (see Configuration below)

Installation

  1. 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:

    1. Open the folder in VSCode.
    2. Run npm install to install dependencies.
    3. Build the extension: npm run compile.
    4. Launch the extension by pressing F5 or via “Run Extension” in VSCode’s debug panel.
  • To deploy the extension for use locally, in any VSCode window:

    1. Install vsce:
      npm install -g @vscode/vsce
    2. Navigate to the DeepSeek extension:
      cd path/to/deepseek/extension-folder
    3. Install the .vsix File Locally:
      vsce package
    4. 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.
    5. 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!

  1. Run DeepSeek Locally on Ollama:
  • For a full guide, view the How to run DeepSeek Locally on Ollama.md in the repo, otherwise:
  1. 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.
  2. 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)
    • Example installations:

      ollama pull deepseek-r1:7b
      ollama pull llama3.1:8b
      ollama pull qwen2.5-coder:7b
      ollama pull mistral:7b
      ollama list
  3. 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 the How to run DeepSeek Locally on Ollama.md` guide.

Configuration

Use hotkey use CTRL + SHIFT + P and type DeepSeek: Config

Or to mouse click navigate to the extension settings in VSCode, go to:

FilePreferencesSettings → 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').

Usage

  1. Open Chat:

    • On the Sidebar Menu click on the DeepSeek Icon, or find DeepSeek in the "Additional Views" three-dots dropdown menu.
    • Or via Command Palette: Use hotkey CTRL + SHIFT + P and enter Show Deepseek.
    • Or enter DeepSeek: Floating Chat to open this optional panel (note that both panels share the same chat history).
  2. Ask a Question:

    • Type your question in the chat text area, press Send. Watch it stream.
  3. 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.
  4. Stop Generation:

    • If the response is streaming too long, click the Stop button.
    • This aborts the in-progress request.
  5. Reset Conversation:

    • Clears previous chat history.
    • Useful if you want a fresh context or to “forget” older Q&A data.

All Commands

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.

Known Issues

  • Model Startup Time: Larger models (especially self-hosted) can have warm-up delays, more a compute issue...

Improvements Coming

  • 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.

Release Notes

0.1.2

  • 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.

0.1.1

  • Auto-scrolling for large blocks.
  • Expandable “View AI Thought Process” section, cleans up the chat window.
  • Added Stop functionality to abort streaming output.

0.1.0

  • 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.

Contributing

Feel free to open issues or pull requests to improve functionality and user experience. Please follow the VSCode Extension Guidelines.


Disclaimer / Other Information

  • 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!

About

This AI chat extension provides a way to interact with a locally hosted DeepSeek R1 model; with a Chat UI built directly in your VSCode sidebar or floating window.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors