If you've used GitHub Copilot, you'll know the grey "ghost text" that appears as you type and drops in with a press of Tab. You can get the same kind of fill-in-the-middle (FIM) autocomplete from a model running on your own graphics card with llama.vscode, a free extension from ggml-org, the team behind llama.cpp. With a local model your code stays on your own PC, and there's no subscription to pay.
vscode, so there are no speed or quality figures here. This guide follows the extension's GitHub README and the llama.cpp server documentation, both read on 3 December 2026, when the newest llama.vscode release was v0.0.80 (30 November 2026).
Why chat models aren't enough
It's worth knowing why you can't just point VS Code at any model. Autocomplete works by sending the code before your cursor (the prefix) and the code after it (the suffix) and asking the model to fill the gap. Models have to be trained for that format. The llama.vscode README says the extension "requires FIM-compatible models", and Continue's autocomplete documentation makes the same point: big chat models such as GPT-5 or Claude aren't trained with this prompt format, so they won't produce useful completions, while most good autocomplete models are no more than 10 billion parameters.
That's good news for your hardware. Code completion needs a small, fast model rather than a huge one. This guide covers the autocomplete side only; if you want to chat with a local model in VS Code's own chat panel, see how to use Ollama in VS Code.
What you need
VS Code on Windows, macOS or Linux. The extension is also on Open VSX for VS Code-based editors that use it.
llama.cpp, which runs the model. The extension can install it for you.
On Windows, winget (Windows Package Manager), which the automatic llama.cpp install uses. On macOS, Homebrew.
A graphics card with enough memory for the model you pick (see the table below). It can run on the CPU alone, but the README warns that quality will be significantly lower.
Step 1: Install the extension
Open the Extensions view in VS Code, search for llama-vscode and install the extension published by ggml-org. Once it's installed, llama-vscode appears in the status bar at the bottom of the window.
Step 2: Install llama.cpp from the extension
Click llama-vscode in the status bar, or press Ctrl+Shift+M, to open the extension's menu, then choose Install/Upgrade llama.cpp. The README says this installs llama.cpp automatically on Windows (through winget) and macOS (through Homebrew). On Linux, download the latest llama.cpp binaries from its GitHub releases page and add the bin folder to your PATH.
If you'd rather do it yourself, the manual commands are winget install llama.cpp on Windows and brew install llama.cpp on macOS. Our guide to running llama.cpp on Windows covers the other install routes.
Step 3: Pick a model size for your graphics memory
The README gives one recommended llama.cpp server setting for each band of graphics memory (VRAM). Each uses a built-in llama.cpp preset that downloads the model for you:
Your VRAM | Recommended command | Model it uses |
|---|
Less than 8GB | llama serve --fim-qwen-1.5b-default
| Qwen 2.5 Coder 1.5B |
Less than 16GB | llama serve --fim-qwen-3b-default
| Qwen 2.5 Coder 3B |
More than 16GB | llama serve --fim-qwen-7b-default
| Qwen 2.5 Coder 7B |
More than 64GB | llama serve --fim-qwen-30b-default
| Qwen 3 Coder 30B A3B Instruct |
The model names come from the llama.cpp server documentation, which also lists two speculative-decoding presets: --fim-qwen-7b-spec and --fim-qwen-14b-spec, which pair Qwen 2.5 Coder 7B or 14B with a small 0.5B draft model. The documentation notes that all of these presets can download weights from the internet, so the first start needs a connection.
So an 8GB card such as the ASUS RTX 5060 8GB Dual OC or a 12GB ASUS RTX 3060 Dual Gaming OC V2 falls in the 3B band, while a 16GB card like the ASUS RTX 5060 Ti 16GB Dual OC sits right on the line between 3B and 7B. Remember that if you also run a chat model or a game at the same time, both have to share that memory. For more on cards for this kind of work, see our best GPUs for local AI coding.
CPU-only
If you don't have a suitable graphics card, the README lists two CPU-only commands using Qwen2.5-Coder 1.5B or 0.5B in Q8_0 format, for example:
llama serve -hf ggml-org/Qwen2.5-Coder-1.5B-Q8_0-GGUF --port 8012 -ub 512 -b 512 --ctx-size 0 --cache-reuse 256
Step 4: Select and start an "env"
You don't have to type the commands above yourself. In the llama-vscode menu choose Select/start env... and pick one of the predefined environments. The extension groups models into "envs" for different jobs: only completion, chat plus completion, chat plus agent and so on. Selecting an env selects all the models in it. For autocomplete alone, pick a completion-only env sized for your VRAM.
The extension can also search and download models from Hugging Face, and you can add, remove, export and import your own completion, chat, embedding and tool models. Any FIM-compatible model will work; ggml-org keeps a Hugging Face collection of recommended ones. Models downloaded with llama.cpp's -hf option are stored in LOCALAPPDATA on Windows, ~/.cache/llama.cpp on Linux and ~/Library/Caches/llama.cpp/ on macOS, which is worth knowing if your system drive is small.
Step 5: Start typing
Open a code file and start typing. Suggestions appear automatically as ghost text. The README lists these shortcuts:
Action | Shortcut |
|---|
Accept the whole suggestion | Tab |
Accept only the first line | Shift+Tab |
Accept the next word | Ctrl+Right Arrow (Cmd+Right Arrow on Mac) |
Show or hide a suggestion manually | Ctrl+L |
If another completion extension such as GitHub Copilot is also switched on, the two can fight over the same ghost text. Continue's documentation gives the same advice for its own autocomplete: disable other completion providers.
How it keeps completions fast
llama.vscode doesn't only send the file you're in. It keeps a "ring" of context made from chunks of files you've opened and edited and text you've copied, so suggestions can draw on nearby code. It also uses llama.cpp's smart context reuse (the README's example commands set --cache-reuse 256), which the README says supports very large contexts even on low-end hardware. You can also cap the maximum generation time and the amount of context around the cursor in the settings, and the extension can show performance stats so you can see how quickly your GPU is responding.
Optional: chat and the Llama Agent
The same extension also does chat and agent-style coding. Press Ctrl+Shift+A or choose Show Llama Agent from the menu, then pick an env that includes an agent model. The README says gpt-oss 20B is the best local choice for now and that the agent can use MCP tools from servers you've installed in VS Code. An agent model needs much more memory than a completion model, so treat this as an extra rather than a reason to install. If you want a fuller agent, see our best local AI coding assistants and best local coding models.
Other ways to get local autocomplete
If you use Vim or Neovim, ggml-org's llama.vim plugin does the same job with the same Tab and Shift+Tab shortcuts (see our best Neovim AI plugins). If you want a server that several people or several editors can share, compare Tabby vs llama.vscode. And if you already use Continue, it has its own autocomplete with Ollama, covered in how to use Continue with Ollama. Our best local code autocomplete tools round-up compares all the main options.