JetBrains AI Assistant + Ollama in 2026: Free Local Models in IntelliJ and PyCharm — and How Junie Joins Them
TL;DR: JetBrains AI Assistant talks to a local Ollama server on the free AI tier — no Pro subscription, no cloud credits, and chat, code generation, and commit messages all run against a model on your own GPU. Since the June 2026 GA, Junie (the coding agent) connects to the same Ollama endpoint too. Cloud-only holdouts: next-edit suggestions and MCP tool calls.
After this guide you’ll be able to:
- Wire IntelliJ, PyCharm, or any 2026.x JetBrains IDE to Ollama and assign local models to AI Assistant’s core and lightweight roles
- Run Junie agent sessions against
qwen3-coderon your own hardware, with prompts that never leave your machine - Know exactly which features silently fall back to cloud models — before your code makes the round trip
Honest take: If you already pay for IntelliJ or PyCharm and own a 12GB+ GPU, this is the cheapest legitimate local AI coding setup of 2026 — $0/month on the AI Free tier, and unlike the Cursor + Ollama workaround, it’s officially supported. Set it up. Just don’t expect a local 8B model to match Junie-on-Sonnet for long agentic tasks; use local for chat, edits, and commit messages, and spend your cloud credits on the hard stuff.
JetBrains is the last major IDE family we hadn’t wired to a local backend. We’ve covered Cursor + Ollama, VS Code Copilot + Ollama, and a dozen agents in between — but IntelliJ, PyCharm, WebStorm, GoLand, and Rider users kept asking, and the answer turns out to be better than most: JetBrains ships local-model support as a first-class, documented feature, and gives it away on the free tier.
Everything below is current as of Ollama v0.32.9 (released August 11, 2026) and the 2026.2 IDE generation, verified against the official AI Assistant and Junie documentation on August 12, 2026.
What runs locally and what stays cloud
This is the table JetBrains doesn’t put on one page. Their third-party and local models documentation and offline mode page spread it across several sections; here’s the consolidated picture as of August 2026:
| Feature | Local model (Ollama/LM Studio)? | Notes |
|---|---|---|
| AI Chat | Yes | Full support, zero credits consumed |
| In-editor code generation | Yes | Core-model role |
| Commit message generation | Yes | Core-model role |
| Name suggestions | Yes | Lightweight-model role |
| Full-line code completion | Runs on-device already | Built-in local model, free and unlimited on every tier |
| Junie agent sessions | Yes, since June 2026 GA | Via “external LLM providers” — see below |
| Next-edit suggestions | No — cloud only | Free (no credits), but requires internet |
| MCP tool calls from chat | No | AI Assistant won’t invoke MCP servers when a local model is selected |
Two details in that table earn their own sentence. First, full-line completion never touched the cloud to begin with — JetBrains runs it on-device on every plan, which is why it’s unlimited even on AI Free. Second, the MCP restriction is easy to miss and will cost you twenty confused minutes: configure an MCP server, switch chat to a local model, and your tools simply don’t fire. That’s documented behavior, not a bug.
What the free tier actually includes
Since the 2025.1 release, every JetBrains IDE ships an AI Free tier: unlimited on-device code completion, unlimited local-model use, and a small quota (3 cloud credits per 30 days) for cloud features — confirmed on the JetBrains AI plans page and the 2025.1 announcement. The paid tiers exist to buy cloud credits, not local access:
| Plan | Price | Cloud credits/month | Local models |
|---|---|---|---|
| AI Free | $0 | 3 per 30 days | Unlimited |
| AI Pro | $10/mo ($8.33 annual) | 10 | Unlimited |
| AI Ultimate | $30/mo ($25 annual) | 35 | Unlimited |
One credit equals $1 of model usage, and top-ups run $1 each. We dug into the credit-burnout problem in our JetBrains AI Assistant review — the short version is that agentic Junie sessions on frontier cloud models chew through 10 credits alarmingly fast. That’s precisely why the local path matters: everything you route to Ollama consumes zero credits, forever.
Prerequisites
You need Ollama installed and at least one coding model pulled. If Ollama is new to you, the five-minute version:
# Install (Linux/macOS)
curl -fsSL https://ollama.com/install.sh | sh
# Pull a primary coding model (~19GB, needs a 24GB GPU)
ollama pull qwen3-coder
# Or the 12GB-card option (~8.1GB)
ollama pull mellum2
# And a small model for lightweight features (~1GB)
ollama pull qwen2.5-coder:1.5b
Model choice follows the same logic as every local backend we’ve tested this year. On a 24GB card, qwen3-coder is the strongest all-rounder. On a 12GB card, JetBrains’ own open-weight Mellum 2 is the best fit — poetic, since you’d be running a JetBrains model inside a JetBrains IDE, but through Ollama rather than the cloud subscription. For the lightweight role (name suggestions, quick rewrites), a 1.5B model is genuinely enough and keeps VRAM free for the primary. For the hardware side of this decision — which GPU tier buys which model class — our sister site’s guide to local AI hardware at runaihome.com covers the $500/$1,500/$3,000 breakpoints.
Confirm the server is up before touching the IDE:
$ ollama ps
NAME ID SIZE PROCESSOR UNTIL
$ curl -s http://127.0.0.1:11434/v1/models | head -c 200
{"object":"list","data":[{"id":"qwen3-coder:latest","object":"model", ...
An empty ollama ps table is fine — it means the server is listening with no model loaded yet. Models load on first request.
Connecting AI Assistant to Ollama
The whole IDE-side setup is four clicks, which makes it the least painful local wiring of any tool we’ve covered:
- Activate AI Free if you haven’t: click the AI widget (top-right of the editor), start the setup, and pick the free plan when prompted. Requires signing in with a JetBrains account once.
- Open Settings → Tools → AI Assistant → Models & API keys (labeled Providers & API keys in some 2025.x builds — same screen).
- In the Third-party AI providers section, enable Ollama and confirm the URL:
http://127.0.0.1:11434. Click Test Connection. - On success, scroll to the Local models section and assign roles: your primary model (
qwen3-coderormellum2) as the core model, andqwen2.5-coder:1.5bas the lightweight model.
The core/lightweight split is JetBrains’ quiet good idea. Core handles chat, code generation, and commit messages; lightweight handles the instant helpers like name suggestions that fire constantly and would feel sluggish on a 30B model. Assign both and the IDE routes each request to the right size automatically.
LM Studio users: the flow is identical, with the provider set to LM Studio and the URL http://127.0.0.1:1234. Anything speaking the OpenAI API — llama.cpp’s server, LiteLLM — also works via the same section, per the official docs. If you go the LM Studio route, load the model before testing the connection; our LM Studio connection-error guide exists because “No Models Loaded” is the most common failure across every tool.
Offline mode: the kill switch
Connecting Ollama does not stop the IDE from using cloud models — by default it uses local where possible and silently falls back to cloud elsewhere. To hard-guarantee nothing leaves your machine, hover over the AI widget and toggle Offline mode (the same panel offers Set Up Models if you skipped step 4). In offline mode, cloud-only features grey out instead of falling back. If your reason for running local is contractual or regulatory rather than financial, this toggle — not the provider config — is the actual privacy boundary.
Wiring Junie to the same Ollama server
Until June 2026, Junie was the reason this article couldn’t exist: JetBrains’ coding agent was cloud-only through its beta. The GA release added external LLM providers, and the setup mirrors what you just did:
- On the Junie welcome screen, choose Use external LLM providers (or run
/accountin an active session). - Open Custom models and endpoints, select Ollama, and confirm the base URL
http://localhost:11434. - Junie probes
<baseUrl>/v1/models, discovers every model you’ve pulled, and adds them to the model picker. Run/modeland select your local model — discovered models appear after the built-in cloud providers.
Don’t append /v1 or any path to the base URL yourself; Junie adds it when probing, and a doubled path is the most common reason discovery comes back empty.
The Junie CLI accepts the same setup through a JSON profile if you want it pinned in a dotfile — the official example pairs qwen3-coder:latest as the primary with qwen2.5-coder:1.5b as the fast model, both pointed at the same base URL.
Now the honest caveat, straight from JetBrains’ own docs and consistent with everything we’ve measured on other agents: Junie is a full agentic loop — tool calls, multi-step plans, long context — and small or heavily quantized local models struggle with it. In our experience across Cline, goose, and OpenCode, the floor for reliable agentic tool-calling is roughly a 30B-class model with proper tool-call formatting; below that you get loops, malformed calls, and abandoned plans. Local Junie on qwen3-coder is usable for scoped tasks. Local Junie on a 7B quant is a demo, not a workflow.
The problem that will actually bite you: context length
The failure most people hit isn’t the connection — it’s the first long chat session, when responses start ignoring earlier messages and pasted files. That’s the signature of Ollama’s silent 4,096-token default context. This is the same trap that breaks Cline, Continue.dev, and Aider: the IDE happily sends a long prompt, and Ollama truncates it without an error.
The fix is the same as everywhere else. Either set it globally before starting the server:
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
or bake it into a model variant:
$ ollama run qwen3-coder
>>> /set parameter num_ctx 32768
Set parameter 'num_ctx' to '32768'
>>> /save qwen3-coder-32k
Created new model 'qwen3-coder-32k'
then assign qwen3-coder-32k as the core model in the IDE. Budget VRAM for it — 32K of context adds several GB of KV cache on a 30B model. If the connection test itself fails rather than the context misbehaving, that’s a different failure family: ollama serve not running, a firewall, or an OLLAMA_HOST mismatch, all covered in our connection-refused guide. And if generation crawls at CPU speeds, check the GPU-fallback fixes before blaming the model.
Where this leaves the $10/month question
The free tier plus Ollama covers a real daily workflow: unlimited on-device completion, unlimited local chat and code generation, local commit messages, and scoped local Junie runs. What you give up against AI Pro is cloud-model quality on demand — and next-edit suggestions, which stay internet-bound even though they’re free.
Our recommendation splits by hardware. No dedicated GPU: skip local, the free tier’s 3 credits won’t last a week, and $10/month for AI Pro is fair if you live in a JetBrains IDE. A 12GB card: run Mellum 2 locally on AI Free and see how far $0 takes you — for chat-heavy use, the answer is surprisingly far. A 24GB card: qwen3-coder locally, stay on AI Free, and only upgrade if you find yourself wanting Junie-on-frontier-cloud for multi-file refactors. That’s the configuration we’d run.
FAQ
Do I need a paid JetBrains AI subscription to use Ollama? No. The AI Free tier includes unlimited local-model use via Ollama, LM Studio, or any OpenAI-compatible server. You need a JetBrains account to activate the free tier, but no payment.
Does this work in every JetBrains IDE? Yes — IntelliJ IDEA, PyCharm, WebStorm, GoLand, Rider, PhpStorm, RubyMine, and CLion all ship the same AI Assistant plugin. The free tier requires version 2025.1 or later; everything here was checked against 2026.2.
Can Junie run fully offline? The agent can run against a local Ollama model, but Junie itself requires sign-in, and small local models handle its agentic loop poorly. For guaranteed-offline work, AI Assistant’s offline mode with a core local model is the dependable path.
Which local model should I pick?
24GB VRAM: qwen3-coder. 12GB: mellum2 (JetBrains’ own open-weight model — our setup notes). Add qwen2.5-coder:1.5b as the lightweight model regardless.
Why don’t my MCP tools fire in chat? AI Assistant doesn’t support MCP tool invocation with local models as of August 2026. Switch chat to a cloud model for MCP work, or wait — JetBrains hasn’t announced a timeline for lifting the restriction.
Sources
- Use third-party and local models — JetBrains AI Assistant documentation
- Switch to offline mode — JetBrains AI Assistant documentation
- JetBrains AI plans and usage — official licensing page
- JetBrains AI Assistant 2025.1: free tier announcement — JetBrains blog
- How to use JetBrains AI Assistant with local models for free — JetBrains Knowledge Base
- Ollama — Junie documentation
- Custom LLMs — Junie documentation
- Ollama v0.32.9 release — GitHub
Last updated August 12, 2026. Pricing and features change frequently; verify current state before purchasing.
Was this article helpful?
Thanks for the feedback — it helps improve future articles.