Notes from building twinny.
How a self-hosted coding assistant is put together: what a 7B model sees when you pause, how a team shares one GPU, why the licence check has no server. Short, specific, from the code. New posts in the feed.
-
Before the search: what Index workspace reads, skips, hashes and keeps when you cancel
The search side of the workspace index has a post of its own. This one is the other half, from src/extension/embeddings/indexer.ts and embedder.ts. Which files are read, the two ways a file counts as unchanged, how many texts go to the server at once, what a cancelled run keeps, and why saving a file stops updating the index after you switch embedding models.
-
4.3.6 and 4.3.7: grey text in the composer, five sign-ins each, one token for many repositories
Two small releases. The chat composer now suggests the rest of what you are typing, half from a word list that never leaves the webview and half from the chat model; the gateway counts sign-in requests per developer behind a reverse proxy instead of per proxy; and the pull request plugins keep one copy of an access token, so an expired one is replaced once.
-
A commit message from the diff: which diff, where it is cut, and what is scrubbed from the reply
The sparkle in the Source Control title bar runs one git command, maybe two, cuts the result at a hunk boundary, sends it as a single user message, and then undoes the model's habit of wrapping the answer in fences. The constants and the fallbacks in src/extension/review/commit-message.ts.
-
Seven ports and a name: what the first run looks for, and what Test provider sends
twinny used to write three Ollama providers on start whether or not Ollama existed. Now it asks seven local addresses for a model list at once, picks a model for each job from the name alone, and leaves a job unset rather than guess wrong. What the probe sends for chat, autocomplete and embeddings, why it stops after one chunk, and how a thrown error becomes a sentence you can act on. From src/extension/providers and src/common/provider-discovery.ts.
-
What a recording keeps: the request as it arrived, the reply as it left, and one row per conversation
By default twinny-server keeps metadata and never content. Switch Recording on and it keeps the conversation and the reply, the code around the cursor and the completion, the embedding inputs and never the vectors. Where the capture happens relative to the secret shield, why a stopped autocomplete is a success, how twelve hex characters turn a dozen agent steps into one row, and what the training export throws away. From src/gateway/recording.
-
Free is a property of the file: what MIT buys you that a free tier does not
An opinion about the difference between a product that costs nothing and software that is yours, using the parts of twinny you can change, the one part that is paid, and the licence check that runs in public code.
-
One contract, three adapters: where a provider name turns into a request
Completion, chat, inline edit, review and the workspace index all end up calling the same three methods. Underneath, one adapter speaks every local server's dialect, one drives the hosted SDKs, one carries the gateway protocol. What each one adds, removes or remembers before a request goes out. From src/extension/inference.
-
An agent in eight thousand tokens: how the tool loop fits a small model's context
Every step of an agent reply resends the whole conversation, tool results included, so a few file reads fill a local model's context. How twinny asks the server how big that context is, shares it out, trims the oldest results first, reads a call the model wrote as text, and what it says on the last request. From src/extension/tools.
-
A review in parts: what the review tab sends, skips and cuts
The extension's review tab never pastes a diff into the chat. It parses the unified diff per file, drops lockfiles and build output, trims any one file to half a part, packs the rest into at most eight requests of 16,000 characters, and writes a verdict across them. The rules, the numbers and the one setting, from src/extension/review.
-
What @terminal actually sends: five runs, the tail, and a hunt for file:line
twinny does not read your scrollback. It listens to VS Code's shell integration, keeps the last five commands per terminal, sends the model the end of the output, and, when a failure names a file in the workspace, can turn it into an inline edit at that line. The constants, the regexes and the decisions in src/extension/terminal.
-
The diff lives in the file: how an inline edit is shown, streamed and settled
Ctrl+I does not open a preview. The old lines and the new lines are both written into your document, tinted, and one of the two sets is deleted when you decide. What that costs, what it buys, and the diff and bookkeeping that make it hold still while the model is still typing.
-
twinny 4.3: agent mode, one key away, and a chat that behaves like a terminal
Six releases in two days. The chat model can now read, search and edit files and run commands in your workspace, behind a switch rather than a setting; commands run in the background with their output in the reply; messages typed mid-reply queue instead of vanishing; and the gateway's Recordings fold an agent conversation into one row.
-
twinny 4.2.8 to 4.2.10: a key nobody sees, a version that lied, and WSL
Three releases in three days. Developers get the gateway's pull-request plugins, opened from VS Code with a one-time code instead of a pasted key; twinny-server learns its own version number; and the extension starts under WSL again.
-
Where the milliseconds go: tuning completion latency
A practical guide to making twinny's suggestions arrive sooner, in the order that pays off, starting with reading the log rather than changing settings.
-
A gateway for five people: one GPU box, in the order you will actually do it
A practical guide to running twinny-server for a small team, from quickstart on loopback to invite links, the queue that replaces errors on a shared GPU, and the day someone leaves.
-
A privacy claim you can grep
Why "we do not look at your code" and "there is nowhere for your code to go" are different kinds of promise, where twinny's outbound requests are in the source, and the cases where local inference does not save you.
-
Choosing a completion model: the name on the tag decides the prompt
A practical guide to picking a fill-in-the-middle model for twinny, what the Automatic template does with the model's name, and what to check when suggestions come back wrong.
-
What @workspace actually does: two searches, a vote, and a cross-encoder
Reading through twinny's workspace search stage by stage, from the question to the labelled blocks in the prompt, and why a 0.08 threshold means the same thing on every question.
-
The completion you did not ask for: typing through a suggestion, the cache, and when the stream stops
What twinny does on every keystroke between the ghost text appearing and the next request, why most keystrokes never reach the model, and the twelve reasons a streamed completion ends.
-
twinny 4.2.7: the model never sees your keys, and the first completion no longer waits
A secret shield swaps credentials for placeholders before a prompt leaves the machine and puts them back in the reply, in the extension and now on the gateway. And the completion model is loaded before you type.
-
A licence check with no licence server
Why the team licence is a signed token verified offline, what it carries, what happens when it lapses, and what the gateway never sends.
-
A blog for a coding assistant that never phones home
What twinny is, what this blog is for, and the rule every post here follows.
-
How a completion is made: what a 7B model sees when you pause
The six steps between a pause in typing and ghost text at the cursor, and why the prompt matters more than the model size.
-
Pooling a teammate's GPU: one gateway, no open ports
How twinny-server lets a developer share their own computer's models with the team, what the sharer consents to, and why a busy GPU queues instead of failing.
-
Devices: the desktop's GPU from the laptop, with no relay
How twinny pairs two of your own computers over an encrypted peer-to-peer link so a laptop can use a desktop's models, and what happens when hole-punching fails.
-
twinny 4.2: pull-request reviews on the GPU you already own
The 4.2 gateway reviews and triages pull requests from GitHub, GitLab, Gitea and Bitbucket with your own models, only when nobody is typing, and keeps the review on your server.