refusal rate
Subscribe

The best local code completion models for tab autocomplete: Qwen2.5-Coder, Qwen3-Coder, StarCoder2, DeepSeek Coder and Codestral, with FIM support and licenses.

[ fig. 01 — best for ]48×5
[ fig. 01 — best for ]16×5

Short answer

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.

Default pick
Qwen2.5-Coder 1.5B base (~1 GB)
Step up
Qwen2.5-Coder 3B or 7B base
Open license, other families
StarCoder2 (Apache 2.0 repo), DeepSeek Coder (own model license)
Avoid for commercial use
Codestral 22B (MNPL)

Key takeaways

  1. 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.
  2. 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.
  3. On Ollama, the untagged qwen2.5-coder:1.5b tag shares its hash with the instruct build. Pull the -base tag for completion.
  4. Codestral 22B documents FIM but ships under the Mistral Non-Production License, so it is a poor fit for commercial local use.
  5. 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.

[ fig. 01 — Fill-in-the-middle flow. Token format from the Qwen2.5-Coder README; behavior from Continue's autocomplete docs. ]
Diagram: the editor sends the code before and after the cursor to a base FIM model, which returns only the missing middle

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.

ModelSizesFIM documentedLicenseContextRuns in
Qwen2.5-Coder0.5B to 32BYes: <|fim_prefix|>, <|fim_suffix|>, <|fim_middle|>Apache 2.0 on the 7B card; check each size32,768 default, 131,072 with YaRNOllama, llama.cpp, Continue, llama.vscode
Qwen3-Coder30B-A3B, 480B-A35B, Next 80BYes: README says FIM is supported in every versionApache 2.0 (30B-A3B)256K (Ollama page)Ollama, llama.cpp (--fim-qwen-30b-default)
StarCoder23B, 7B, 15BTrained with the FIM objective (card gives no token example)BigCode OpenRAIL-M v1 on the 3B card16,384, 4,096 sliding windowOllama, Continue
DeepSeek Coder1B, 5.7B, 6.7B, 33BYes: <|fim▁begin|>, <|fim▁hole|>, <|fim▁end|>MIT for the repo; separate Model License that allows commercial use16KOllama, llama.cpp
Codestral22BYes: tokenizer.encode_fim in mistral_commonMistral Non-Production License (MNPL)32kHugging 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-spec in 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.
[ fig. 02 — Download sizes from the Ollama library; hardware tiers from the llama.vscode README. Fetched Oct 27, 2026. ]
Bar chart: Ollama download size of 1.0 GB for Qwen2.5-Coder 1.5B, 1.9 GB for 3B, 4.7 GB for 7B and 19 GB for Qwen3-Coder 30B-A3B, labelled with the hardware each is recommended for

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.

How 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 autocompleteOptions include debounceDelay and modelTimeout. 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 /infill endpoint takes input_prefix, input_suffix and optional input_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:

bash
ollama pull qwen2.5-coder:1.5b-base

Then 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:

bash
brew install llama.cpp
llama serve --fim-qwen-1.5b-default

The 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.

Sources (11)
  1. Autocomplete, Continue documentation
  2. ggml-org/llama.vscode, GitHub README
  3. llama.cpp server README (/infill endpoint and --fim-qwen presets)
  4. QwenLM/Qwen2.5-Coder, GitHub README (FIM tokens)
  5. Qwen/Qwen2.5-Coder-7B, Hugging Face model card
  6. qwen2.5-coder tags, Ollama library
  7. bigcode/starcoder2-3b, Hugging Face model card
  8. deepseek-ai/DeepSeek-Coder, GitHub README
  9. Codestral announcement, Mistral AI
  10. mistralai/Codestral-22B-v0.1, Hugging Face model card
  11. sweepai/sweep-next-edit-1.5B, Hugging Face model card

Keep reading