selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

twinny logo

Self-host twinny

v4.0.20

VS Code AI assistant running on your own models

ReleaseOpen SourceMIT
Updatedlast week
LanguageTypescript
Setup difficultyModerate
Stars
3 684
Ports
8765 (twinny-server gateway HTTP API), 49737 (P2P device sharing (UDP))
Requires
Node.js
Docker
ghcr.io/twinnydotdev/twinny-server
Install with Docker Compose

What is twinny?

This open-source VS Code extension adds AI-powered coding features that run entirely on your own hardware. It offers ghost-text completions, inline diff-based edits, a chat sidebar that can reference files and symbols, and an optional agent mode that can modify files and run commands. A built-in workspace index combines keyword and vector search for context. It also handles code review, commit-message generation, terminal command suggestions, and user-editable prompt templates. The extension talks to any OpenAI-compatible server you run — Ollama, LM Studio, llama.cpp, or a hosted API — and can also connect to a self-hosted team gateway (twinny-server) that shares models across developers, enforces policy, and adds PR-review plugins, SSO, shared indexes, backups, and audit logs. The gateway is deployed via npx, Docker, or Helm. Free for solo use and teams up to five seats; larger teams buy licences. No telemetry, no required accounts, MIT licence.

Should you self-host twinny?

twinny scores 63/100 on selfhost.directory (how scoring works) and ranks #16 of 120 in AI Assistant. It has 3 684 GitHub stars.

It shipped 1 stable release in the past year. The latest, v4.0.20, came out on 22 September 2026.

Setup is moderate: expect some configuration beyond a single command. An official Docker image is available. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is hermes-agent (89/100, 257 926 stars). It scores higher overall, so compare the two before you pick. See twinny vs hermes-agent side by side.

Features

  • Agent modeExperimental
  • Audit Log
  • Chat
  • Code Completion
  • Code Review
  • Commit messages
  • Inline edit
  • OIDC SSORequires paid team licence
  • P2P device sharing
  • Prompt templates
  • PR review pluginsRequires paid team licence
  • Shared context indexRequires paid team licence
  • Team gateway
  • Terminal
  • Workspace index

twinny README

How to install twinny

Install twinny with Docker Compose

Docker Compose, NVIDIA Container Toolkit for GPU

docker compose up -d ollama docker compose run --rm twinny-server init /data/twinny.gateway.json --host 0.0.0.0 --ollama ollama docker compose run --rm twinny-server keys create you --admin --config /data/twinny.gateway.json docker compose up -d

Run Ollama and gateway together with docker-compose

How to configure twinny

  • twinny.autoSuggestEnabledtrueSuggest as you type

    Suggest as you type

    values: true/false

  • twinny.chatToolsfalseWhere the agent mode switch starts

    Where the agent mode switch starts

    values: true/false

  • twinny.contextLength100Lines before and after the cursor sent in the prompt

    Lines before and after the cursor sent in the prompt

    values: number

  • twinny.debounceWait300Milliseconds of quiet before a suggestion is requested

    Milliseconds of quiet before a suggestion is requested

    values: number

  • twinny.enabledtrueTurns the extension on or off

    Turns the extension on or off

    values: true/false

  • twinny.enableLoggingtrueWrites one line per request to the Twinny output channel

    Writes one line per request to the Twinny output channel

    values: true/false

  • twinny.localeenLanguage of the sidebar UI

    Language of the sidebar UI

    values: en, zh-CN, zh-HK, de, es, es-CL, ja, fr, it, pt, ru, ko, nl

  • twinny.ollamaApiPort11434Port of the local Ollama

    Port of the local Ollama

    values: number

  • twinny.ollamaHostname0.0.0.0Hostname of the local Ollama

    Hostname of the local Ollama

    values: hostname

  • twinny.p2pPort49737UDP port this computer listens on when sharing its Ollama

    UDP port this computer listens on when sharing its Ollama

    values: number

  • twinny.secretShieldoffMachineSecret shield for API keys and tokens in prompts

    Secret shield for API keys and tokens in prompts

    values: offMachine, always, off

  • twinny.teamShareSlots2How many teammates' requests this computer runs at once while shared

    How many teammates' requests this computer runs at once while shared

    values: 1-8

  • twinny.temperature0.2Randomness of code completions

    Randomness of code completions

    values: number

twinny releases & version history

FAQ

Does twinny run an agent that edits my files on its own?

Only if you switch on agent mode, which is off by default. Then the chat model edits files and runs commands to finish what you asked.

Can I share one GPU machine with my laptop?

Yes, that is what Devices is for. No port forwarding, no account.

Does it work over Remote SSH, WSL or Dev Containers?

Yes, twinny runs on the remote side so localhost means the remote machine.

Can I use it with Cursor, Windsurf or VSCodium?

VSCodium and other Open VSX builds work. Forks of VS Code that support standard extensions generally work but are not tested.

Which model should I use?

For a quick answer: qwen2.5-coder:1.5b-base for completion and qwen2.5-coder:7b-instruct for chat on Ollama.

Does it work offline?

Yes, with a local server. Everything including the workspace index and its reranker runs on your machine.

Does my code leave my machine?

Only to the server you configured. With a local server, nothing leaves. With a paired device, prompts go to your other machine over an encrypted link. With a hosted API, prompts go to that vendor.

Is twinny free?

Yes, the extension is open source under MIT license with no account or payment required. Teams get five developers free, paid seats beyond that.

More in Code Review

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…