# Repository Briefing: ggml-org/llama.vim
> Source: https://repoforai.com/repo/ggml-org/llama.vim (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/ggml-org/llama.vim
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: Vim Script
- **License**: MIT
- **Engineering Health**: A (87/100 · Maintenance 35/35 · Adoption 15/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v0.1.0 (2026-08-24) — https://github.com/ggml-org/llama.vim/releases
- **Review Snapshot**: 2026-12-02
- **Deployment / Stack Signals**: Local AI, API
- **Momentum**: 2,210 ★ total (+0 24h / +5 7d) · 133 forks
- **Topics**: `copilot`, `developer-tool`, `llama`, `llm`, `vim`, `vim-plugin`
- **When to Use**: Best for: Vim and Neovim users who want inline FIM completion and instruction edits, and can run llama.cpp locally or on a trusted LAN host. Skip if: You need a managed service with no inference operations, an MCP integration, or a native extension for a different editor.

## Overview
```text
### Architecture & 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.
```

## Key Capabilities
```text
- Inference boundary: The Vim Script plugin sends requests to a separate llama.cpp server, with distinct settings for FIM and instruction editing.
- Context assembly: A configurable window around the cursor is supplemented by a ring of chunks from open or edited files and yanked text.
- Suggestion controls: Tab accepts the full suggestion, Shift+Tab accepts the first line, and configurable mappings support manual triggering and word acceptance.
- Instruction editing: The default `<leader>lli` mapping starts an instruction-driven edit, with separate controls to rerun, continue, accept, or cancel.
- Server switching: Named `profiles` let `:LlamaProfile` redirect both editing modes to another llama.cpp server.
- Performance visibility: Inline statistics expose context usage, ring activity, prompt computation, generated tokens, and request latency.
```

## Quick Start / Clone
```bash
brew install llama.cpp
```
