twinnydotdev/twinny

Open-source AI coding assistant for VS Code. Coding agent, code completion, chat, edits and reviews with local or hosted models. Your models, your infrastructure.

twinny – An on‑premise AI coding assistant for VS Code

What it is – twinny is a free, open‑source Visual Studio Code extension that brings LLM‑powered code completion, chat, inline edits, code review, commit‑message generation and more, while keeping all model inference under your control. The extension talks to a model server you choose – a local Ollama/LM Studio/llama.cpp instance, another computer on your LAN, a hosted API (OpenAI, Anthropic, etc.), or a team‑wide gateway you run yourself.


Core capabilities

Feature What you get How it works
Code completion Ghost‑text suggestions that fill in the middle of a line as you type. The extension sends the current file, imports, recent edits and language‑server info to the model server, which streams a completion tuned for ~7B models.
Inline edit Describe a change (Ctrl+I) and receive a diff that you can accept or reject hunk‑by‑hunk. The prompt contains the description and the relevant code; the model returns an edited version, displayed as a VS Code diff view.
Chat Conversational UI in a sidebar; you can attach files, symbols, the Problems panel, git diffs, terminal output, or a workspace search with @. Each message is sent to the server together with the selected context; replies are shown in the chat pane and can be kept for later reference.
Agent mode (experimental) Let the model read, search, edit files and run commands in your workspace, with each step shown. A toggle in the chat (or Shift+Tab) enables a loop where the model issues VS Code commands; the extension asks for confirmation unless you opt‑out.
Workspace index Hybrid keyword‑plus‑vector search over your project, reranked before reaching the model. Files are indexed on save; a small embedding service runs on the server and returns the most relevant snippets for a query.
Code review & commit messages Review the whole working tree, a branch, or a GitHub PR; generate commit messages from the staged diff. The extension builds a prompt from the diff and asks the model to produce a review or a concise commit description.
Terminal integration Describe a command, see the generated shell line before it runs, and get automatic fixes when it fails. The model receives the description and current terminal context, returns a command string, and twinny can execute it or suggest a fix on error.
Prompt templates & rebindable commands Edit the system prompts used for each feature; bind any feature to a custom key shortcut. Templates are plain JSON files shipped with the extension; they can be edited in VS Code.

Architecture

  • VS Code extension (src/extension) implements each feature and communicates with a backend via a lightweight wire protocol (src/protocol).
  • Model gateway (src/gateway) is a tiny Node.js server (twinny-server) that routes requests, enforces per‑user keys, logs usage, and optionally enforces team policies. It can be started with npx twinny-server quickstart.
  • Model providers – twinny supports many back‑ends: local Ollama/LM Studio/llama.cpp, remote OpenAI‑compatible APIs, peer‑to‑peer device connections, and the team gateway.
  • Workspace index – a hybrid keyword/vector index kept up‑to‑date on file saves; embeddings are generated on the server side.
  • Team features – the gateway can manage seats, usage quotas, licensing, SSO, plugins for GitHub/GitLab/Bitbucket, Slack/Discord/Teams notifications, audit logs, Prometheus metrics, and Docker/Helm deployment.

Getting started (user view)

  1. Install the twinny extension from the VS Code Marketplace (requires VS Code 1.93+).
  2. Run a model server of your choice (e.g., ollama serve, lm-studio, or a hosted API). twinny will prompt you to pick the models for completion, chat, etc.
  3. Start coding – completions appear as ghost text, open the sidebar for chat, press Ctrl+I for inline edits, etc.

For teams, run the gateway once:

npx twinny-server quickstart

Then invite developers via the generated link; the admin page lets you set default models, view per‑user usage, and enable optional plugins.


Installation & deployment

  • VS Code extension – install from the Marketplace or via code --install-extension rjmacarthy.twinny.
  • Gateway – available as the npm package twinny-server; also provided as Docker images and a Helm chart (deploy/helm) for Kubernetes.
  • Model back‑ends – any OpenAI‑compatible server, Ollama, LM Studio, llama.cpp, QVAC, Oobabooga, LiteLLM, Open WebUI, etc.

Licensing & pricing

  • The extension and the gateway are MIT‑licensed and free to use.
  • Team seats – free for up to five developers forever. Additional seats cost $15 per developer per month after a 30‑day trial (no credit‑card required). Pricing and trial details are on twinny.dev.
  • Optional paid licence unlocks team‑wide policies, recording, plugins, SSO and other enterprise‑grade features. The licence check is performed locally; the gateway never phones home.

Community & contribution

  • Issues and pull requests are accepted on GitHub: https://github.com/twinnydotdev/twinny.
  • A CONTRIBUTING.md file describes the build (npm run build) and test (xvfb-run -a npm test) workflow.
  • Discussions, questions and support are available via GitHub Discussions or the @twinnydotdev X account.

In short: twinny lets you keep AI‑assisted development entirely inside your own network, with a rich set of coding‑aid features and optional team‑level management, all under an open‑source MIT licence.

Related

  • Project
  • Project
  • Project
  • Project
  • Project