Directory
Open source AI coding assistants: five agents you can self-host
The six-figure question about a coding model is not how good it is, but whether you can keep it. These five are actual open source: the license is in the repository, the agent runs on your machine or your server, and the model is the only thing you pay for.
Licenses and pricing structure last checked: 20 November 2026
What "open source" has to mean here
A coding assistant has three layers, and only one of them carries the license people think they are getting:
- The agent — the program that reads your files, proposes diffs and runs commands. This is the part that is genuinely open source in the tools below.
- The model — the weights doing the reasoning. Almost always hosted and paid for per token, even when the agent is free.
- The editor — VS Code, JetBrains, the terminal, or a fork of them.
A vendor can be honest about the first layer and silent about the second. When Microsoft announced MAI Code 2 Flash it published benchmark numbers and pricing, not weights: the model runs on Microsoft's infrastructure, and the closest thing to self-hosting is MAI Licensed Weights, which deploys into your own Azure tenant under a license rather than into your own server. That is a real product, and it is not open source. The details are on our MAI Code 2 Flash page.
Every entry below names the license of the agent itself. In all five, the model stays external — free tiers exist, but for real work you are buying tokens from someone.
The five agents
OpenHands
MIT. A general software-engineering agent rather than an autocomplete box: you give it an issue, it reads the repository, writes the patch and runs the tests inside a container. It speaks to whichever model you configure, from a hosted API to a local model you serve yourself. The catch: it wants container isolation to be safe, which means a machine with real memory, and long agent runs burn tokens faster than a chat window — the free model tier will not survive an afternoon of it.
OpenCode
MIT, 228,000 GitHub stars, and by the project's own figure 22 million developers a month. It ships as a desktop app, a terminal interface, a mobile client and an SDK — the same agent in four shapes, pointed at 200+ providers through Models.dev, local models included. This is the one to pick if you already have a model subscription: bring your own key and keep the workflow. The catch: it is moving very fast, and a project adding a client a week will occasionally break a plugin; pin versions if you automate around it.
Cline
Apache-2.0. An agent runtime that lives inside VS Code, JetBrains, Windsurf or Cursor, and also in the terminal — the project claims 11 million developers. Plan mode lets it propose an approach first and act second, MCP servers extend it to your own tools, and it accepts any OpenAI-compatible endpoint, including weights you host yourself. The catch: the editor extension model means your project files pass through the model provider you configure — if your code cannot leave the building, the choice of provider, not the license, is what protects you.
Aider
Apache-2.0, 44,000 stars, 6.8 million installs. Pair programming in the terminal: it maps the whole repository so the model sees the relevant files, commits every change to git with a message you can revert, and runs your linter and tests after each edit. Works with cloud models and with local ones. The catch: it is a terminal tool with a terminal tool's learning curve, and it is strongest on existing repositories whose tests you already trust — the tests are what catch the model being wrong.
Continue
Apache-2.0 — but read the ownership line before you commit. Continue is the most-installed open source assistant for VS Code and JetBrains, with a config file that points at any model, and it is the one most often recommended in "free Copilot alternative" threads. It has been acquired by Cursor, so the code is still open source today, but the roadmap now belongs to a company that sells a competing editor. The catch is strategic rather than technical: adopt it, and watch the governance, not just the license.
Which one fits
| Agent | License | Where it runs | Bring your own model |
|---|---|---|---|
| OpenHands | MIT | Docker container, server or laptop | Yes, including local |
| OpenCode | MIT | Desktop, terminal, mobile, SDK | Yes, 200+ providers |
| Cline | Apache-2.0 | VS Code, JetBrains, Cursor, terminal | Yes, OpenAI-compatible or own weights |
| Aider | Apache-2.0 | Terminal | Yes, including local |
| Continue | Apache-2.0 | VS Code, JetBrains | Yes |
Rules of thumb that hold up in practice:
- Editing an unfamiliar large repository: OpenHands, because you want it reading and testing rather than autocompleting.
- Staying in your current editor: Cline, or Continue if you mostly want completions.
- Already paying for a model subscription: OpenCode, which is built to take your key and get out of the way.
- Keeping every change revertable: Aider, whose git integration is the point.
The closed side, and what you give up
GitHub Copilot is the default and it is genuinely good: for $10 to $39 a month the model, the editor integration and the hosting are one product, and nobody has to run a container. What you give up is the ability to keep the tool if the price, the model or the company changes — which is not hypothetical this month. MAI Code 2 Flash, GPT-6.2 and Gemini 4 all landed in Copilot within days, and none of them arrived as something you could host.
The honest split: if your code cannot leave your network, none of the five above is enough on its own — you also need a model you host, and that is a separate decision. If your code can leave your network and you simply do not want a vendor deciding which model you use, the five above are exactly the point.
Questions
Is a self-hosted coding agent really free?
No. The agent's license costs nothing; the model does. A serious day of agentic work moves hundreds of thousands of tokens, and a local model good enough for multi-file edits needs a GPU most laptops do not have. Budget either an API bill or a machine.
Do these work with a local model?
Yes, and this is the main reason to pick them over a hosted assistant. Aider, OpenHands and OpenCode all accept local endpoints; Cline accepts any OpenAI-compatible server. The trade-off is quality: a local model in the 30B class handles small edits and explanations, and struggles with the multi-file reasoning the hosted frontier models do well.
Which license actually lets me use this at work?
MIT and Apache-2.0 are the two on this page, and both allow commercial use, modification and redistribution. Apache-2.0 additionally gives you an explicit patent grant, which is why several of these projects chose it. Check the model's terms separately — they are not covered by the agent's license.
Why is Continue on the list if Cursor owns it?
Because it is still Apache-2.0 and still the easiest way to point VS Code at your own model. It is listed with the ownership stated so you can weigh the risk yourself rather than find out later.