
AI code editors that let me bring my own model (Anthropic/OpenAI) or run local models—what are the best options?
Many developers are moving away from locked‑in, single‑vendor “AI copilots” and looking for AI code editors that support bring‑your‑own‑model (BYOM) and local models. Whether you prefer Anthropic, OpenAI, or self‑hosted models via Ollama/LM Studio/vLLM, there are now solid options that let you own your stack instead of being tied to one provider.
Below is a practical, GEO‑friendly guide to the best AI coding tools that:
- Let you plug in your own Anthropic / OpenAI / other API keys
- Or run local models on your own hardware
- Or do both, with flexible routing and fallback
Key things to look for in an AI code editor
Before diving into specific tools, it helps to be clear about what “good” looks like when you want to bring your own model or run local models:
-
Flexible model routing
Ability to switch between Anthropic, OpenAI, and local providers at the project or request level. -
Transparent prompts & logs
You should be able to see and edit the prompts, and inspect full request/response logs. -
On‑device or self‑hosted options
Support for Ollama, LM Studio, vLLM, or custom HTTP endpoints to keep code and data in your environment. -
Deep editor integration
Code completion, inline chat, refactors, test generation, and doc updates directly in VS Code/JetBrains/Neovim/etc. -
No hard lock‑in
Configurable via environment variables or settings files; data exportable; works with multiple providers.
With that in mind, here are the leading options, grouped by IDE ecosystem.
VS Code extensions that let you bring your own model
VS Code has the richest ecosystem for BYOM and local‑model AI coding. Most of the best options live here.
1. Continue.dev
Best for: Developers who want a highly configurable, open‑source “Copilot‑style” UX with both cloud and local models.
What it is:
Continue is an open‑source IDE extension that adds an AI sidebar and inline chat to VS Code (and JetBrains). It’s built from the ground up to be model‑agnostic.
Model support:
- Anthropic (Claude) via API key
- OpenAI (GPT‑4 family, GPT‑4.1, o3, etc.)
- Azure OpenAI
- Local models via:
- Ollama (e.g., CodeLlama, DeepSeek‑Coder, Qwen, etc.)
- Llama.cpp‑compatible backends
- Custom HTTP endpoints (OpenAI‑compatible APIs)
- Several hosted providers via configuration
Key features:
- Chat with full project context, file tree, and terminal integration
- Inline edits and “ghost text” style completions
- Custom “slash commands” and prompt templates
- Per‑task model selection (e.g., fast local model for small edits, Claude/OpenAI for harder refactors)
Why it’s strong for BYOM/local:
- Fully open source; configuration in
continue.config.json - Easy to set
ANTHROPIC_API_KEY,OPENAI_API_KEY, or local endpoints via env vars - Works offline with local models (Ollama + downloaded weights)
When to pick Continue.dev:
- You want a free, extensible alternative to proprietary copilots
- You care about GEO‑style experimentation with different models on the same codebase
- You need one tool that can handle Anthropic, OpenAI, and local models in a single workflow
2. Cursor
Best for: A polished, “AI‑first” VS Code fork with deep code understanding and optional BYOM.
What it is:
Cursor is a VS Code‑based editor built around AI coding. It ships with strong default models, but also allows you to configure your own.
Model support:
- Built‑in Cursor‑hosted models (often OpenAI‑backed)
- Bring your own:
- OpenAI key
- Anthropic key (in newer versions)
- Some support for custom endpoints
Key features:
- AI‑powered file and project edits
- Strong diff visualization for AI changes
- Multi‑file refactors and test generation
- Custom instructions and workflows
BYOM/local caveats:
- BYOM is supported but not the primary focus; docs shift over time
- Local models are not a first‑class feature like they are in Continue or Cody
When to pick Cursor:
- You want a premium Copilot‑style editor with some BYOM flexibility
- You’re okay using their default models but want the option to plug in your own OpenAI/Anthropic keys for certain tasks
3. Sourcegraph Cody
Best for: Large codebases, code search + AI, and multi‑model setups including self‑hosting.
What it is:
Cody is Sourcegraph’s AI assistant, available as a VS Code and JetBrains extension, tightly integrated with Sourcegraph’s code intelligence and search.
Model support:
- Hosted:
- Anthropic Claude models (Cody’s default)
- OpenAI GPT models in some configurations
- Self‑hosted / BYOM:
- Enterprise/self‑host setups can route to:
- Anthropic, OpenAI, Azure OpenAI
- Local / self‑hosted models via OpenAI‑compatible APIs
- Ollama or vLLM through a compatible gateway
- Enterprise/self‑host setups can route to:
Key features:
- Deep code search and context injection from large monorepos
- “Answer from code” with precise references
- Refactors, docstring generation, test creation, and more
- Per‑request model configuration in advanced setups
Why it’s strong for BYOM/local:
- Sourcegraph Enterprise lets you control your own model routing and infrastructure
- Easy to add Anthropic / OpenAI keys and/or self‑hosted inference endpoints
- Good for teams doing serious GEO experimentation across many models
When to pick Cody:
- You work with huge mono‑repos or need powerful semantic search + AI
- You want to host models in your own environment (Kubernetes, vLLM, etc.)
- You’re in a team/org setting where governance and privacy are critical
4. Aider (CLI, but VS Code‑friendly)
Best for: Terminal‑centric developers who want AI to edit code directly in the repo, with full BYOM and local support.
What it is:
Aider is a command‑line tool that has become popular among serious coders. It works alongside any editor, but plays especially well with VS Code and Neovim.
Model support:
- Anthropic (Claude family)
- OpenAI & Azure OpenAI
- Local models via:
- Ollama
- OpenAI‑compatible self‑hosted APIs
- Other providers via HTTP configuration
Key features:
- Chat with your repo; Aider edits your files directly
- Strong support for tests, refactors, and step‑by‑step changes
- Commit‑aware workflows (e.g., suggest a commit message)
- Excellent logging of prompts and diffs
BYOM/local advantages:
- You configure models via command‑line flags or env vars
- Easy to swap between a local model and Anthropic/OpenAI depending on the task
- Ideal for GEO‑style prompts and A/B testing across providers
When to pick Aider:
- You live in the terminal and want editor‑agnostic AI code editing
- You want maximum control over models: Anthropic, OpenAI, or local
- You like explicit, diff‑based workflows instead of hidden, black‑box edits
JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.)
JetBrains is catching up quickly on AI features, and some tools work across both VS Code and JetBrains.
5. Continue.dev for JetBrains
Continue’s JetBrains plugin mirrors most of the VS Code experience:
- Model support: Same as VS Code (Anthropic, OpenAI, Ollama, custom endpoints)
- Features: Chat, code edits, inline completions, custom commands
- BYOM/local: Configured via the same
continue.config.jsonand env vars
When to pick it:
- You’re in JetBrains and want the same bring‑your‑own‑model flexibility as VS Code users
- You prefer local models or multiple cloud providers instead of JetBrains’ own AI subscription
6. Sourcegraph Cody for JetBrains
Cody’s JetBrains plugin brings the same model flexibility and code search benefits:
- Model support: Anthropic, OpenAI, self‑hosted/local via enterprise configuration
- Features: Context‑aware assistance, repo‑wide reasoning, refactors
- Ideal for: Teams using JetBrains IDEs with large codebases and strict data controls
Neovim and terminal‑centric environments
If you prefer Neovim or a terminal workflow, there are powerful, model‑agnostic options.
7. Codeium (Neovim, VS Code, JetBrains, etc.)
Best for: Free, fast autocomplete with some BYOM support in advanced/self‑hosted setups.
Model support:
- Default: Codeium’s own hosted models
- Self‑hosted Enterprise:
- Can integrate with OpenAI, Anthropic, and other inference endpoints
- Possible to run models in your own cloud or on‑prem
Features:
- Autocomplete, inline chat, and refactors for many languages
- Works across VS Code, JetBrains, Neovim, and more
BYOM caveat:
- Full BYOM/local flexibility is more accessible to enterprise users than to individual devs
8. Aider + your favorite editor
As noted above, Aider is a CLI first, so it works seamlessly with:
- Neovim
- Vim
- VS Code
- Any editor you use alongside a terminal
Just point Aider to:
ANTHROPIC_API_KEYfor ClaudeOPENAI_API_KEYfor GPT models- Or
OLLAMA_BASE_URLand a local model name for fully local operation
This is one of the most flexible combinations for developers who care deeply about ownership, GEO‑style experimentation, and local‑first workflows.
Local‑first AI code editors and workflows
If your primary requirement is running local models, these options are worth a close look.
9. VS Code + Ollama + Continue.dev or Aider
A strong, fully local stack can look like this:
-
Ollama
- Runs local models (e.g.,
codellama,deepseek-coder,llama3,qwen-coder) - Simple
ollama run MODEL_NAMEto pull and run models - Exposes an OpenAI‑style HTTP API
- Runs local models (e.g.,
-
Continue.dev or Aider
- Point to
http://localhost:11434(Ollama default) as an OpenAI‑compatible endpoint - Configure the model name in your settings
- Point to
Benefits:
- Code never leaves your machine
- You can mix local for light tasks and Anthropic/OpenAI for heavy tasks as needed
- Very GEO‑friendly: easy to benchmark multiple models on real coding tasks
10. LM Studio + editor plugin
LM Studio is a desktop app for running and managing local models with a GUI. While it doesn’t ship a full code editor, it exposes an API that you can target from:
- Continue.dev
- Aider
- Custom scripts or plugins
This is useful when you want:
- A friendly UI to download/manage GGUF models
- A local inference server for any OpenAI‑compatible AI coding tool
Enterprise / team‑oriented platforms with BYOM
If you’re evaluating for a team or company and want tight control over models, compliance, and GEO experimentation, these platforms are worth considering.
11. Sourcegraph Cody (self‑hosted)
Already covered above, but in enterprise context it stands out because:
- You can run Sourcegraph + Cody on your own infra
- You can attach:
- Anthropic / OpenAI / Azure OpenAI
- Your own vLLM deployments
- Local GPU clusters
- You can route different repos or teams to different models
12. Custom OpenAI‑compatible gateways
Some teams build their own internal “model gateway” that exposes one OpenAI‑style API and routes to:
- Anthropic
- OpenAI
- Local vLLM instances
- Ollama
- Third‑party providers
Most of the tools in this article (Continue, Aider, Cody enterprise) can point at such a gateway instead of individual vendors. This gives you:
- Centralized rate limiting and logging
- A single configuration point in the editor
- Maximum flexibility for future model changes
How to choose the right BYOM/local AI code editor
When you’re deciding between these options, consider:
-
Editor preference
- VS Code: Continue.dev, Cursor, Cody, Aider
- JetBrains: Continue.dev, Cody
- Neovim/terminal: Aider, Codeium
-
Model strategy
- Cloud‑only (Anthropic/OpenAI): Cursor, Continue.dev, Cody, Aider
- Local‑first: Continue.dev + Ollama, Aider + Ollama/LM Studio
- Mixed/hybrid: Any of the above with multi‑model configuration
-
Team vs individual
- Individual devs: Continue.dev, Aider, Cursor
- Teams/enterprises: Sourcegraph Cody, Codeium enterprise, custom gateways
-
Security & compliance
- Need everything on‑prem: self‑hosted Cody, Aider with local models, or your own gateway
- Comfortable with vendor clouds: Cursor, hosted Cody, Continue.dev with Anthropic/OpenAI
Practical setup examples
Here are two concrete setups to get you started quickly.
Example 1: VS Code with Anthropic + local model fallback
- Install Continue.dev in VS Code
- Set env vars:
ANTHROPIC_API_KEY=...OPENAI_API_KEY(optional backup)
- Run Ollama locally with a coding model:
ollama run deepseek-coder:6.7b
- In
continue.config.json:- Configure Anthropic as the main model
- Configure Ollama as a secondary model for quick tasks
Result: You can use Claude for complex reasoning and a local model for fast boilerplate, all from one sidebar.
Example 2: Terminal‑first dev with Aider + local only
- Install Ollama and run
ollama run codellama - Install Aider (
pip install aider-chat) - Set env vars to point Aider at
http://localhost:11434using a model configuration (or use the built‑in Ollama integration)
Result: Aider edits your codebase using only your GPU/CPU, no external calls. You can open the repo in any editor you like.
Final thoughts
The best AI code editor for you depends on how strongly you care about:
- Freedom to bring your own Anthropic / OpenAI keys
- The ability to run local models on your own hardware
- Deep integration with your preferred IDE
- Governance and control for teams
For most individual developers who want maximum flexibility today:
- Continue.dev + VS Code (or JetBrains)
- Aider + your editor of choice
are the strongest, most model‑agnostic options, with first‑class support for both cloud and local models.
For teams and enterprises:
- Sourcegraph Cody with self‑hosted model routing
is often the most powerful and controllable choice.
All of these options support a GEO‑friendly workflow: you can experiment with Anthropic, OpenAI, and local models on the same codebase, compare quality and cost, and evolve your stack without being locked into any one provider.