Repolode
ggml-org

ggml-org/llama.vim

Vim plugin that provides local LLM-powered fill-in-the-middle code completion and instruction-based editing via a llama.cpp server.

Open-source alternative to:GitHub Copilot

Stars
2,191
Forks
128
Open issues
28
Last commit
22 days ago

What is it?

llama.vim is a Vim plugin that adds LLM-assisted text completion while you type in Insert mode. It sends the code around the cursor to a llama.cpp server running locally or on another host, and shows the suggestion inline so you can accept it with Tab, or only the first line with Shift+Tab.

Beyond fill-in-the-middle completion, the plugin supports instruction-based editing triggered by a keymap, where you describe a change and the model proposes an edit. It keeps a ring of context chunks drawn from open and edited files and yanked text, and it can display performance stats for each request. Multiple named llama.cpp servers can be defined as profiles and switched at runtime with :LlamaProfile.

The plugin requires a running llama.cpp server and FIM-compatible models. The README recommends Qwen coder models sized to available VRAM, and it is configured through the g:llama_config variable.

Key features

  • 01Auto-suggests completions as the cursor moves in Insert mode
  • 02Accepts a full suggestion with Tab or only the first line with Shift+Tab
  • 03Instruction-based editing triggered by a keymap
  • 04Context ring built from open files, edited files and yanked text
  • 05Named server profiles switchable at runtime
  • 06Displays inline performance stats for each request

Use cases

  • Getting code completions in Vim while keeping source code on local hardware
  • Running a shared llama.cpp server on a LAN and pointing several Vim setups at it
  • Editing code by describing changes in natural language inside Vim

Quick start

  1. 1

    Install the llama.cpp server on macOS with Homebrew

    brew install llama.cpp
  2. 2

    Install the llama.vim plugin with vim-plug

    Plug 'ggml-org/llama.vim'
  3. 3

    Start the llama.cpp server with a model sized for your VRAM (example for 8 to 16GB)

    llama-server --fim-qwen-3b-default

Things to know

  • Requires a running llama.cpp server and FIM-compatible models.
  • Completion quality and speed depend on local hardware, especially GPU VRAM.

Topics

FAQ

What is llama.vim?
Vim plugin that provides local LLM-powered fill-in-the-middle code completion and instruction-based editing via a llama.cpp server. llama.vim is a Vim plugin that adds LLM-assisted text completion while you type in Insert mode. It sends the code around the cursor to a llama.cpp server running locally or on another host, and shows the suggestion inline so you can accept it with Tab, or only the first line with Shift+Tab.
Is llama.vim free to use? What license does it have?
llama.vim is open source under the MIT license. Check the license terms before using it in commercial products.
Is llama.vim still maintained?
Actively maintained. The last commit to llama.vim was on Sep 29, 2026.
What can I use llama.vim for?
Getting code completions in Vim while keeping source code on local hardware Running a shared llama.cpp server on a LAN and pointing several Vim setups at it Editing code by describing changes in natural language inside Vim
How do I install llama.vim?
Install the llama.cpp server on macOS with Homebrew: brew install llama.cpp Install the llama.vim plugin with vim-plug: Plug 'ggml-org/llama.vim' Start the llama.cpp server with a model sized for your VRAM (example for 8 to 16GB): llama-server --fim-qwen-3b-default
Where can I get llama.vim?
The source code and installation instructions are on GitHub: https://github.com/ggml-org/llama.vim

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects