A Neovim plugin that provides intelligent code completion and predicts future code changes using a local LLM served over Ollama.
- Neovim 0.8.0+
- Local chat-capable LLM: The plugin expects a model served by Ollama's chat endpoint by default (
http://localhost:11434/api/chat)
Using lazy.nvim
{
"Axot017/fateweaver.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("fateweaver").setup({
-- Configuration options (see below)
})
end,
}Using packer.nvim
use {
"Axot017/fateweaver.nvim",
requires = { "nvim-lua/plenary.nvim" },
config = function()
require("fateweaver").setup()
end
}require("fateweaver").setup({
-- Logging configuration
log_level = "ERROR", -- "ERROR", "WARN", "INFO", "DEBUG"
logger_fn = vim.notify,
-- Context and tracking options
context_opts = {
max_tracked_buffers = 5, -- Maximum number of buffers for which plugin will store changes history
max_history_per_buffer = 3, -- Maximum number of recent changes to keep in history per buffer
context_before_cursor = 80, -- Number of lines before cursor to include as context for the LLM
context_after_cursor = 80, -- Number of lines after cursor to include as context for the LLM
},
-- Model configuration
completion_endpoint = "http://localhost:11434/api/chat",
model_name = "hf.co/Axottee/fateweaver-30B-A3B-GGUF:Q4_K_M",
-- Performance options
debounce_ms = 1000, -- Debounce time for completion requests
})-- Request completion for current buffer
require("fateweaver").request_completion()
-- Accept the current completion suggestion
require("fateweaver").accept_completion()
-- Dismiss the current completion
require("fateweaver").dismiss_completion()-- Add these to your Neovim configuration
vim.keymap.set("n", "<leader>fc", require("fateweaver").request_completion, { desc = "Request completion" })
vim.keymap.set("i", "<C-y>", require("fateweaver").accept_completion, { desc = "Accept completion" })
vim.keymap.set("i", "<C-x>", require("fateweaver").dismiss_completion, { desc = "Dismiss completion" })The plugin now sends requests in chat format so they match Fateweaver-style training data:
system:You are a code completion assistant...user:### Recent Edits:+ diff +### Code Excerpt:+ fenced code excerpt
By default it uses Ollama's native chat endpoint, but OpenAI-compatible chat endpoints should also work.
- Install Ollama: Follow the Ollama installation guide
- Download your model:
Replace this with your own trained model tag if needed.
ollama pull hf.co/Axottee/fateweaver-30B-A3B-GGUF:Q4_K_M
- Start Ollama server:
ollama serve
The plugin will automatically connect to the Ollama chat endpoint at http://localhost:11434/api/chat.
You can also use other inference engines that provide chat-compatible APIs:
- llama.cpp
- vLLM
- llamafile
- Any other OpenAI-compatible server
Simply update the completion_endpoint in your configuration to point to your chosen inference server. For OpenAI-compatible servers, use a chat endpoint such as /v1/chat/completions.
You can launch Neovim with your usual config and this local plugin repo injected on top with:
mise run testThis runs the task file:
.mise/tasks/testThis script:
- prepends the current repo to
runtimepathafter your normal config loads - keeps your normal Neovim config enabled
- calls
require("fateweaver").setup()automatically if the plugin was not already loaded by your config - sets
log_level = "DEBUG" - logs via
require("fateweaver.logger").file_logger(...) - uses
FATEWEAVER_COMPLETION_URLfor the completion endpoint from.mise/config.toml - uses
FATEWEAVER_LOG_FILEfrom.mise/config.tomlfor file logging - adds an insert-mode
<C-y>mapping that callsrequire("fateweaver").accept_completion()
Adjust .mise/config.toml to match your local environment before running the task.
Note: your regular config still needs nvim-lua/plenary.nvim available, since Fateweaver depends on plenary.curl.
Useful variants:
# Start via mise
mise run test
# Open a specific file
mise run test lua/fateweaver/init.lua
# Override the completion endpoint for one run
FATEWEAVER_COMPLETION_URL=http://localhost:11434/api/chat mise run test
# Override the log file path for one run
FATEWEAVER_LOG_FILE=/tmp/fateweaver.log mise run test
# Keep your normal config, but skip the automatic setup() call
FATEWEAVER_SKIP_SETUP=1 mise run test
# Run the task file directly if you want
./.mise/tasks/test lua/fateweaver/init.luaWhen launched this way, <C-y> in insert mode accepts the current Fateweaver completion.
This project is in early development. Contributions, issues, and feature requests are welcome!
MIT License - see the LICENSE file for details.
- Local open-weight code models and the Ollama ecosystem
- Cursor for inspiration on AI-powered code editing