★ Reading this for free? Get 20 structured AI courses + per-chapter AI tutor — the first chapter of every course free, no card.Start free in 30 seconds
Coding Tools

Best Local Models for Tab Autocomplete: FIM Models Compared

September 6, 2026
13 min read
LocalAimaster Research Team

Want to go deeper than this article?

Free account unlocks the first chapter of all 25 courses — RAG, agents, MCP, voice AI, MLOps, real GitHub repos.

📚AI Learning Path

Go from reading about AI to building with AI 20 structured courses. Hands-on projects. Runs on your machine. Start free.

Start free
Or own it for life — Lifetime $149, pay once

Qwen2.5-Coder 1.5B base is the best local tab-autocomplete model for most machines: a 986MB download, Apache 2.0, FIM-trained, and small enough that it clears autocomplete's sub-500ms latency budget on hardware as modest as a CPU-only laptop. Have 12GB+ of VRAM or a 32GB Mac? Run the 7B (4.7GB, also Apache 2.0). Codestral 22B is the open-weights quality ceiling, but its non-production license and 13GB size make it a niche pick, not a default.

Autocomplete is its own discipline, and it is the opposite of the "biggest model wins" logic that rules chat coding. A tab suggestion that arrives in two seconds is worthless no matter how smart it is — you already typed the line. So the models that matter here are small, FIM-trained (fill-in-the-middle), and fast enough to keep up with your pauses. This page covers which models actually support FIM as of August 2026, how to work out from a model's size whether it can possibly hit that latency budget, and the exact setup for the four clients that still do local autocomplete well: llama.vscode, Continue, Zed, and Tabby.


Why Autocomplete Needs FIM Models, Not Chat Models

Tab autocomplete requires a model trained on fill-in-the-middle: it sees the code before your cursor and the code after it, and predicts only the missing middle. A chat model given the same job will happily rewrite your whole file, wrap everything in markdown fences, or explain what it is about to do. Continue's documentation is blunt about this: an autocomplete model is "an LLM trained on a special format called fill-in-the-middle (FIM)," while chat models, "though larger, will often perform poorly even with extensive prompting." Size is not the lever here — Continue's own docs note that "a 3B parameter model can perform well" at this job.

The FIM format itself is three special tokens. For the Qwen coder family it looks like this:

<|fim_prefix|>code before cursor<|fim_suffix|>code after cursor<|fim_middle|>

The model generates whatever belongs at the cursor and stops. StarCoder2 uses the same idea with its own tokens (&lt;fim_prefix&gt;, &lt;fim_suffix&gt;, &lt;fim_middle&gt;), and Codestral has FIM built into its serving stack. Your editor plugin assembles this prompt on every keystroke pause — which is why prompt-processing speed matters as much as generation speed.

One more thing worth knowing before you shop: GitHub Copilot cannot do this locally. VS Code's own docs, as of August 2026: "Currently, you cannot connect to a local model for inline suggestions." Bring-your-own-key — including Ollama — covers chat only; completions stay on GitHub's hosted models. That single sentence is why every tool in this guide exists.

Two practical rules fall out of all this:

  • Always pull the -base tag (qwen2.5-coder:1.5b-base, not qwen2.5-coder:1.5b). Instruct builds are tuned for conversation and degrade FIM output.
  • Latency beats IQ. A small model that answers inside your typing pause gets accepted more often than a large one that answers after it, because you are still looking at the line when the suggestion appears.

Reading articles is good. Building is better.

Free account = the first chapter of all 25 courses, with a per-chapter AI tutor. No card.

The Short List: Every Local Model Worth Considering

Seven models genuinely support FIM and are worth your disk space; for almost every setup the answer is one of the two Apache-licensed Qwen2.5-Coder builds, the 1.5B or the 7B. Download sizes are Ollama's q4 builds; licenses and context are from the official model cards (checked August 2026).

ModelParamsDownloadContextLicenseWhen to pick it
Qwen2.5-Coder 0.5B0.49B398MB32KApache 2.0Weak laptops; last resort
Qwen2.5-Coder 1.5B1.54B986MB32KApache 2.0The default pick
Qwen2.5-Coder 3B3.09B1.9GB32K⚠️ Qwen Research (non-commercial)Quality bump — read the license note
Qwen2.5-Coder 7B7.61B4.7GB32K (128K via YaRN)Apache 2.0Best quality/latency mix with 12GB+ VRAM
StarCoder2-3B3B1.7GB16K (4K sliding window)BigCode OpenRAIL-MIn Tabby's model registry
Codestral 22B22B13GB32K⚠️ MNPL (non-production)Quality ceiling; 16GB+ VRAM
Qwen3-Coder 30B-A3B30B (3.3B active)19GB256KApache 2.0You already run it for agents

