ggml-org/llama.vim
Vim plugin for local code completion and instruction edits via llama.cpp
Automated SPDX check for reference only — not legal advice. Disclaimer
GitHub Star History
Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.
Evidence-Backed Technical Brief
AI Deep ReviewArchitecture & Core Mechanics
llama.vim is a Vim Script client for classic Vim and Neovim; model inference runs in a separate llama.cpp server. In Insert mode, cursor movement can trigger fill-in-the-middle (FIM) completion. The plugin gathers context around the cursor, supplements it with a ring of chunks from open or edited files and yanked text, and presents the generated text as an inline suggestion that the user can accept in whole or in part.
The repository separates plugin/, autoload/, and doc/; autoload/llama.vim contains the endpoint settings. g:llama_config exposes separate endpoints for FIM and instruction-driven edits, while named server profiles provide a single switch for both request paths. The integration is an editor client talking to a llama.cpp API over HTTP, not an MCP server or an inference runtime embedded in Vim.
Key Capabilities & Differentiators
The completion workflow fits edits inside existing text rather than just appending at the cursor. Tab accepts the full suggestion, Shift+Tab takes the first line, and configurable mappings support manual triggering and word acceptance. You can disable automatic FIM, adjust the scope around the cursor, and set a maximum generation time. Instruction editing has its own trigger and mappings to rerun, continue, accept, or cancel the edit.
FIM needs a compatible model. The supplied llama-server presets cover Qwen FIM sizes from 1.5B to 30B, and the examples include Qwen2.5-Coder 1.5B Q80 and 7B Q80. In one M1 Pro run, a request used 15,186 context tokens out of 32,768, computed 260 new prompt tokens, and generated 24 tokens in 1,245 ms. The example shows why context reuse and inline counters are useful: a large active context need not be recomputed for every request, but that does not make end-to-end completion instantaneous.
Trade-offs & Limitations
Compared with a hosted copilot, llama.vim gives the operator control over where inference runs, which compatible model it uses, and how much context the editor supplies. In return, you manage the server and model and tune for interactive latency. The generation limit is one control, not a guarantee of end-to-end responsiveness: model size, quantization, context reuse, and the location of the inference host all matter. For VS Code, the same organization offers the separate llama.vscode integration.
The context ring can make cross-file completions more relevant, but it also widens the data sent beyond the active buffer. When using a LAN or remote endpoint, check whether open-file fragments and yanked text are allowed to cross that boundary. Tab mappings may also need adjustment if another completion plugin uses them. MIT covers the editor plugin; review the server and model terms separately for commercial deployment.
Hardware & Deployment Guide
Install the plugin through vim-plug or Vundle, or use lazy.nvim for Neovim. Run llama.cpp separately: Homebrew and winget are installation options on macOS and Windows, respectively; prebuilt binaries or a source build are other paths. Start llama-server with a FIM preset such as --fim-qwen-1.5b-default or --fim-qwen-7b-default, point the plugin at the appropriate endpoints, and use :help llama for editor-side configuration.
The deployment choice is where inference runs: on the editing machine or on a reachable host, as illustrated by the named LAN profiles. Local completion does not require a cloud inference service once the server and model are available locally. The VRAM-based preset recommendations are useful starting points, but test the chosen model and context on the actual host. v0.1.0 is the first tagged release shown, with no previous release tag listed for comparison.
<leader>lli mapping starts an instruction-driven edit, with separate controls to rerun, continue, accept, or cancel.profiles let :LlamaProfile redirect both editing modes to another llama.cpp server.Vim and Neovim users who want inline FIM completion and instruction edits, and can run llama.cpp locally or on a trusted LAN host.
You need a managed service with no inference operations, an MCP integration, or a native extension for a different editor.
Quick Start & Installation
brew install llama.cpp
AI Context Briefing (for Claude / Cursor / Windsurf)
Standardized architecture summary & quickstart commands ready to paste into coding agents.
curl -sL https://repoforai.com/repo/ggml-org/llama.vim.md
Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).
Frequently Asked Questions about llama.vim
How does the editor connect to the model, and can I switch servers without restarting?
g:llama_config.endpoint_fim for completion and/or g:llama_config.endpoint_inst for instruction editing. FIM requires a compatible model. If you define named server profiles, :LlamaProfile <name> switches both request types to the selected server.How much VRAM do I need, and where does the runtime overhead sit?
Can a company self-host this plugin for proprietary code?
How does it compare with a hosted copilot or the ggml-org VS Code extension?
ggml-org/llama.vscode; llama.vim is not the VS Code integration.Upstream README & Documentation
This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.
Top 10 Breakout Open-Source AI Repos, Every Thursday
Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.
Zero spam · 1-click unsubscribe · Privacy Policy