llm.nvim  by Kurama622

Neovim plugin for LLM integration, enabling AI tools

Created 1 year ago
380 stars

Top 75.0% 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

4 days ago

Responsiveness

1 day

Pull Requests (30d)
8
Issues (30d)
4
Star History
33 stars in the last 30 days

Explore Similar Projects

Starred by Chip Huyen Chip Huyen(Author of "AI Engineering", "Designing Machine Learning Systems"), Pietro Schirano Pietro Schirano(Founder of MagicPath), and
1 more.

SillyTavern by SillyTavern

1.1%
18k
LLM frontend for power users
Created 2 years ago
Updated 1 day ago
Feedback? Help us improve.