Sources: Ollama model library for sizes; Hugging Face model cards for parameters, context, and licenses.

Notice what is not here: no 14B+, no chat models, no reasoning models. Chat-style coding — where the strongest model that fits your card does win — is a different list, and it lives in the related posts below. Autocomplete rewards the small end of the family.


How Fast Is Fast Enough?

A suggestion is useful only if it lands inside your typing pause — roughly 300-500ms end to end. You can work out whether a model can possibly hit that before you download it, using two multiplications and one published spec. No benchmark required, and unlike a benchmark, the arithmetic transfers to whatever hardware you actually own.

Step 1: how much memory do the weights occupy? At q4 quantization, weights take roughly 0.6 GB per billion parameters. That rule reproduces the published Ollama download sizes closely enough to trust it: 1.54B × 0.6 = 0.92 GB against a listed 986MB, 3.09B × 0.6 = 1.85 GB against 1.9GB, 7.61B × 0.6 = 4.57 GB against 4.7GB.

Step 2: what is the generation ceiling? Producing each token requires reading every weight out of memory once, so:

tokens/second ceiling = memory bandwidth (GB/s) / model size in memory (GB)

Memory bandwidth is a published number on every GPU and memory datasheet. Divide, and you get an upper bound on generation speed:

Model (q4)Size~90 GB/s (CPU, dual-channel DDR5)~270 GB/s (laptop unified memory)~1,000 GB/s (RTX 4090 class)
Qwen2.5-Coder 1.5B0.99 GB~91 tok/s~273 tok/s~1,010 tok/s
Qwen2.5-Coder 3B1.9 GB~47 tok/s~142 tok/s~526 tok/s
Qwen2.5-Coder 7B4.7 GB~19 tok/s~57 tok/s~213 tok/s
Codestral 22B13 GB~7 tok/s~21 tok/s~77 tok/s

Step 3: turn that into a suggestion. A typical single-line-to-short-block completion is around 18 tokens, so divide 18 by the ceiling:

Model (q4)CPU (~90 GB/s)Laptop unified (~270 GB/s)RTX 4090 class
1.5B~0.20 s~0.07 s~0.02 s
3B~0.38 s~0.13 s~0.03 s
7B~0.95 s~0.32 s~0.08 s
22B~2.6 s~0.87 s~0.23 s

Read every one of those as an arithmetic upper bound — attention overhead, sampling and prompt processing all pull real output below it, often by a third or more. Which is exactly why the conclusion is robust: halve every number in the table and the 1.5B still lands inside the budget on a CPU, while the 22B still misses it on a laptop. That is the entire case for small models in this category, and it holds without anyone benchmarking anything.

The number the table leaves out is time-to-first-token, which is prompt processing rather than generation and scales with how much context the client sends. This is where client design matters more than model choice: llama.cpp's dedicated /infill endpoint reuses cached context between keystrokes, so typing within one file rarely reprocesses the whole prefix. Long files with a cold cache are where autocomplete visibly stutters.

What about discrete GPUs? The bar is low and well-documented: Tabby's docs say 1-3B completion models are fine on an NVIDIA T4, 10-series, or 20-series GPU (or an Apple M1). These models fit entirely inside even an 8GB card with room to spare. If you are choosing hardware for a coding setup, our 8GB VRAM coding picks cover this tier.


Model Notes: What the Table Doesn't Tell You

Qwen2.5-Coder 1.5B — the default, still

Two years after release, this is still the model that every autocomplete client's documentation points at. Continue's docs recommend it by name for local autocomplete. llama.cpp ships a one-flag preset for it (--fim-qwen-1.5b-default). It is Apache 2.0, 32K context, and small enough to leave resident in memory permanently. Full spec breakdown on our Qwen 2.5 Coder 1.5B page.

Qwen2.5-Coder 3B — the license trap

