The best local code completion models for tab autocomplete: Qwen2.5-Coder, Qwen3-Coder, StarCoder2, DeepSeek Coder and Codestral, with FIM support and licenses.
For local code autocomplete, the best default is a small base build of Qwen2.5-Coder: 1.5B for most machines, 3B or 7B if you have the VRAM. Autocomplete needs fill-in-the-middle (FIM) training and low latency, not a big chat model. StarCoder2-3B, DeepSeek Coder and Qwen3-Coder also document FIM. Codestral is strong but its weights carry a non-production license.
- Qwen2.5-Coder 1.5B base (~1 GB)
- Qwen2.5-Coder 3B or 7B base
- StarCoder2 (Apache 2.0 repo), DeepSeek Coder (own model license)
- Codestral 22B (MNPL)
Key takeaways
- Autocomplete is a fill-in-the-middle job: the model sees code before and after the cursor. Chat and reasoning models are the wrong tool, and Continue's docs say general chat models are not trained on the completion prompt format.
- Qwen2.5-Coder is still the default in Continue and llama.vscode: 1.5B for under 8 GB of VRAM, 3B under 16 GB, 7B above that. The 7B card lists Apache 2.0.
- On Ollama, the untagged qwen2.5-coder:1.5b tag shares its hash with the instruct build. Pull the -base tag for completion.
- Codestral 22B documents FIM but ships under the Mistral Non-Production License, so it is a poor fit for commercial local use.
- Developers report the real costs are laptop fans and flaky editor integrations, not model quality.
Why does autocomplete need a different model than chat?
The best local code completion model for most people is a small base build of Qwen2.5-Coder, because autocomplete is a different job from chat. It is fill-in-the-middle (FIM): the model receives the code before the cursor and the code after it, and generates only what goes between. A model trained for that job beats a larger chat model, and it answers fast enough to keep up with typing.
Continue’s documentation says the recommended autocomplete models are trained on a “highly specific prompt format” for completion, and that general chat models are not, so they will not produce useful completions. It also says most state-of-the-art autocomplete models have no more than about 10B parameters. Thinking models are generally discouraged because they are slow, and if you use a model that can switch (Qwen3, for example), Continue tells you to turn thinking off for the autocomplete role.
In practice that gives you three selection rules:
- FIM must be documented. The model card or README should show the FIM tokens or an insertion example.
- Prefer base builds. Instruct tuning is for chat. Completion uses the raw prefix/suffix prompt.
- Small beats big. A 1.5B to 7B model that answers in a fraction of a second is more useful than a 30B model that arrives after you have already typed the line.
For chat, agents and bigger picks, see best local LLM for coding in 2026.
Which local models support fill-in-the-middle?
Five open-weight families document FIM, and Qwen2.5-Coder is the one editors default to. The table below comes from each vendor’s model card or README, fetched October 27, 2026.
| Model | Sizes | FIM documented | License | Context | Runs in |
|---|---|---|---|---|---|
| Qwen2.5-Coder | 0.5B to 32B | Yes: <|fim_prefix|>, <|fim_suffix|>, <|fim_middle|> | Apache 2.0 on the 7B card; check each size | 32,768 default, 131,072 with YaRN | Ollama, llama.cpp, Continue, llama.vscode |
| Qwen3-Coder | 30B-A3B, 480B-A35B, Next 80B | Yes: README says FIM is supported in every version | Apache 2.0 (30B-A3B) | 256K (Ollama page) | Ollama, llama.cpp (--fim-qwen-30b-default) |
| StarCoder2 | 3B, 7B, 15B | Trained with the FIM objective (card gives no token example) | BigCode OpenRAIL-M v1 on the 3B card | 16,384, 4,096 sliding window | Ollama, Continue |
| DeepSeek Coder | 1B, 5.7B, 6.7B, 33B | Yes: <|fim▁begin|>, <|fim▁hole|>, <|fim▁end|> | MIT for the repo; separate Model License that allows commercial use | 16K | Ollama, llama.cpp |
| Codestral | 22B | Yes: tokenizer.encode_fim in mistral_common | Mistral Non-Production License (MNPL) | 32k | Hugging Face weights, hosted API |
Two licensing details matter. Qwen’s own README for the FIM section does not state a license, so check the individual model card: the Qwen2.5-Coder-7B card lists Apache 2.0. And Codestral’s weights are for research and testing, with commercial use needing a separate license from Mistral, which rules it out for most production local setups. Our license explainer covers the acceptable-use side.
The recommendation by hardware, from the llama.vscode README, is a useful cross-check. It maps Qwen2.5-Coder 1.5B to under 8 GB of VRAM, 3B to under 16 GB, 7B to over 16 GB, and Qwen3-Coder 30B to over 64 GB. For machines without a GPU it suggests the 1.5B or 0.5B build and warns quality is “significantly lower”.
What is the best local code completion model to start with?
A developer running Ollama on a GPU server with Continue pointed at it called Qwen2.5-Coder 3B a good compromise for autocomplete in October 2025, and kept the largest model they could run for agent work (comment). Another commenter in January 2026 said they had used Qwen2.5-Coder 7B locally for autocomplete for about a year (thread). Both are community reports, not benchmarks.
Start with Qwen2.5-Coder 1.5B base, then move to 3B or 7B if your hardware has room. It is the model Continue’s setup guide uses (qwen2.5-coder:1.5b), and the Ollama library lists the 1.5B base at about 1 GB, the 3B at 1.9 GB and the 7B at 4.7 GB.
- Under 8 GB VRAM, or Apple Silicon with 16 GB: Qwen2.5-Coder 1.5B base.
- 8 to 16 GB: Qwen2.5-Coder 3B base. Check that size’s model card for its license before shipping it in a product.
- 16 GB and up: Qwen2.5-Coder 7B base, or run
--fim-qwen-7b-specin llama.cpp, which pairs the 7B with a 0.5B draft model for speculative decoding. - Language coverage matters more than speed: StarCoder2-3B, which the card says was trained on 17 programming languages from The Stack v2.
- 64 GB or more of memory: Qwen3-Coder 30B-A3B is the heavyweight option, a 19 GB download on Ollama. Treat it as a “fits if you have the memory” choice, not a default.
One gotcha is worth its own line. On Ollama the untagged qwen2.5-coder:1.5b, 3b and 7b tags share image hashes with their instruct variants. The base builds are qwen2.5-coder:1.5b-base, 3b-base and 7b-base. Continue’s own guide uses the untagged tag, so it can work, but if completions look chatty or broken, switch to the base tag.
For sizes and tags of the full Qwen family, see the Qwen Coder local guide.
We build CandorNo GPU? Use a hosted model
Uncensored AI, right in your browser.
Candor runs open models with refusals removed, so it answers the questions other assistants deflect. New accounts get free credits, no card needed.
Try Candor freeHow fast does autocomplete need to be?
Autocomplete has to return before you have typed past the suggestion, which in practice means well under a second. Neither Continue nor llama.cpp publishes a latency target, so treat any specific millisecond figure with suspicion unless it states hardware, quantization and prompt length.
What the vendors do document are the knobs:
- Continue’s
autocompleteOptionsincludedebounceDelayandmodelTimeout. Its docs show 250 and 150 as example values, explicitly not required settings. - llama.vscode exposes a configurable maximum generation time and a context scope around the cursor, and it shows performance stats in the status bar.
- The llama.cpp server’s
/infillendpoint takesinput_prefix,input_suffixand optionalinput_extra(extra files), so the extension controls how much context goes in. More context means slower first token.
Sweep’s next-edit model is worth a mention as a different design. Sweep Next-Edit 1.5B, based on Qwen2.5-Coder under Apache 2.0, predicts your next edit rather than a gap fill, and its model card claims under 500 ms with speculative decoding. That is a vendor claim we have not reproduced.
Our rule of thumb, which is an editorial judgment and not a benchmark: if suggestions feel late, shrink the model or the context before you buy hardware.
How do you set it up?
Expect some friction: in January 2026 one developer called their Qwen2.5-Coder setup in Continue, across JetBrains IDEs and VS Code, “a mess”, and said agent tools lack a good way to configure a separate autocomplete model (comment). A Hugging Face user likewise reported that neither the base nor the instruct GGUF of Qwen2.5-Coder 7B gave FIM completions through Ollama in Continue (discussion); a reply said it works with a workaround. That thread is older, so check whether it still applies.
Install a runtime and an editor extension, then point the extension at a base FIM model. Two routes cover most people.
Continue with Ollama:
ollama pull qwen2.5-coder:1.5b-baseThen add the model with provider ollama and the autocomplete role in Continue’s config. If your build does not pick up the right template, Continue lets you override it with promptTemplates.autocomplete; its docs use the Qwen format <|fim_prefix|>{{{prefix}}}<|fim_suffix|>{{{suffix}}}<|fim_middle|>.
llama.vscode with llama.cpp:
brew install llama.cpp
llama serve --fim-qwen-1.5b-defaultThe README lists the presets by VRAM, and the extension can also install llama.cpp from its menu on Mac and Windows. Tab accepts a suggestion, Shift+Tab accepts the first line, and Ctrl/Cmd+Right accepts the next word.
The full walkthrough lives in the VS Code local LLM setup guide, and the broader stack in self-hosted Copilot alternatives.
What do developers report in practice?
Developers mostly report that small Qwen2.5-Coder models are good enough, and that setup friction and heat are the real problems. The 3B and 7B autocomplete reports and the Continue and GGUF integration problems are above; this section adds the thermals report. All are community reports from Hacker News and Hugging Face, not our tests, and most do not give full hardware or quant details.
- In April 2025, one developer who tried a local Qwen coder model on a 12 GB laptop GPU said it ran so loudly they shelved local models for the time being (comment).
The pattern across the five reports: model quality is rarely the complaint. Template mismatches, editor integration and thermals are.
FAQ
What is the best local code completion model in 2026?
For most machines it is Qwen2.5-Coder 1.5B base, and 7B base if you have more than 16 GB of VRAM. Both are the defaults in Continue’s docs and llama.vscode’s presets. Qwen3-Coder 30B-A3B is the larger option for machines with 64 GB or more.
Which code completion model works best with Ollama?
Qwen2.5-Coder, using the -base tag. Continue’s guide uses qwen2.5-coder:1.5b, but that untagged tag shares a hash with the instruct build, so the base tag is the safer choice. StarCoder2 and DeepSeek Coder are also in the Ollama library.
Can I use a chat model like Qwen3-Coder or Llama for autocomplete?
Only if it was trained for FIM. Continue says general chat models lack the completion prompt format. Qwen3-Coder is the exception: its README says FIM is supported in every version, and llama.cpp ships a --fim-qwen-30b-default preset for it.
Is Codestral free to run locally?
For research and testing, yes. Mistral’s Non-Production License requires a separate commercial license for production use. The weights are on Hugging Face, and the hosted Codestral endpoint is a separate paid or key-gated option.
How big does an autocomplete model need to be?
Rarely above 10B parameters. Continue’s docs say most state-of-the-art autocomplete models are that small. One HN commenter above found 3B a good compromise.
We build CandorSkip the setup
Want an uncensored model without hosting one?
Candor (candorai.dev) is an uncensored AI chat app that runs in your browser: it answers the questions mainstream assistants dodge, on health, money, law and work, without the lecture. New accounts get free credits, no card needed.
Facts from candorai.dev, checked Nov 10, 2026. Candor never changes how we rank or review models. Disclosure.
Sources (11)
- Autocomplete, Continue documentation
- ggml-org/llama.vscode, GitHub README
- llama.cpp server README (/infill endpoint and --fim-qwen presets)
- QwenLM/Qwen2.5-Coder, GitHub README (FIM tokens)
- Qwen/Qwen2.5-Coder-7B, Hugging Face model card
- qwen2.5-coder tags, Ollama library
- bigcode/starcoder2-3b, Hugging Face model card
- deepseek-ai/DeepSeek-Coder, GitHub README
- Codestral announcement, Mistral AI
- mistralai/Codestral-22B-v0.1, Hugging Face model card
- sweepai/sweep-next-edit-1.5B, Hugging Face model card
Written by Refusal Rate editors from papers, model cards, official docs and pricing pages. Anything we ran ourselves is labeled as our own test, with the hardware and settings. Our method.