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
Please sign in to leave a comment.