The 3B is the only Qwen2.5-Coder size that is not Apache 2.0 — it ships under the Qwen Research license, which is non-commercial. The 0.5B, 1.5B, 7B (and up) are all Apache 2.0; the 3B alone is research-only, per its Hugging Face model card. If you write code for a living, skip it: use the 1.5B, or spend the extra 3GB on the 7B and get a better model with a clean license anyway.

Qwen2.5-Coder 7B — the step-up that earns its VRAM

If your machine can hold 4.7GB of weights without evicting anything else, the 7B is the best local autocomplete quality you can get under a permissive license. It is the model Zed's docs use in their example Ollama config (qwen2.5-coder:7b-base), and llama.vscode's tiers recommend it above 16GB VRAM. On a 12-16GB GPU it shares space comfortably with your desktop; pairing it with a bigger chat model is covered in our 16GB VRAM coding guide.

StarCoder2-3B — the veteran

StarCoder2-3B still earns a slot because Tabby's model registry supports it out of the box and its OpenRAIL-M license is commercial-friendly — but it is showing its age. Trained on The Stack v2 (17 languages, 3T+ tokens) with a native FIM objective, it scores 31.7% pass@1 on HumanEval per its model card — well behind current Qwen equivalents — and its 16K context uses a 4K sliding window. Pick it when you are standardizing a team on Tabby and want the battle-tested option; otherwise the Qwen family has passed it.

Codestral 22B — the ceiling, with an asterisk

Codestral 22B is among the strongest open-weights FIM models you can download — Mistral's own comparison table scores it at 82.07% average on HumanEvalFIM — but it is licensed for non-production use only. The MNPL license means testing and research, not your day job, unless you buy a commercial license. Two more caveats: at 13GB it wants a 16GB+ GPU to itself, and the improved Codestral 25.01 (85.9% HumanEvalFIM per Mistral) never shipped as open weights — it is API and IDE-partner only. Run the 22B locally if quality-per-suggestion matters more to you than latency and licensing; our Codestral 22B analysis has the full picture.

Qwen3-Coder and the MoE question

Every version of Qwen3-Coder supports FIM, per Qwen's own repository — but the smallest one is a 19GB download, so treat it as an agent model you can also autocomplete with, not an autocomplete pick. The 30B-A3B MoE activates only 3.3B parameters per token, so once it is loaded it generates fast; if it is already resident for agentic coding, pointing your editor's completion at it costs nothing. Worth noting where the tooling still sits, though: llama.vscode's own preset tiers are all Qwen2.5-Coder FIM builds, so the dedicated-autocomplete ecosystem has not moved to the Qwen3 generation yet.


Own it instead of renting it

Run this on your own machine and stop paying every month

Pay once and keep it. No renewal, no per-token bill, and nothing you feed it ever leaves your hardware.

Editor Setup: The Four Clients That Do Local Autocomplete Right

Fastest path: install llama.cpp, run one preset flag, install the llama.vscode extension — you have local tab completion in under five minutes. Here is each client, in the order we would reach for them.

1. llama.vscode (VS Code) — the purist's pick

Built by the llama.cpp team, MIT-licensed, and the reason llama.cpp's server grew a dedicated /infill endpoint with smart context reuse. Setup:

# macOS (Windows: winget install llama.cpp)
brew install llama.cpp

# pick ONE preset — it downloads the model automatically:
llama serve --fim-qwen-1.5b-default   # less than 8GB VRAM
llama serve --fim-qwen-3b-default     # less than 16GB VRAM
llama serve --fim-qwen-7b-default     # more than 16GB VRAM
llama serve --fim-qwen-30b-default    # more than 64GB VRAM

Then install the llama-vscode extension from the marketplace and it connects to the server on its own. Those tiers are llama.vscode's own recommendations from its README. The presets are all Qwen2.5-Coder FIM builds — the ecosystem's revealed preference, again.

2. Continue (VS Code + JetBrains) — if you already use it for chat

Continue does chat and autocomplete in one extension, both against Ollama. The autocomplete role is one block in config.yaml:

models:
  - name: local-autocomplete
    provider: ollama
    model: qwen2.5-coder:1.5b-base
    roles:
      - autocomplete

Our Continue + Ollama setup guide walks through the full file, including the chat model half.

3. Zed — the nicest tab-completion UX of the group

Zed's edit prediction defaults to its hosted Zeta model (sign-in required, 2,000 free predictions/month), but the docs support pointing it at local Ollama directly:

{
  "edit_predictions": {
    "provider": "ollama",
    "ollama": {
      "api_url": "http://localhost:11434",
      "model": "qwen2.5-coder:7b-base",
      "prompt_format": "infer",
      "max_output_tokens": 512
    }
  }
}

"prompt_format": "infer" auto-detects the FIM token style from the model name — Zed knows the Qwen, StarCoder, CodeLlama, DeepSeek, CodeGemma, and GLM formats. Zed can even run its own Zeta 2 model locally via Ollama ("model": "zeta2").

4. Tabby — the self-hosted server for teams

Tabby runs completions as a server with its own extension ecosystem, which makes it the one to pick when several people share a GPU box. The official Docker one-liner:

docker run -d --name tabby --gpus all -p 8080:8080 \
  -v $HOME/.tabby:/data registry.tabbyml.com/tabbyml/tabby \
  serve --model StarCoder-1B --chat-model Qwen2-1.5B-Instruct --device cuda

Swap --model Qwen2.5-Coder-1.5B (or StarCoder2-3B) in — the registry supports the Qwen2.5-Coder line from 0.5B up to 14B, plus Codestral-22B. Our Tabby self-hosted guide covers accounts, IDE clients, and the repo-indexing features.

A word on Twinny

Twinny was the scrappy free option in this space for years, but the repository was archived on November 24, 2025 and is now read-only. It still installs and still works, but do not build a new setup on an unmaintained extension when llama.vscode and Continue are actively developed.


Honest Limitations

Local autocomplete in 2026 is genuinely good — and still a step behind the hosted state of the art. Know what you are trading.

  • Hosted completion models are better. Copilot's completions, Zed's hosted Zeta, Mercury Coder, and the API-only Codestral 25.01 outrank anything you can download, especially at cross-file, multi-edit prediction. Local FIM is mostly single-file infilling; llama.cpp's /infill endpoint accepts extra context files, but client support varies.
  • Small models produce confident near-misses. At 1.5B-3B the suggestion is usually structurally right and occasionally wrong in a detail — an inverted condition, the wrong field, an off-by-one. You accept-and-fix rather than accept-and-forget. Budget attention accordingly.
  • The first completion after idle stalls. Ollama's default keep_alive unloads an idle model after five minutes, so the first suggestion after a coffee break waits for a reload from disk — roughly model size ÷ storage read speed, so about half a second for the 1.5B on NVMe and several times that on a SATA SSD. Set OLLAMA_KEEP_ALIVE=-1 (or keep_alive per request) if the stall annoys you; the 1.5B only holds ~1GB resident.
  • Laptops pay in battery. Autocomplete fires on nearly every pause. On battery power, expect the fan and the drain; some users keep local autocomplete as a desk-only habit.
  • Wrong tag, worse results. The most common setup mistake is pulling the instruct build instead of -base. If your completions arrive wrapped in prose or markdown fences, this is why.
  • Check the license before work use. Qwen2.5-Coder 3B is research-only and Codestral 22B is non-production. The 0.5B/1.5B/7B Qwen builds and StarCoder2 are the clean choices for commercial work.

Verdict

Run qwen2.5-coder:1.5b-base unless you have a concrete reason not to. Concrete reasons, mapped:

Your machinePickWhy
8GB laptop / old GPUQwen2.5-Coder 0.5B or 1.5B baseFits anywhere; clears the latency budget even CPU-only
16GB Mac or 8-12GB GPUQwen2.5-Coder 1.5B baseLeaves room for your chat model and your actual work
12-16GB+ VRAM or 32GB MacQwen2.5-Coder 7B baseBest quality under Apache 2.0; Zed's own example model
Team GPU boxTabby + Qwen2.5-Coder or StarCoder2-3BOne server, everyone's editor
Quality over everything, non-commercialCodestral 22BTop-tier downloadable FIM weights (82.07% HumanEvalFIM, per Mistral)
Already running Qwen3-Coder 30B for agentsPoint autocomplete at itFIM works in every Qwen3-Coder; zero extra memory

The bigger takeaway: autocomplete is the cheapest place in local AI to get a daily-driver win. You do not need this year's GPU, you do not need a 20GB download, and the best model for the job costs less than a gigabyte. Spend the saved VRAM on a proper chat model — our size-by-size coding guide is the place to pick that one.


Sources


FAQ

🎯
AI Learning Path

Go from reading about AI to building with AI

