Integrating DeepSeek AI into IntelliJ IDEA for Java Development
This guide walks Java developers through preparing the environment, installing the CodeGPT proxy plugin, adding the DeepSeek AI plugin, configuring API keys and model endpoints, and using the assistant for code generation, completion, explanation, and troubleshooting within IntelliJ IDEA.
Introduction
The article explains how to equip IntelliJ IDEA with DeepSeek, an AI‑driven code assistant, to boost Java development productivity. It covers environment setup, plugin installation, API configuration, and practical usage scenarios.
1. Environment Preparation
IDEA version
Use IntelliJ IDEA 2023.x or newer for optimal compatibility with the CodeGPT proxy plugin.
Python runtime
DeepSeek requires Python 3.7+ installed and added to the system PATH. Verify the installation with:
python --version
Python 3.12.82. Install DeepSeek Plugin
Proxy plugin (CodeGPT)
Install the CodeGPT plugin from the JetBrains marketplace (https://plugins.jetbrains.com/plugin/21056-codegpt). This plugin acts as a proxy for AI services.
DeepSeek plugin
Open File → Settings (Windows/Linux) or IntelliJ IDEA → Preferences (macOS).
Navigate to Plugins → Marketplace and search for CodeGPT. Install and restart IDEA.
API Key Creation
Visit https://www.deepseek.com/, open the API Open Platform, and create an API key.
3. Configure DeepSeek in IDEA
API Key
In IDEA’s settings, locate the DeepSeek section and paste the generated API key.
Chat model
Set the request URL to https://api.deepseek.com/chat/completions.
Choose the model deepseek-chat.
Reasoning model
Enable Enable code completions and Parse response as Chat Completions.
Select the FIM template and choose DeepSeek Coder.
Use the same request URL as the chat model.
Set the model to deepseek-reasoner.
Apply and confirm the settings.
4. Using DeepSeek
Generating ideas and code
Open the CodeGPT component, select Custom OpenAI, and type a prompt such as “Write a Java method that filters digits and provide a test”. The assistant returns ready‑to‑run code.
public class TestNumberFilter {
public static String filterNumbers(String input) {
return input.replaceAll("[^0-9]", "");
}
public static void main(String[] args) {
String testInput2 = "SSFSDFS结论萨芬122432的噶大都是4无人区是14认识832safsss";
System.out.println("Filtered numbers: " + filterNumbers(testInput2));
}
}Code completion
Press Ctrl + Space (or a custom shortcut) to let DeepSeek suggest the next code fragment based on the current context.
Code explanation
Select a code block, right‑click, and choose CodeGPT. DeepSeek provides a natural‑language description of the logic.
Question answering
Highlight problematic code or describe an issue, then choose CodeGPT: Ask Question. The assistant returns targeted solutions, acting as an on‑demand programming mentor.
5. DeepSeek Usage Statistics
Token consumption and request counts can be viewed on the DeepSeek dashboard. The article shows daily and monthly usage charts, including the number of deepseek-chat requests and total tokens consumed.
Conclusion
By following the steps above, developers can seamlessly integrate DeepSeek into IntelliJ IDEA, enabling AI‑assisted code generation, completion, explanation, and troubleshooting, thereby improving development efficiency.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
AI Architecture Hub
Focused on sharing high-quality AI content and practical implementation, helping people learn with fewer missteps and become stronger through AI.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
