llm.nvim  by Kurama622

Neovim plugin for LLM integration, enabling AI tools

created 11 months ago
340 stars

Top 82.2% on sourcepulse

GitHubView on GitHub
Project Summary

This plugin provides free large language model (LLM) support for Neovim, enabling users to interact with various LLMs directly within their editor. It targets developers and power users who want to leverage AI for tasks like code completion, translation, and documentation generation without leaving Neovim. The primary benefit is seamless integration of powerful AI capabilities into the coding workflow.

How It Works

The plugin utilizes a flexible architecture that supports numerous LLM providers and local models through configurable API endpoints and api_type settings. It handles both streaming and non-streaming responses, with customizable handlers for parsing and displaying output. Users can define custom AI "tools" with specific prompts and handlers, allowing for tailored workflows like side-by-side diffs for code optimization or single-round Q&A sessions.

Quick Start & Requirements

  • Installation: Via a Neovim package manager (e.g., lazy.nvim).
  • Dependencies: nvim-lua/plenary.nvim, MunifTanjim/nui.nvim.
  • Prerequisites: curl must be installed. API keys for desired LLM services must be obtained and set as environment variables (e.g., LLM_KEY, ACCOUNT for Cloudflare).
  • Setup: Requires obtaining API keys and configuring environment variables.
  • Docs: Examples

Highlighted Details

  • Supports a wide range of LLMs including ChatGPT, ChatGLM, Kimi, Deepseek, OpenRouter, Cloudflare, and local models via Ollama.
  • Enables creation of custom AI tools with handlers for different output formats (side-by-side, diff, Q&A, flexible).
  • Offers extensive configuration for UI styles, window positioning, and keybindings.
  • Includes features for code explanation, test case generation, and automatic Git commit message generation.

Maintenance & Community

  • The project acknowledges contributions from other Neovim plugins like olimorris/codecompanion.nvim and SmiteshP/nvim-navbuddy.
  • No specific community links (Discord/Slack) or roadmap are immediately apparent in the README.

Licensing & Compatibility

  • The README does not explicitly state a license. Users should verify licensing for commercial use.

Limitations & Caveats

  • Windows users may encounter issues with curl usage and might need custom request formats.
  • Managing multiple API keys requires careful configuration using fetch_key functions and potentially .env files.
  • Some advanced UI features like mini.diff for diff display require additional plugin installations.
Health Check
Last commit

1 week ago

Responsiveness

1 day

Pull Requests (30d)
5
Issues (30d)
2
Star History
63 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.