The goal: IntelliJ, PyCharm and friends on local models
JetBrains AI Assistant can use third-party providers, including Ollama and LM Studio running on your own machine. Running JetBrains AI Assistant with local models keeps proprietary code off third-party servers, and it works across IntelliJ IDEA, PyCharm, WebStorm, PhpStorm and the rest of the family. It is less hackable than using Cursor with local LLM models, but the setup is mostly point-and-click.
JetBrains has moved these settings around between releases, so menu names below follow the current documentation. If yours differ slightly, search Settings for “AI Assistant”.
Step 1: prepare the local server
Install Ollama or LM Studio and download at least one model before you touch the IDE; AI Assistant only lists models that already exist.
# Ollama
ollama pull qwen2.5-coder:14b
ollama list
# LM Studio: download a model in the app, then start its server
lms server start
Ollama listens on http://localhost:11434 by default. LM Studio’s local server uses port 1234 by default.
Step 2: add the provider in AI Assistant
- Open Settings | Tools | AI Assistant | Providers & API keys (older releases call this Models & API keys or Models).
- In the Third-party AI providers section, choose Ollama or LM Studio. There is also an OpenAI-compatible option for servers such as llama.cpp or LiteLLM.
- Enter the server URL and click Test Connection.
- Enable the provider and click Apply.
Step 3: assign models to features
Once connected, local models appear in the AI Chat model picker, and you can assign them to specific jobs in the models assignment section:
- Core features: the default chat model, in-editor generation, commit messages and similar.
- Instant helpers: lightweight work such as chat titles, context collection and name suggestions. Put a small, fast model here.
- Context window: JetBrains’ docs give 64,000 tokens as the default for local models. Make sure your model and RAM can actually handle what you set.
Inline code completion
Inline completion is configured separately under the AI completion settings, using an OpenAI-compatible provider. It needs a model that supports fill-in-the-middle; general chat models usually do not qualify. A small coder base model is the right shape for this job.
What about offline mode?
Earlier AI Assistant releases had an explicit offline mode that blocked most cloud calls and routed AI features to local models. The current documentation no longer describes that toggle, so check the settings and release notes for your IDE version before relying on it. If keeping everything on-device is a hard requirement, verify with a network monitor rather than trusting a checkbox.
Limits worth knowing
- JetBrains’ docs state that AI Assistant does not currently support invoking tools from configured MCP servers when using local models.
- Some features may be unavailable with third-party models; JetBrains notes that activating JetBrains AI ensures full functionality. Check your licence terms.
- JetBrains’ Junie agent is a separate product, so do not assume this provider setup applies to it. Check its own docs.
Troubleshooting
- Test Connection fails: confirm the server is running and the URL and port are right. For LM Studio, make sure the server is started, not just the app.
- No models listed: download one first; the IDE will not pull models for you.
- Responses cut off or lose context: on Ollama, the server’s own context length may be lower than the IDE’s setting. Check with
ollama ps. - Completions are poor: you probably assigned a chat model to completion. Use a FIM-capable coder model.
# check what context length a loaded model is actually using
ollama ps
# raise the server-wide default (or use the slider in the Ollama app settings)
OLLAMA_CONTEXT_LENGTH=32768 ollama serve
Verdict
For JetBrains users, local models through AI Assistant are a solid, low-effort option for chat, explanations, commit messages and generation. The lack of MCP tool use with local models means it is not yet a substitute for a full agent; for that, pair it with a terminal tool such as Claude Code with local LLM models or Codex CLI with Ollama.
This post is part of a series on running AI coding tools against local models. The others cover Zed with Ollama, VS Code and Continue with Ollama, JetBrains AI Assistant with local models, Codex CLI with Ollama, Xcode with Ollama, and a capstone on choosing a local coding model for your hardware.

Leave a Reply
You must be logged in to post a comment.