WARNING this is a work in progress. Possibly cursed. Experimental.
Pump up your code! Automatically generate the body of your functions or methods using AI, keeping your signatures and docstrings intact. Built for Neovim and fully async, so your workflow never skips a beat.
screenrecording-2025-12-13_15-39-08.mp4
- Treesitter Powered: Smartly extracts function signature, docstrings, and context.
- Async & Non-blocking: Uses
plenary.curlto fetch completions without freezing the editor. - AI Backend Agnostic: Works with any OpenAI-compatible API (Ollama, LocalAI, etc.).
vim.pack.add({
"https://github.com/nvim-lua/plenary.nvim",
"https://github.com/nvim-treesitter/nvim-treesitter",
"https://github.com/whleucka/bodybuilder.nvim"
})
require("bodybuilder").setup({
model = "gemma3:270m", -- Matches the name from your ollama list (also works with ollama cloud)
keymap = "<leader>ab",
})- Move cursor to any line inside a function definition.
- Press
<leader>ab(or your configured keymap). - Wait for the spinner to finish.
- The body will be replaced with the AI generated code.
Default options:
require("bodybuilder").setup({
url = "http://localhost:11434/api/generate", -- Endpoint (Ollama default)
model = "llama3", -- See https://github.com/ollama/ollama?tab=readme-ov-file#model-library
prompt_template = "...", -- See config.lua for default
keymap = nil, -- Set to string (e.g. '<leader>ab') to auto-register
timeout = 10000, -- Timeout in milliseconds (default: 10000)
})PRs welcome!