Seven local models, 102 gaps: a completion test through twinny's own code
We ran seven local completion models through twinny's own prompts, stopping rules and cleanup on an RTX 3090 Ti, then ran the code they wrote. Results, speeds, two twinny bugs and what the test can't tell you.
Most completion benchmarks send a model a prompt and score what comes back. An editor does more than that. twinny chooses the prompt format, decides when to stop the reply, then cleans it up before you see it. Any of those steps can break a correct answer.
So we tested what twinny would show you. We cut 102 gaps in working code, asked each model to fill them, and ran the result against tests. This is our own test of our own extension, so the code, tasks and raw results are public: https://github.com/twinnydotdev/fim-bench. The tasks, test code and first draft of this post were written with an AI model, Claude.
Results
The main score uses 93 gaps, three rounds each. The other nine are explained below. The range is a 95% interval. It resamples whole modules, because gaps in the same module are related.
| Model (Ollama tag) | Working suggestions | 95% range |
|---|---|---|
qwen3-coder:30b | 90.0% | 83.5–95.6 |
qwen2.5-coder:7b-base | 73.8% | 63.7–84.0 |
granite-code:8b-base | 70.6% | 58.4–81.8 |
qwen2.5-coder:1.5b-base | 65.9% | 55.9–76.0 |
deepseek-coder:6.7b-base | 65.9% | 56.3–75.7 |
codellama:7b-code | 64.2% | 54.2–74.2 |
starcoder2:7b, with raw: true | 11.5% | 5.9–17.8 |
starcoder2:7b, as twinny 4.3.25 sends it | 9.7% | 4.7–15.8 |
These scores are for one Ollama download of each model, Ollama 0.33.2 and twinny 4.3.25 together. They don’t rate the models in general. The StarCoder2 and DeepSeek rows have known problems, covered below.
Before scoring anything, we decided not to rank models whose ranges overlap. That gives two findings:
qwen3-coder:30bscored above every other model exceptqwen2.5-coder:7b-base. Those two ranges overlap by half a point. After seeing that, we compared the two on the same resampled modules. The 30B came out 16.1 points ahead (95% range 7.2 to 25.4). That is good evidence, but we added the check after seeing the results.- We don’t rank the five models from 64% to 74%. Three of them have 6.7B to 7B parameters and one has 8B. The 1.5B model’s range overlaps all of theirs. That doesn’t prove it is as good as they are. The test is too small to separate them.
Speed and memory
These are from an RTX 3090 Ti (24 GB, 450 W limit) on Linux with driver 580.178.04. Every model was fully on the GPU. A regular 3090 has less memory bandwidth, so don’t assume it will match these speeds.
| Model | Tokens/s | Finished: typical | Finished: slowest 5% | GPU memory (context) |
|---|---|---|---|---|
qwen3-coder:30b | 192 | 246 ms | 385 ms | 21.7 GB (32K) |
qwen2.5-coder:7b-base | 162 | 183 ms | 332 ms | 6.6 GB (32K) |
granite-code:8b-base | 153 | 245 ms | 473 ms | 5.3 GB (4K) |
qwen2.5-coder:1.5b-base | 375 | 113 ms | 187 ms | 2.1 GB (32K) |
deepseek-coder:6.7b-base | 182 | 337 ms | 503 ms | 12.6 GB (16K) |
codellama:7b-code | 180 | 311 ms | 496 ms | 12.6 GB (16K) |
- Tokens per second is the median of Ollama’s own timings for replies of at least eight tokens. It comes from a separate speed test of 20 gaps, three rounds each, with replies limited to 128 tokens.
- Finished is the time from sending the request until the reply ended or twinny’s rules stopped it. The columns show the median and the 95th percentile. The test ran on a server connected to the GPU machine through an SSH tunnel, so these times include the network. They don’t include cleanup, or twinny’s default 300 ms pause after you type.
- Memory is what Ollama reported with each model’s default context. Those range from 4K to 32K, so the memory figures aren’t like for like.
starcoder2:7bisn’t in this table. Some of its replies got stuck repeating themselves, which left gaps in its speed data. What we have is in the repo.
qwen3-coder:30b can be that quick for its size because it is a mixture-of-experts model, so only part of it works on each token. It still needs nearly all of a 24 GB card and took about 12 seconds to load. twinny also has to send it the prompt as a chat.
What we’d try first
- Have 24 GB of GPU memory and don’t mind using nearly all of it? Try
qwen3-coder:30b. It did well here, but leaves little room for a separate chat model. - Short on memory, or want it as quick as possible? Try
qwen2.5-coder:1.5b-base. It was the fastest, and the smallest in GPU memory. - Something in between? Try
qwen2.5-coder:7b-baseorgranite-code:8b-baseon your own code. This test can’t tell you which one to pick.
Two bugs in twinny
The cleanup could remove a bracket the code needed. twinny drops the end of a suggestion when it repeats what follows the cursor. That stops you getting two brackets when the editor has already added one. But with the cursor in foo(|), the suggestion bar(x) needs its own bracket. twinny 4.3.25 cut it to bar(x.
Before testing any models, we put the correct answer for every gap through twinny. Nine came out broken, so no model could score with that answer. We left those gaps out of the main score before we had any results. Here are all 102, before and after cleanup:
| Model | Before cleanup | After cleanup |
|---|---|---|
qwen3-coder:30b | 88.2% | 84.6% |
qwen2.5-coder:7b-base | 73.2% | 70.3% |
granite-code:8b-base | 69.0% | 66.0% |
qwen2.5-coder:1.5b-base | 65.7% | 62.7% |
deepseek-coder:6.7b-base | 64.1% | 61.1% |
codellama:7b-code | 51.6% | 60.5% |
starcoder2:7b, with raw: true | 8.5% | 10.5% |
starcoder2:7b, as twinny 4.3.25 sends it | 8.8% | 9.2% |
The cleanup took CodeLlama from 51.6% to 60.5%, so removing it isn’t the answer. Version 4.3.26 keeps closing punctuation when dropping it would leave a bracket the suggestion opened unclosed. With that fix, all 102 correct answers get through. We haven’t scored the models again on 4.3.26.
Ollama added its template to a finished prompt. twinny had already put StarCoder2’s markers in the prompt, but didn’t send raw: true. Ollama then added more tokens around it. In 4.3.26, prompts that already have fill-in-the-middle markers are sent raw. That makes the request correct, but it didn’t clearly improve StarCoder2’s score (9.7% without it, 11.5% with it). At the end of a file, twinny’s StarCoder2 prompt has no markers, so it still gets Ollama’s template.
Models with problems
codegemma:7b-codeis left out, not scored as zero. Our copy wrote nonsense even for a plain raw prompt that didn’t use twinny. The fault is in that copy or how Ollama 0.33.2 runs it, and we don’t know which. This tells you nothing about CodeGemma in general.starcoder2:7bran past the gap and sometimes got stuck on one token. In our checks, Ollama cut off two replies after 31 repeats without sending its usual “done” message. We treated replies like these as the model’s answer. Retrying them would have given it a second chance. Its Ollama file doesn’t name a pre-tokenizer, which affects how text is split into tokens. We haven’t shown that’s the cause.deepseek-coder:6.7b-baseadded odd double spaces, with and withoutraw: true. Its file is missing the same setting. Again, we haven’t confirmed the cause.
How it works
There are 24 short modules, 12 in Python and 12 in TypeScript, with 47 single-line gaps and 55 multi-line ones. They were written for this test, but they use common programming patterns, so a model may have seen similar code. Each request has one gap, with the rest of the module filled in.
The test uses twinny’s own code for the prompt, request, stopping rules and cleanup, with a small stand-in for the VS Code API. It uses temperature 0.2, up to 512 tokens and no fixed seed. Each suggestion goes back into its module, and the module’s tests run in a new container with no network, limited memory and a 10-second limit. To pass, the tests must finish and print a random token, so code that just exits early fails. Every correct answer passes, and every empty one fails.
There were 2,448 suggestions: 102 gaps, eight setups and three rounds. None of the requests timed out. Gaps were shuffled, the model order changed each round, and only one model was loaded at a time.
What it can’t tell you
- It’s small. 24 modules give wide ranges. The three rounds show how much the output varies, but don’t add any new code to test on.
- It only covers Python and TypeScript, in short, self-contained files. It doesn’t use other files or language-server context. Your projects will be different.
- Passing tests doesn’t mean the code is good. A suggestion can pass and still be wrong in a way the tests miss, or not be what you wanted.
- It’s one download of each model, at the size Ollama provided (Q4_0 or Q4_K_M). Other downloads, Ollama versions or runtimes may score differently.
- It tests completion. It doesn’t tell you anything about chat or code review.
The repo has every reply, the checks we ran before scoring, and the steps to run it yourself. If you find a mistake in a task or how we scored it, please open an issue.