Twinny: a VS Code AI completion extension that runs against your own model endpoint
The most no-nonsense, locally or API-hosted AI code completion plugin for Visual Studio Code - like GitHub Copilot but 100% free.
At a glance
- What is it?
- Twinny is an MIT-licensed VS Code extension for fill-in-the-middle code completion and chat, pointed at a localhost OpenAI or Ollama compatible API by default. The interesting question is not whether it is free, but whether a local endpoint is worth the setup.
- Who is it for?
- Adopt Twinny if you already run a local inference server on an OpenAI or Ollama compatible endpoint and want completion plus chat inside VS Code without sending code to a hosted provider. Do not adopt it if you expect completion quality comparable to a large hosted model, or if you are unwilling to manage model weights, VRAM and an endpoint yourself.
- Can I use it commercially?
- Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 1 day ago.
- What is it written in?
- Mainly TypeScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.
DEEP OPEN-SOURCE ANALYSIS
What Twinny is for, and who ends up using it
Twinny is a Visual Studio Code extension that provides two things: inline code completion using fill-in-the-middle prompting, and a chat sidebar for questions about the code in front of you. The README describes it as "a free AI extension for Visual Studio Code, offering powerful AI-assisted coding features." The package description is narrower and more useful: "Locally hosted AI code completion plugin for vscode." The keywords in package.json include "no-leaks" and "private," which tells you the intended buyer.
The person this is for works somewhere that makes hosted autocomplete awkward. A regulated codebase, a client contract that forbids sending source to a third party, or simply a developer who does not want a subscription. Twinny's default provider is a localhost OpenAI or Ollama compatible API, so the completion request never leaves the machine unless you deliberately configure a hosted provider.
It is not for someone who wants the best possible suggestion with zero setup. A local model has to be downloaded, served, and given enough memory. Twinny is the client; it does not ship the model.
How the completion and chat paths actually work
The architecture is a thin client. The extension activates on startup, reads your configured provider, model, port and path, and issues HTTP requests to that endpoint. The README states that OpenAI API standard compliance is a feature, which is why the provider list can include OpenAI, Anthropic, OpenRouter, Deepseek, Cohere, Mistral AI, Perplexity and Groq alongside a localhost server. Anything that speaks the OpenAI or Ollama shape can be dropped in.
Completion uses fill-in-the-middle, described in the README as single and multiline. FIM means the model receives the text before the cursor and the text after it, and predicts what belongs between. That is a different prompt shape from plain left-to-right generation, and it is why the model you choose matters: not every local model is trained for it.
Chat runs from the sidebar and can be given workspace context through embeddings, which the README lists as a feature for "context-aware AI assistance." The repository also exposes a bin entry, twinny-node, pointing at out/node/cli.js, so the same machinery has a command line surface. The README does not document that CLI, so treat it as present in the repository layout rather than documented behaviour.
A practical detail from package.json: engines.vscode is ^1.93.0. Older VS Code builds will not install it.
Installing Twinny and getting a first completion
The README points to the VS Code marketplace for installation and to the project documentation site for a quick start. The README itself does not include step-by-step install commands, so the marketplace route is the documented one. If you build from source instead, the repository is a TypeScript project with a package.json and a scripts directory, but the README does not spell out a build sequence, so do not assume one.
Before the extension can complete anything, an endpoint has to exist. With Ollama running locally, the default provider setting points at a localhost OpenAI or Ollama compatible API. Pull a model first, then point Twinny at it:
ollama pull codellama
ollama serveThe README lists codellama among its topics, so it is a reasonable first model choice rather than an invented one. Once the server is up, open VS Code settings and set the provider to the localhost option, then set the model name. The configurable settings named in the README are API provider, model, port and path. Those four fields are what you adjust; the README does not enumerate every key name, so read the settings UI rather than guessing at JSON keys.
With the endpoint configured, type in a file and pause. A single-line suggestion should appear as ghost text. Accepting it inserts the code directly, which the README calls "direct code solution acceptance." For chat, open the sidebar and ask about the open file. If nothing appears, the endpoint is the first thing to check, not the extension.
Where Twinny falls short
The hardest constraint is the one the README does not discuss: you supply the compute. A local model good enough for FIM completion needs to be resident in memory while you work. On a laptop with integrated graphics, that means either a small model with weaker suggestions or a large one that competes with your editor for RAM. Twinny has no answer for this because it is not a model.
Second, the README's own disclaimer says functionality "may vary between updates," and the release history shows why. The gap between v3.23.0 in April 2025 and v4.0.3 in September 2026 spans a major version. Anyone pinning behaviour, prompt templates or endpoint assumptions should expect breakage across a jump like that.
Third, the troubleshooting path is thin. The README's Known Issues section does not list issues; it redirects to the GitHub issues page. There is no documented rollback procedure, no compatibility matrix for models, and no statement about what happens when the endpoint returns a malformed response. If your local server is slow, the README does not describe a timeout or cancellation behaviour.
Finally, workspace embeddings add cost. Indexing a large repository against a local embedding model is work the extension has to do before chat gets context-aware, and the README does not quantify it.
Twinny against Continue
The obvious comparison is Continue, another open source VS Code assistant that also supports local and hosted models. The difference is scope. Continue presents itself as a configurable assistant platform with a YAML configuration file, multiple context providers, and a broader set of IDE integrations. Twinny is narrower: completion plus chat, configured through VS Code settings rather than a separate config file, with the localhost endpoint as the default rather than one option among many.
That narrowness cuts both ways. If you want to define custom context providers, swap in a different embedding backend, or share one configuration across a team, Continue's approach fits better. If you want to install an extension, point it at Ollama, and stop thinking about it, Twinny's smaller surface is the point.
The other difference is the provider list. Twinny's README lists nine providers including OpenAI, Anthropic and Groq. That is a hosted fallback if the local model disappoints, without changing tools.
Licence and the cost of keeping it current
Twinny is MIT licensed, stated in the README and in package.json. That permits commercial use, modification and redistribution provided the copyright notice and licence text are retained. It says nothing about the models you point it at, which carry their own licences, and nothing about the hosted providers on the list, which have their own terms and billing. Combining an MIT client with a non-permissive model is a question for your own review, not something the extension's licence settles.
The project is not archived, and the last push was on 2026-09-14. Upgrade cost is the real maintenance line item. The extension is published to the marketplace, so updates arrive automatically unless you pin a version. Given the v3 to v4 jump and the README's warning that functionality may vary between updates, pinning matters more here than for a project with a stable interface. There is no migration guide in the README for the v4 change, and no changelog is included in the repository.
Editorial conclusion
Adopt Twinny if you already run a local inference server on an OpenAI or Ollama compatible endpoint and want completion plus chat inside VS Code without sending code to a hosted provider. Do not adopt it if you expect completion quality comparable to a large hosted model, or if you are unwilling to manage model weights, VRAM and an endpoint yourself. Before installing, confirm three things: that your VS Code is at least 1.93.0, that your endpoint answers on the port and path you plan to configure, and that your chosen model supports fill-in-the-middle, since the extension's completion feature depends on it.
Frequently asked questions
What is the Twinny VS Code extension?
It is a free, MIT-licensed Visual Studio Code extension that provides fill-in-the-middle code completion and a chat sidebar. Its default provider is a localhost OpenAI or Ollama compatible API, though it also supports hosted providers including OpenAI, Anthropic and Groq.
How does Twinny compare with Continue?
Both are open source VS Code assistants that can run against local or hosted models. Twinny is narrower, offering completion and chat configured through VS Code settings with a localhost endpoint as the default, while Continue is a broader assistant platform. The README does not mention Continue.
What does the name Twinny mean?
The repository does not explain the origin of the name. The README and package.json describe the project only as an AI code completion and chat extension for VS Code.
What is Twinny?
Twinny is an MIT-licensed Visual Studio Code extension for AI code completion and chat, published under the name twinny - AI Code Completion and Chat. The README describes it as a free AI extension for Visual Studio Code.
Community notes