twinny

twinnydotdevMIT活跃维护

VS Code 里的开源 AI 编程助手,支持代码补全、对话、编辑和审查,可接本地或云端模型,数据和基础设施都由自己掌控。

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.

v4.0.20发布于 2026-09-22 10:32 UTC3,695star +2 / 7 天241fork同步于 2026-11-10 11:40 UTC

怎么上手

由 README 提炼,执行前请确认
从 VS Code Marketplace 安装 twinny(需 VS Code 1.93 或更新),然后启动 Ollama、LM Studio 或 llama.cpp 等模型服务器,首次启动时 twinny 会在默认端口发现它们并询问使用哪些模型
硬件要求按 README 说明

README 未给出具体显存或 GPU 型号要求,只说明可跑在本机 Ollama、LM Studio、llama.cpp 等服务器上,也可用其他设备的 GPU 或托管 API;选型建议见官方 quick start 文档。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

VS Code 开源 AI 编程助手,代码补全、聊天、编辑和评审都跑在你自己选的模型服务器上

VS Code 里的开源 AI 编程助手,支持代码补全、对话、编辑和审查,可接本地或云端模型,数据和基础设施都由自己掌控。

核心能力

  • 用 FIM 方式在输入时以 ghost text 流式给出补全,适合 7B 模型
  • Ctrl+I 描述改动,按 diff 分块接受或拒绝内联编辑
  • 聊天中用 @ 附加文件、符号、问题面板、git diff 和终端
  • 实验性 Agent 模式可读写文件、搜索并执行命令,每步可见
  • 工作区索引做关键词与向量混合检索,重排后注入提示词

容易踩的坑

