# Repository Briefing: twinnydotdev/twinny
> Source: https://repoforai.com/repo/twinnydotdev/twinny (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/twinnydotdev/twinny
- **Official Docs / Website**: https://twinny.dev
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A+ (88/100 · Maintenance 35/35 · Adoption 16/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v4.0.20 (2026-09-22) — https://github.com/twinnydotdev/twinny/releases
- **Review Snapshot**: 2026-12-01
- **Deployment / Stack Signals**: Local AI, Self-Hosted, API
- **Momentum**: 3,711 ★ total (+1 24h / +6 7d) · 247 forks
- **Topics**: `artificial-intelligence`, `code-generation`, `vscode-extension`, `code-completion`, `ollama`, `code-chat`, `llamacpp`, `embeddings`, `private-ai`, `ai-coding-assistant`, `code-review`, `code-review-assistant`
- **When to Use**: Best for: VS Code developers and teams that want to choose where inference runs, separate completion from chat, or share models behind a gateway with per-developer access. Skip if: Your team wants a fully managed service with no endpoint operations, or needs centralized policy and integrations without paid licensing.

## Overview
```text
### Architecture & Core Mechanics
Twinny separates editor workflows from inference. The TypeScript VS Code extension in `src/extension` handles completions, chat, inline edits, reviews, terminal actions, embeddings, and provider selection; `src/webview` contains the React sidebar. The editor sends inference requests to configured model services and can use different providers for completion and chat. A team can add a gateway without changing the editor workflow.

`src/gateway` builds into `packages/twinny-server/cli.js`. The dependency-free gateway serves chat, completion, and embeddings through configured model backends and handles access keys, usage, licensing, and administration. `src/protocol` defines both the extension-facing gateway protocol and the WebSocket peer protocol for pooling developer machines. Separately, the Devices feature pairs computers over an encrypted peer-to-peer link without an account or relay.

### Key Capabilities & Differentiators
Twinny combines ghost-text completion with inline edits that can be accepted or rejected by hunk, and reviews working-tree changes, branch diffs, or GitHub pull requests. Chat can attach files, symbols, diagnostics, diffs, and terminal context. Workspace search combines keyword and vector retrieval, reranks results before adding them to the prompt, updates on save, and shows sources under replies. The experimental agent can read, search, and edit files and run commands; command execution asks for approval by default.

Local options include Ollama, LM Studio, llama.cpp, and other OpenAI-compatible servers. Hosted integrations include OpenAI, Anthropic, Gemini, and Mistral, with Codestral listed for completion. Provider support does not make every model suitable for every task: validate completion, chat, and embeddings separately. The gateway adds revocable per-developer keys stored as hashes, per-user and per-model usage, and a request queue for a shared GPU.

### Trade-offs & Limitations
Compared with a managed coding assistant, Twinny gives you control over model placement and where code context is sent, in exchange for choosing models, maintaining endpoints, and tuning capacity. Local inference can keep requests inside your network, but a hosted backend still receives the context routed to it, even through a self-hosted gateway. Shared GPU queuing manages contention rather than adding capacity, so test interactive completion under concurrent chat and indexing loads.

The extension is MIT-licensed, but not every gateway feature is included in the free tier. The gateway is free for up to five developers; additional seats are listed at $15 per seat per month, with a separate $29 one-time Personal licence. Policy controls, recording, and plugins require a licence, which is checked locally. Standard usage accounting excludes prompt and reply content; licensed recording can retain both on the gateway when enabled and disclosed to users.

### Hardware & Deployment Guide
Start with VS Code 1.93 or newer and install the extension. For local inference, run a model server: Twinny detects Ollama, LM Studio, and llama.cpp on their usual ports and asks which models to use. For hosted inference, configure the provider instead of provisioning a local GPU. For teams, `npx twinny-server quickstart` detects the model server, writes configuration, creates an admin key, and starts serving. The gateway also has Docker packaging under `packages/twinny-server` and a Kubernetes chart in `deploy/helm`.

Before rollout, verify model choices, workspace routing, key revocation, and recording settings; for shared inference, test realistic concurrency rather than sizing from the gateway alone. Workspaces moving from name-based index storage need a one-time rebuild in the Embeddings tab; existing indexes are left untouched. Release v3.23.0 added vision model support. The listed release is v4.0.20, while the package manifest reads 4.3.26; confirm the actual artifact version before pinning a deployment.
```

## Key Capabilities
```text
- Model routing: Use a local backend for completion and a different endpoint for chat.
- Workspace retrieval: Reranked keyword and vector search, updates on save, and sources shown under replies.
- Edit controls: Accept or reject inline diffs by hunk; experimental agent commands ask for approval by default.
- GPU sharing: Encrypted peer-to-peer device pairing without an account or relay, plus a separate gateway pool with request queuing.
- Gateway operations: Revocable hashed developer keys, per-user and per-model usage, Prometheus metrics, and a hash-chained admin audit log.
- Licensed governance: Workspace routing policies, OpenID Connect SSO, a shared context index, and optional disclosed prompt recording.
```

## Quick Start / Clone
```bash
npx twinny-server quickstart
```
