Self-host twinny
v4.0.20VS Code AI assistant running on your own models
- Stars
- 3 684
- Ports
- 8765 (twinny-server gateway HTTP API), 49737 (P2P device sharing (UDP))
- Requires
- Node.js
ghcr.io/twinnydotdev/twinny-serverWhat 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
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
WhiteboardSelf-hosted desktop canvas where coding agents draw architecture-level reviews of diffs. Open-source MIT: AST-based semantic diffs, diagrams linked to code.
AI-Git-BotSelf-hosted AI automation for Git repositories that handles PR reviews, test creation, issue improvement, and code generation across major Git platforms.
CodraCodra is a self-hosted, open-source AI code review engine on Cloudflare Workers that posts inline comments on GitHub PRs using configurable LLM providers.
GerritOpen-source, self-hosted code review and Git repository management server: patchset reviews, fine-grained permissions, plugins, REST API and webhooks.
gitbucketA self-hosted, open-source Git platform in Scala: run one war file on Java 17 for repos, issues, pull requests, wiki, LDAP/OIDC logins and GitHub-compatible APIs.
kodusSelf-hosted AI code review for major Git platforms. Bring your own LLM keys with zero markup. AGPL core with enterprise features.
mergeableMergeable is a self-hosted, open-source GitHub PR inbox with customizable search-based sections, local browser storage, and multi-instance support.
MiraSelf-hosted AI code reviewer for GitHub, GitLab, Forgejo with your LLM key. Code indexing, vuln scanning, custom rules, learning loop, dashboard — free.
ORG-2Open-source, self-hosted desktop app that records coding-agent sessions as replayable trajectories, with a Rust harness, launchers for 20+ CLIs, and team review.
pr-agentSelf-hosted open-source AI agent that reviews pull requests, writes PR descriptions and suggests code improvements on GitHub, GitLab, Bitbucket, Gitea or Azure DevOps.
ProvalSelf-hosted AI code reviewer for GitLab, Forgejo, and GitHub that runs on your own hardware with any LLM you choose, including local models via Ollama or llama.cpp.
Review BoardOpen-source, self-hosted code review platform with advanced diff viewer, document/image review, flexible workflows, and Git/SVN/Perforce integrations.
0 comments