llm.nvim
is a Neovim plugin that integrates AI-powered chat functionality directly into your editor. It allows you to interact with large language models like DeepSeek Coder or Claude, enhancing your coding experience with AI assistance.
- AI-powered chat interface within Neovim
- Support for multiple AI models (DeepSeek Coder, Claude)
- Conversation history management
- Customizable system prompts
- Markdown rendering for better readability
demo.mov
- Neovim 0.5+
- nvim-nio
- An API key for OpenRouter
Using lazy.nvim:
{
"skromez/llm.nvim",
dependencies = { "nvim-neotest/nvim-nio" },
config = function()
require("llm").setup({
api_key = "your-openrouter-api-key",
model = "deepseek/deepseek-coder", -- or "anthropic/claude-3-sonnet"
})
end,
}
After installation, you can open the AI chat window with the following command:
:lua require("llm").open_chat()
You might want to map this to a keybinding for easier access:
vim.keymap.set("n", "<leader>ai", require("llm").open_chat, { desc = "Open AI Chat" })
In the chat window:
- Type your message and press
<Enter>
to send it to the AI - Press
<C-q>
to cancel the current response
You can configure the plugin by passing options to the setup
function:
require("llm").setup({
api_key = "your-openrouter-api-key",
model = "deepseek/deepseek-coder",
system_prompt = "Your custom system prompt here",
})
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.