Integrate ollama with IntelliJ
Hi everyone,
I’m fairly new to the whole "let AI generate and change code for us"-approach.
I have a local Ollama-instance running the "qwen2.5-coder"-model. My goal is to integrate this local model into IntelliJ so that it can generate new code and modify existing code without me having to manually insert snippets via copy-and-paste.
I managed to get this working with the "Continue"-plugin, but as far as I know, that plugin has reached "End of Life" (EOL), and the developer recommends a "Terminal/Continue-CLI" workflow—which isn't what I want.
Next, I tried the "JetBrains AI Assistant." Connecting the model as an "external provider" was quite easy. However, the plugin only gives me chat functionality. In my view, that’s relatively useless, as it’s essentially the same as prompting a model in a browser and then copying the result into the code.
As I understand it, I need an "agent" to communicate directly with the code or the project. This is where I’m running into trouble—or rather, where I’m getting stuck.
By default, there doesn't seem to be a usable agent installed, but the "JetBrains AI Assistant" settings allow you to choose from a wide range of agents.
I started by trying "Junie," since it comes directly from JetBrains. However, Junie seems to communicate only with a specific set of fixed models, and I couldn't find a way to configure it to work with my model.
Then I tried the "Open Code"-agent. I managed to establish a connection, but my model responds to every prompt with JSON that appears to be a "tool" call—specifically, an instruction to read or modify a file. However, "nothing" actually "executes" that JSON, so the process just stops there. I’ve already configured the "Open Code" settings to ensure the model understands "tool" calls, but it still isn't working.
I also installed the "Qwen Agent," but I’m completely stuck there.
Just to clarify:
1. I have a "JetBrains All Products Subscription".
2. The agent should work without a "subscription" or "additional costs"; after all, it would be absurd to use a local model only to then have to take out a contract or subscription for the agent.
Could someone give me a hint on exactly how to connect my local model to IntelliJ in "Agent"-mode? Perhaps I’ve overlooked something and it *is* possible with one of the agents I mentioned, or maybe there’s another agent I could try.
I’d be really grateful for any help.
Regards,
Michael Stiller
请先登录再写评论。
1. Connecting the "qwen2.5" via Ollama - this approach allows you to connect a local LLM model for the AI Assistant Chat mode only. The AI Agents may be integrated via the ACP Registry, including the custom AI Agents. Please refer to the following documentation for additional information: https://www.jetbrains.com/help/ai-assistant/activate-agents.html#add-acp-agents
2. Regarding the Junie with the local model - this functionality is currently available only with Junie CLI. Unfortunately, it's not supported in the standalone Junie plugin or the AI Assistant. This request is tracked in our public issue tracker here: https://youtrack.jetbrains.com/issue/JUNIE-47. Feel free to upvote and follow. Please refer to the following documentation on how to connect a custom LLM model to Junie CLI: https://junie.jetbrains.com/docs/custom-llm-models.html
If you have any additional questions or need any assistance, don't hesitate to reach out to our Customer Support team by submitting a support ticket here: https://intellij-support.jetbrains.com/hc/en-us/requests/new?product=ai_assistant
Many thanks,
I got it working using the "Open Code Agent." The issue was the model I used.
In case anyone is interested:
If you choose a model that is too "small" or hasn't been sufficiently trained for tool calls, it won't work—even if the connection to the model is configured correctly.
As far as I can tell, you should choose models with a complexity of at least 9B or 14B. And if you want to use a Qwen model, you should opt for the Qwen3.x series or derived models.
Best regards,
Michael