model.nvim  by gsuuon

Neovim plugin for interacting with LLMs and building editor-integrated prompts

created 2 years ago
382 stars

Top 75.9% on sourcepulse

GitHubView on GitHub
Project Summary

model.nvim provides Neovim integration for Large Language Models (LLMs), enabling completions and chat directly within the editor. It targets users who want to customize prompts, experiment with various LLM providers, or utilize local models, offering programmatic prompt building and streaming responses.

How It Works

The plugin is provider-agnostic, supporting OpenAI, Google PaLM, Together, Hugging Face, Llama.cpp, and Ollama, with an easy interface for adding custom providers. Prompts are defined in Lua, allowing for programmatic customization, asynchronous execution, and multi-step workflows. Responses can be streamed directly into the buffer, appended, replaced, or inserted, with features like chat in a dedicated mchat filetype buffer.

Quick Start & Requirements

  • Install via lazy.nvim (example provided in README).
  • Requires Neovim 0.9.0 or higher and curl.
  • Treesitter highlighting for mchat buffers requires :TSInstall mchat.

Highlighted Details

  • Provider-agnostic design with built-in support for multiple LLM services and local models.
  • Programmatic prompt construction in Lua with support for async and multi-step prompts.
  • Streaming completions directly into the Neovim buffer with various insertion modes.
  • Dedicated mchat filetype for multi-turn conversations, with support for saving and resuming chats.
  • Integration with Telescope for browsing mchat buffers.
  • Basic local vector store for retrieval-augmented generation.

Maintenance & Community

  • Active development by gsuuon.
  • Community discussions available for questions and contributions.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial and closed-source projects.

Limitations & Caveats

  • Local vector store functionality is marked as Work In Progress (WIP).
  • Some advanced features like enhanced context using Treesitter and LSP are planned for the roadmap but not yet implemented.
Health Check
Last commit

1 week ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.