carlrobertoh / CodeGPT

The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like.
https://codegpt.ee
Apache License 2.0
1.1k stars 231 forks source link

Use the Ollama generate API for FIM templates #772

Open boswelja opened 3 days ago

boswelja commented 3 days ago

The Ollama /api/generate API supports prefix + suffix now, let's use that.

Note that there isn't currently a proper API for context files, I opened https://github.com/ollama/ollama/issues/7738 off the back of this. For now, I have hardcoded the deepseek-coder context format, and it seems to work OK across codeqwen2.5 and deepseek-coder, though it's probably not ideal

Waiting for https://github.com/carlrobertoh/CodeGPT/pull/771

carlrobertoh commented 6 hours ago

It looks like none of the models I previously downloaded support this new logic (except the models you listed). Could we keep the FIM template configuration and make it optional instead?

With this, we can also support repository-level completions before they implement it on their end.