Skip to content
bbonviPublic

About

LLM-powered inline autocompletion plugin for Neovim

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Complere

LLM-powered inline autocompletion plugin for Neovim. Focuses on ultra-low-latency via persistent Go daemon with connection keep-alive.

Why

Existing AI completion plugins are slow. The bottleneck is often the HTTP client layer. Complere uses a persistent Go daemon that maintains keep-alive connections, eliminating per-request TLS handshake overhead.

Status

Usable for daily driving. Phases 1-4 complete.

  • Ghost text completions with accept (<C-l>) / dismiss (<C-]>)
  • Multiline support with auto-indentation
  • Debounced triggering in insert mode
  • 65% faster HTTP than plenary.curl

Dependencies

  • Go 1.21+ (for daemon build)

Build the HTTP daemon:

./scripts/build-daemon.sh

Binary installs to ~/.local/bin/complere-proxy. Ensure ~/.local/bin is in your PATH.

Usage

require('complere').setup({
  api_key = 'your-openrouter-key',  -- or set OPENROUTER_API_KEY env var
  model = 'google/gemini-2.5-flash',
  debounce_ms = 1000,
})

Commands:

  • :ComplereEnable — start completion engine
  • :ComplereDisable — stop completion engine
  • :ComplereStatus — show current state
  • :ComplereLogs — open debug log (requires debug = true)

Config

{
  endpoint = 'https://openrouter.ai/api/v1/chat/completions',
  api_key = nil,                    -- required
  debounce_ms = 1000,               -- delay before triggering
  min_chars = 0,                    -- min chars before cursor to trigger
  context_lines_before = 50,        -- lines of context
  context_lines_after = 20,
  model = 'google/gemini-2.5-flash',
  max_tokens = 200,
  keymaps = {
    accept = '<C-l>',
    dismiss = '<C-]>',
  },
  debug = false,                    -- enable request/response logging
  disabled_filetypes = {},          -- filetypes to skip (e.g., {'markdown' = true})
  prompt_slots = {                  -- section ordering (see below)
    top = { 'preamble', 'file_info', 'continuation' },
    middle = { 'instructions' },
    bottom = { 'full_buffer' },
  },
}

Prompt sections (assignable to top, middle, bottom slots):

  • preamble — role and output format rules
  • file_info — filename and filetype
  • continuation — last 5 lines before cursor (precise completion point)
  • instructions — completion behavior rules
  • full_buffer — complete file with cursor marker
  • raw:text — custom text (e.g., 'raw:Be concise')

Completions auto-disable in terminal buffers, command-line windows, and floating windows.

Troubleshooting

Daemon state directory: ~/.local/state/complere/

# Check if daemon running
cat ~/.local/state/complere/complere-proxy.pid && kill -0 $(cat ~/.local/state/complere/complere-proxy.pid)

# View daemon logs
tail -f ~/.local/state/complere/complere-proxy.log

# Get daemon metrics
kill -USR1 $(cat ~/.local/state/complere/complere-proxy.pid)

# Restart daemon (auto-respawns on next completion)
kill $(cat ~/.local/state/complere/complere-proxy.pid)

About

LLM-powered inline autocompletion plugin for Neovim

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages