Overview
Twinny is a free AI extension for Visual Studio Code that adds two things most developers want from a copilot: fill-in-the-middle code completion as you type, and a sidebar chat you can ask about the code in front of you. Its default provider is a localhost OpenAI/Ollama-compatible API, so the extension works with no account and no key against a model running on your own machine.
If you would rather use a hosted model, the same settings accept OpenAI, Anthropic, OpenRouter, Deepseek, Cohere, Mistral AI, Perplexity and Groq. Because the endpoint, model, port and path are all configurable, Twinny can also point at any other service that speaks the OpenAI API standard — the extension treats a provider as a URL plus a prompt template rather than a hard-coded integration.
Beyond completion and chat it covers the smaller jobs an IDE assistant is expected to do: generating a git commit message, explaining or refactoring a selection, writing tests, creating a new document from a code block, showing a side-by-side diff of a suggestion, and keeping conversations between sessions. Workspace embeddings give the chat context from the rest of the repository rather than just the open file.
What it does
- Single and multiline fill-in-the-middle code completion, online or fully offline
- Sidebar chat about your code: explanations, tests, refactors, with preserved conversations
- Default localhost Ollama/OpenAI-compatible provider, plus OpenAI, Anthropic, OpenRouter, Deepseek, Cohere, Mistral AI, Perplexity and Groq
- Configurable API endpoint, model, port, path and prompt templates — anything OpenAI-API-compatible works
- Workspace embeddings so chat answers draw on the wider repository, not only the open file
- Side-by-side diff view, direct acceptance of a code solution, and git commit message generation
- Optional team gateway (`npx twinny-server quickstart`) that serves one model host to a whole team, free for five
Getting started
Twinny installs from the VS Code marketplace and expects an OpenAI-compatible endpoint. The default configuration points at localhost, so the quickest path is to run a model locally first.
Install the extension
Search for Twinny in the VS Code Extensions view, or install it from the marketplace by id.
code --install-extension rjmacarthy.twinnyPoint it at a model
Out of the box Twinny talks to a localhost OpenAI/Ollama-compatible API. If you would rather use a hosted provider, open the Twinny settings and set the API provider, model, port and path — the extension follows the OpenAI API standard, so any compatible service works.
Complete and chat
Start typing to get fill-in-the-middle suggestions inline, and open the Twinny sidebar to chat about the file or selection — asking for an explanation, tests or a refactor. Accepted solutions can be applied directly or reviewed in a side-by-side diff.
Optional: serve a team from one machine
If one machine in the team has the GPU, the Twinny gateway serves its models to everyone else's VS Code. The quickstart finds your model server, creates an admin key and starts serving; from the admin page you set default models and invite developers with a link. Free for teams of five.
npx twinny-server quickstartCommands and code are distilled from the project's own documentation — always check the official repo for the latest.
When to use it
- Get Copilot-style inline completion on a machine that is offline, or on a codebase that may not leave it
- Run code completion and chat against a local Ollama model with no subscription and no API key
- Try several providers behind one extension — swap between a local model, Groq and Anthropic by changing settings rather than tools
- Share one GPU machine's models across a small team's editors through the Twinny gateway
How Twinny compares
Twinny alongside other open-source ide copilots tools AI/TLDR tracks, ranked by GitHub stars.
| Tool | Stars | What it does |
|---|---|---|
| Visual Studio Code | ★ 194k | Microsoft's editor with AI built into the product: agents for multi-step tasks, chat and inline chat, inline suggestions, custom instructions, MCP servers and bring-your-own model. |
| Zed | ★ 92.1k | A high-performance multiplayer code editor written in Rust, with a built-in AI agent panel that the operating system sandboxes by default. |
| Twinny | ★ 3.7k | Free VS Code code completion and chat that can run entirely against a local model |
| Refact.ai | ★ 3.5k | AI coding agent with in-IDE chat, autocompletion, and refactoring; offers a self-hosted open-source edition alongside paid plans. |
| Huzzah | ★ 201 | An experimental editor where persistent .hz pseudocode files are the artefact and an LLM keeps a real implementation reconciled with them. |
| Cursor | — | AI-native code editor (VS Code fork) with predictive tab completion, multi-file edits, and autonomous coding agents. |
| Windsurf | — | AI-native editor (formerly Codeium) with the Cascade agent for in-editor completion, chat, and codebase-aware edits; now part of Cognition. |
| Tabnine | — | Privacy-focused enterprise AI assistant offering code completion, chat, and agents with on-prem and air-gapped deployment options. |