Skip to content

Integration of DeepSeek API into AI Assistant of PyCharm IDE

License

Notifications You must be signed in to change notification settings

RobToMars/DeepSeek

Repository files navigation

DeepSeek Integration Guide for AI Assistant in PyCharm

This guide provides step-by-step instructions to integrate DeepSeek V3 into AI Assistant as a third-party provider in PyCharm 2024.3.1 (Professional Edition). Data is routed through a fake Ollama server to DeepSeek.


Prerequisites

  • DeepSeek API Key: Ensure you have the necessary API key from DeepSeek.
  • Python/Docker Knowledge: Basic understanding of Python and Docker is required.

Setting Up the Fake Ollama Server

Using Docker

To run the docker container, replace your_api_key_here with your DeepSeek API key:

docker run --rm -e API_KEY=your_api_key_here -p 11434:11434 ghcr.io/robtomars/deepseek

Using Python

  1. Set Up the Repository:

    • Clone the repository.
    • Create a virtual environment.
    • Install dependencies from requirements.txt.
  2. Configure PyCharm:

    • Open your project in PyCharm.
    • Navigate to Run > Edit Configurations.
    • Add a new configuration for fake_ollama_server.py.
    • Add your DeepSeek API key as API_KEY environment variable in the run configuration.

Configuring AI Assistant in PyCharm

  1. Add Third-Party AI Provider:

    • Go to Tools > AI Assistant > Third-party AI providers.
    • Check Enable Ollama and update URL if changed.
    • Use Test connection and Apply settings.
    • AI Assistant will automatically detect the server (approximately every minute) otherwise disable/enable it.
  2. Select the Model:

    • Once the server is detected, choose the DeepSeek model from the available options.
  3. Use the Model:

    • Enter a user prompt to interact with the selected model.

Visual Guides

Python Setup

HowTo

Third-Party AI Providers Configuration

Tools-AI_Assistant_Third-party_AI_providers

AI Assistant Chat Interface

AI_Assistant_Chat


Notes

  • Ensure fake_ollama_server.py is running before proceeding with the integration.
  • If the server is not detected, restart the server and verify the environment variables.

Useful Links


Join the Community

We welcome contributions and feedback! If you have suggestions or encounter issues, please:

Let’s improve this integration together!


Credits


For further assistance, refer to the official DeepSeek documentation or contact the support team.