Skip to content

AndreRab/OllamaCompletionPlugin

Repository files navigation

🧠 Ollama Completion Plugin 🧠

AI-powered inline code completion for IntelliJ IDEA using a local Ollama LLM model.

This plugin generates smart Java code suggestions directly in your editor using the IntelliJ Inline Completion API and a locally running model like codellama, deepseek-coder, or any other supported by Ollama.


🚀 Features

  • ✨ Inline gray-text completions while typing
  • ⚡ Works fully offline (no external API calls)
  • 🧠 AI-based completions from Ollama
  • 🧾 Efficient caching mechanism to avoid duplicate requests

📋 Caching Strategy

To improve performance and reduce redundant model queries, a windowed cache is used:

  • Caches full prefix → suggestion mappings
  • Stores partial prefix/postfix variants (based on a token window); see examples below
  • Evicts old entries using an LRU strategy

🔧 How to run plugin in your real IDE

  • Install Ollama and make sure the application is running:
  • Download and run the model in your terminal:
  ollama pull deepseek-coder:6.7b
  • Download this file
  • In your IDE, go to Settings → Plugins → ⚙️ → Install Plugin from Disk…, and select downloaded file: OllamaCompletionPlugin--0.0.1.zip
  • ⭕️ Make sure Ollama is running in the background, open your Java project, and enjoy coding with your new AI assistant!

🔧 How to run plugin in a sandbox

  • Install Ollama and run the application:
  • Download and run the model in your terminal:
  ollama pull deepseek-coder:6.7b
  • Clone and run the plugin:
  git clone https://github.com/your-name/OllamaCompletionPlugin.git
  cd OllamaCompletionPlugin
  ./gradlew runIde

This launches a sandbox instance of IntelliJ with the plugin enabled.


😎 Usage example

Projekt bez nazwy

About

AI-powered inline code completion for IntelliJ IDEA using a local Ollama LLM model.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published