20 structured courses. Hands-on projects. Runs on your machine. Start free.

Or own it for life — Lifetime $149 $599, pay once

Liked this? 25 full AI courses are waiting.

From fundamentals to RAG, agents, MCP servers, voice AI, and production deployment with real GitHub repos. First chapter free, every course.

Reading now
Join the discussion

LocalAimaster Research Team

Creator of Local AI Master. I've built datasets with over 77,000 examples and trained AI models from scratch. Now I help people achieve AI independence through local AI mastery.

Build Real AI on Your Machine

RAG, agents, NLP, vision, and MLOps - chapters across 25 courses that take you from reading about AI to building AI.

Want structured AI education?

25 courses, 519+ chapters, from $9. Understand AI, don't just use it.

AI Learning Path

Comments (0)

No comments yet. Be the first to share your thoughts!

What is the best local model for tab autocomplete?

Qwen2.5-Coder 1.5B base, for most machines. It is a 986MB download under Apache 2.0, it is FIM-trained, and at roughly 1GB in memory its generation ceiling clears the sub-500ms budget autocomplete needs on almost any hardware, including CPU-only. It is also the model Continue's docs recommend and the model behind llama.cpp's --fim-qwen-1.5b-default preset. If you have 12GB+ of VRAM or a 32GB Mac, step up to the 7B for noticeably better suggestions.

Can GitHub Copilot use a local model for completions?

No. VS Code's own documentation is explicit: "Currently, you cannot connect to a local model for inline suggestions." Bring-your-own-key (including Ollama) applies to the chat experience only — inline code completions still run on GitHub's hosted models. If you want local tab autocomplete you need a different client: llama.vscode, Continue, Zed, or Tabby.

Should I use the base or instruct version for autocomplete?

Base. FIM completion uses the raw fill-in-the-middle format the base models were trained on, so pull qwen2.5-coder:1.5b-base, not qwen2.5-coder:1.5b (which is the instruct build). Zed's docs use qwen2.5-coder:7b-base in their example config for the same reason. Instruct tuning optimizes a model for conversation, and chat models — as Continue's docs put it — "will often perform poorly" at autocomplete.

Does Qwen3-Coder support FIM autocomplete?

Yes — Qwen's repository states FIM is supported in every version of Qwen3-Coder, using the same <|fim_prefix|>/<|fim_suffix|>/<|fim_middle|> token format as Qwen2.5-Coder. The catch is size: the smallest Qwen3-Coder is the 30B-A3B mixture-of-experts at a 19GB download. If you already run it for agentic coding you can point autocomplete at it too, but for a dedicated autocomplete model the small dense Qwen2.5-Coder builds remain the practical choice.

How much VRAM or RAM do I need for local autocomplete?

Very little — this is the one local AI workload where nearly any machine qualifies. The 1.5B model needs about 1-2GB; llama.vscode's own tiers say use the 1.5B preset under 8GB of VRAM, the 3B preset under 16GB, and the 7B above 16GB. Tabby's docs say 1-3B completion models run fine on an NVIDIA T4, 10-series, or 20-series card, or an Apple M1. An 8GB MacBook Air can do usable local autocomplete.

Ready to Go Beyond Tutorials?

20 structured courses with hands-on chapters - build RAG chatbots, AI agents, and ML pipelines on your own hardware.

Bonus kit

Ollama Docker Templates

10 one-command Docker stacks for local models — get your completion server running in minutes. Included with paid plans, or free after subscribing to both Local AI Master and Little AI Master on YouTube.

See Plans →

Was this helpful?

📅 Published: September 6, 2026🔄 Last Updated: September 6, 2026✓ Manually Reviewed
LM

Written by the Local AI Master Team

The team behind Local AI Master

We build Local AI Master around practical, testable local AI workflows: model selection, hardware planning, RAG systems, agents, and MLOps. The goal is to turn scattered tutorials into a structured learning path you can follow on your own hardware.

✓ Local AI Curriculum✓ Hands-On Projects✓ Open Source Contributor
📚
Free · no account required

Grab the AI Starter Kit — career roadmap, cheat sheet, setup guide

No spam. Unsubscribe with one click.

🎯
AI Learning Path

Go from reading about AI to building with AI

20 structured courses. Hands-on projects. Runs on your machine. Start free.

Or own it for life — Lifetime $149 $599, pay once
Free Tools & Calculators