Ravindra BagaleCourses & study guides Track your progress
AI CODING ASSISTANTS · CHAPTER 2 · SETUP

How to Use Local AI in IntelliJ with Ollama and Continue

Keep code on your PC: run Ollama locally and connect it to IntelliJ through the open-source Continue plugin (same ~/.continue/config.yaml idea as VS Code). Good for students who want private practice without cloud tokens.

In short: install Ollama, ollama pull qwen2.5-coder:7b (and a small autocomplete model), install Continue from the JetBrains Marketplace, point provider: ollama in config, reload, then chat. Honest note: Continue’s JetBrains plugin is community-maintained; Continue also recommends the Continue CLI (cn) beside your IDE — both are valid.

Why local AI in IntelliJ

WHY

Cloud assistants are great, but class assignments and client code sometimes must stay offline. Ollama runs the model on your machine. Continue is the bridge many JetBrains + VS Code users share with one config file.

What you need

WHAT
  • Ollama: macOS / Linux / Windows install from ollama.com. Enough RAM for the model (8GB minimum habit; 16GB+ more comfortable).
  • Coding models: Example tags used in our VS Code lesson: qwen2.5-coder:7b for chat, qwen2.5-coder:1.5b for autocomplete — pull exact tags; they change.
  • Continue plugin: JetBrains Marketplace search “Continue”. Same config family as VS Code’s Continue.continue.
  • Optional CLI: Continue docs push active development toward the Continue CLI (cn) if the plugin feels stale.

How it connects

1 · Install Ollama ollama --version 2 · Pull models ollama pull … 3 · Install Continue JetBrains Marketplace 4 · Edit config.yaml provider: ollama 5 · Chat offline code stays local

Install steps

HOW
  1. Install Ollama. Check: ollama --version.
  2. Start the service if needed (ollama serve on some setups). Check: curl http://localhost:11434 → “Ollama is running”.
  3. Pull models with pull (not interactive run): ollama pull qwen2.5-coder:7b and ollama pull qwen2.5-coder:1.5b. Confirm with ollama list.
  4. IntelliJ → Settings → Plugins → Marketplace → install Continue → restart.
  5. Open the Continue tool window / sidebar.
  6. Open config (gear → config.yaml). Paste an Ollama block (sample below). Model names must match ollama list exactly.
  7. Reload config. Pick the Qwen chat model. Ask a tiny question.

Configuration

~/.continue/config.yaml (sample)
name: Local Config (JetBrains)
version: 0.0.1
schema: v1
models:
  - name: Qwen2.5-Coder 7B
    provider: ollama
    model: qwen2.5-coder:7b
    apiBase: http://localhost:11434
    roles:
      - chat
      - edit
      - apply
  - name: Qwen2.5-Coder 1.5B
    provider: ollama
    model: qwen2.5-coder:1.5b
    roles:
      - autocomplete
  1. apiBase: http://localhost:11434 is the usual local URL.
  2. Use a small model for autocomplete so typing stays snappy.
  3. If IntelliJ cannot reach Ollama, check firewall / WSL networking; Continue logs under ~/.continue/logs/ often show the failure.
  4. Same file can also list DeepSeek or xAI providers — pick per task.

Settings tips

  1. Turn off autocomplete if Copilot + Continue both suggest at once.
  2. Keep @-file context small — local models choke on huge pastes.
  3. If the Marketplace plugin misbehaves, try Continue’s CLI (cn) in the IntelliJ terminal with the same config — Continue’s own JetBrains README steers active work there.
  4. JetBrains AI Assistant can also talk to Ollama, but that path needs a JetBrains AI subscription (Ollama’s JetBrains page) — different product from Continue.

First task (5 minutes)

ASK LOCAL MODEL

Write a Kotlin function isValidIfsc(s: String): Boolean for the common 11-character IFSC shape (basic pattern only). Return only the function. I will test it.

  1. Apply to a new file only if the diff is clear.
  2. Write 3 asserts yourself (or ask for tests, then edit).
  3. Reject any request to read secrets.
PathPrivacy
Ollama + Continue (this lesson)Model + code stay on your PC
Cloud Copilot / Claude / AntigravityCode leaves the machine (policy dependent)
JetBrains AI + OllamaLocal models possible; needs JetBrains AI subscription per Ollama docs
Rule: model tags change. If Continue 404s a model name, run ollama list and fix the yaml — never invent a tag.
  • Local is safer for private drills, but malware on your PC can still read files — keep secrets out of the repo.
  • Company may still ban any AI tooling — ask.

Quick quiz

1. Which provider string for Ollama in Continue?

ollama.

2. Where is shared config?

Usually ~/.continue/config.yaml.

3. Why prefer ollama pull over run for setup?

pull downloads without starting an interactive chat session.

4. Continue JetBrains plugin status?

Community-maintained; Continue also recommends the CLI (cn).

Save tokens and money

SMART AI USE

Local models are “free” of API fees but cost electricity and RAM. Use a 1.5B-class model for autocomplete; save larger models for hard chat.

Save these cards

INTERVIEW CARDAI Coding

Local AI in IntelliJ?

Ollama runs models offline.
Continue plugin (or CLI) + config.yaml provider ollama.
Ravindra Bagale · ravindrabagale.com/ai-coding
COMPARISON CARDAI Coding

IntelliJ local vs VS Code local

Same: Ollama + Continue config.yaml.
IntelliJ: Marketplace Continue plugin; CLI fallback.
Ravindra Bagale · ravindrabagale.com/ai-coding
REVISION CARDAI Coding

Ollama IntelliJ in 4

Install Ollama → pull models.
Install Continue.
provider: ollama → reload.
Review every patch.
Ravindra Bagale · ravindrabagale.com/ai-coding