offline-ai-coding-ollama-eclipse-featured-image

Coding is great, until the internet goes down. Like I said in a previous post, I felt like I lost my “coding brain” when I couldn’t reach my online AI assistant. It was a scary feeling of addiction! But I found a way to be independent.

Today, I show you how to set up your own completely offline AI assistant using Ollama, the Qwen2.5-Coder:7b model, and the Code Intelligence plugin for Eclipse. No internet, no subscription, just you and your code.


Why Qwen2.5-Coder:7b?

I tried many local models. Some are too big and make my laptop heat like a toaster. Some are too small and give “stupid” code. Qwen2.5-Coder:7b is the “sweet spot.” It is optimized for programming and fits perfectly in 8GB or 16GB of RAM. It understands Java, Python, and C++ very wellโ€”perfect for us Eclipse users.


Step 1: Install Ollama (The Engine)

First, you need the engine that runs the AI on your machine.

  1. Go to ollama.com and download the version for your OS (Windows, Mac, or Linux).
  2. Install it like any other program.
  3. Open your terminal (or Command Prompt) and type this command to download the model:Bash ollama pull qwen2.5-coder:7b Wait for it to finish. It is about 4.7GB.

Step 2: Install Code Intelligence in Eclipse

Now we need to connect Eclipse to Ollama. We use the Code Intelligence plugin (created by Carsten Habicht).

  1. Open Eclipse IDE.
  2. Go to Help -> Install New Software…
  3. Click Add… and enter these details:
    • Name: Code Intelligence
    • Location: https://chabicht.github.io/code-intelligence/update-site/
  4. Select the plugin from the list, click Next, accept the license, and Finish.
  5. Restart Eclipse when it asks.

Step 3: Configure the Local Connection

Now we tell Eclipse to talk to your local AI instead of the cloud.

  1. Go to Window -> Preferences (on Mac: Eclipse -> Settings).
  2. Find Code Intelligence in the left menu.
  3. Click on Setup wizard…
  4. Select Ollama from the Provider list, click Test connection then Next.
  5. Select the Completion model or type Ollama/qwen2.5-coder:7b then click Next.
  6. Select the Chat Model or type Ollama/qwen2.5-coder:7b then click Finish.
  7. Click Apply and Close.

Step 4: How to Use It

You are now ready! Here is how to use your new “offline brain”:

  • Auto-Complete: Just start typing. When you want a suggestion, press Ctrl+Space (or your default content assist shortcut). You will see suggestions from Qwen.
  • The Chat: Go to Window -> Show View -> Other… and search for Code Intelligence Chat. Now you can ask “Explain this code” or “Write a JUnit test for this” without any internet connection.
  • Context: If you select code in your editor and then go to the chat, the AI will know exactly what you are talking about.

Final Thoughts

Fortunately, I havenโ€™t gone offline again, but now I have a fallback offline option I can use anytime. Using a local AI like Qwen2.5-Coder has transformed my workflow. I no longer feel vulnerable when Iโ€™m offline, itโ€™s faster without network lag, and my code stays securely on my disk.

If you have a very old laptop, you can try the smaller qwen2.5-coder:1.5b modelโ€”it is super fast but a bit less “smart.”

,


Leave a Reply

Your email address will not be published. Required fields are marked *