需先自行运行模型服务器(Ollama、LM Studio 或 llama.cpp),扩展本身不带模型;从旧的按名称存储索引升级后,需在 Embeddings 标签页重建一次索引;Agent 模式为实验性功能,执行命令默认会先询问确认。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v4.0.20
  1. v4.0.20最新正式版2026-09-22 · 2026-09-22 10:32 UTC

    这个版本没有写更新说明。

  2. v4.0.32026-09-08 · 2026-09-08 08:24 UTC

    这个版本没有写更新说明。

  3. v3.23.02025-04-15 · 2025-04-15 20:11 UTC
    查看更新说明

    Vision model support.

    image

  4. v3.22.02025-01-29 · 2025-01-29 20:20 UTC
    查看更新说明
    • Better file context for @ mentions, works in editing message and normal editor.
    • Fix some other bugs
    • Enable virtual scrolling of messages to help with UI lag when gets too long.
  5. v3.21.02025-01-14 · 2025-01-14 21:54 UTC
    查看更新说明

    Style and providers overhauled.

    Added default providers.

    Integrated https://github.com/token-js/token.js/tree/main/src

    Removed function calling for now as it's useless and there are better things to do.

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    twinny

    The AI coding assistant for Visual Studio Code that stays inside your network. Code completion, inline edits, chat, code review and more, on a model server you choose: on your machine, on another of your devices, on a hosted API, or on one gateway your whole team shares. Free, open source, MIT licensed, no telemetry, no sign-in.

    Install from the Marketplace · Documentation · What's new · Changelog · Teams · 中文 · Português (BR)

    For teams: one gateway on your network serves every developer's VS Code, with a key per person, usage, policy and an admin page. npx twinny-server quickstart sets it up. Free for five developers, $15 a seat a month after that, and a 30-day trial with no card. Details, prices and a live admin page at twinny.dev.

    Getting started

    1. Install twinny from the Marketplace (VS Code 1.93 or newer).
    2. Run a model server. Ollama, LM Studio and llama.cpp are found on their usual ports at first start; twinny asks which models to use.
    3. Type. Completions appear as ghost text; the sidebar has chat.

    The quick start covers picking a server and models for your hardware, and troubleshooting explains every error message.

    What it does

    • Code completion. Fill-in-the-middle suggestions as you type, streamed as ghost text and stopped at a sensible end. Context comes from open files, imports, the language server and your recent edits. Tuned to work well with a 7B model.
    • Inline edit. Ctrl+I, describe a change, and review it as a diff in the editor. Accept or reject per hunk. Fix with twinny on any diagnostic.
    • Chat with your code. Type @ to attach files, symbols, the problems panel, the git diff, the terminal, or a search of the workspace index. Conversations are kept.
    • Agent mode (experimental). A switch in the chat, or Shift+Tab, lets the model read, search and edit files and run commands in the workspace, each step shown in the reply. Commands ask first unless you say otherwise.
    • Workspace index. Hybrid keyword and vector search over the workspace, reranked before it reaches the prompt, updated on save. Sources show under replies. Indexes are isolated by workspace identity. After updating from name-based index storage, rebuild once in the Embeddings tab; existing indexes are left untouched.
    • Code review of the working tree, a branch against its base, or a GitHub pull request, and commit messages from the staged diff.
    • Terminal. Write a command from a description, shown before it runs. When one fails, twinny finds the file and line and offers the fix.
    • Prompt templates you can edit, and every feature is a plain VS Code command you can rebind.

    Everything runs against a server you control. No telemetry, no account. See Status bar, logs and privacy.

    Model servers and providers

    Where the model runsHow
    On your machineOllama, LM Studio, llama.cpp, QVAC, Oobabooga, LiteLLM, Open WebUI, or any OpenAI-compatible server.
    On another of your computersDevices: pair with a code and use that machine's GPU over an encrypted peer-to-peer link. No account, no relay.
    On a hosted APIOpenAI, Anthropic, Mistral (Codestral for completion), DeepSeek, OpenRouter, Gemini, Groq, Cohere, Perplexity.
    On your team's gatewayConnect to a twinny-server and use the models the team set up. See below.

    Mix them: a local model for completion, a hosted one for chat. The supported models page says which models work for which job on which hardware.

    Teams: one gateway for everyone

    twinny-server is a small dependency-free server that runs on the machine with the models and serves chat, completion and embeddings to every developer's VS Code. Prompts go to your gateway and your backend, nowhere else.

    npx twinny-server quickstart
    

    That finds your model server, writes a configuration, makes an admin key and serves. From the admin page you set the team's default models, send each developer an invite link that opens VS Code and connects them, and see usage per person and per model.

    • A key per developer, stored as a hash, revoked live. Usage, failures and tokens per person and per model; never the content.
    • Pool the team's own computers. A developer flips Share this computer and their local server serves the team through the gateway. No port to open.
    • Plugins (licence): pull requests and issues from GitHub, GitLab, Gitea and Bitbucket listed on the admin page and reviewed by your own models, with the review posted back to the host, and shared with the developers you choose; Slack, Discord and Teams notifications; SSO sign-in with any OpenID Connect provider; one shared context index for every developer's chat; nightly backups.
    • Team policy (licence): team-only providers, locked defaults, routing rules that keep a workspace on local backends, a team system prompt. Shown for consent before connecting.
    • Recording (licence): keep prompts and replies on the gateway, disclosed to every developer, exported as training data.
    • Operations: a hash-chained audit log of every admin change, read-only admin keys, Prometheus metrics, costs per developer when a model has a price, a request queue for a shared GPU, Docker and a Helm chart.

    Free for five developers, forever. A licence bought by card at twinny.dev adds seats and switches on policy, recording and plugins; it is checked locally and the gateway never phones home. A 30-day trial token with every feature is issued by email, no card. See the teams guide, licensing and seats, and the operator reference in docs/gateway.md.

    Repository layout

    PathWhat
    src/extensionThe VS Code extension, by feature: completion, chat, inline edit, review, terminal, embeddings, providers, team connection.
    src/webviewThe sidebar (React).
    src/protocolThe wire protocol between the extension and a gateway, and the WebSocket peer protocol for pooled computers.
    src/gatewayThe gateway: routes, keys, usage, licensing, admin page, plugins. Built into packages/twinny-server/cli.js.
    src/licensingLicence token verification (the signing side is private).
    packages/twinny-serverThe npm package and Docker files for the gateway.
    deploy/helmHelm chart for Kubernetes.
    docsThe operator reference for the gateway and design notes.

    Contributing

    Issues and pull requests are welcome on GitHub. Describe a larger change in an issue first. CONTRIBUTING.md has the build and test steps; the suite runs headless with xvfb-run -a npm test. Questions go to discussions or @twinnydotdev.

    Support twinny

    twinny is free and open source, written and maintained by one person since 2023. If it earns its keep, a team licence is the best way to support it.

    License

    MIT. twinny is actively developed and provided as is.