Bropilot is a GitHub Copilot alternative that takes advantage of local LLMs through Ollama's API.
Current working models:
- codellama (7b & 13b)
- codegemma (2b & 7b)
- starcoder2 (3b & 7b)
You need to have Ollama installed and running for bro to work. Official download link
For Linux:
curl -fsSL https://ollama.com/install.sh | sh
# And check that the service is running
systemctl status ollama
Here is the default configuration.
model
is a string (e.g. "codellama:7b-code" or "codegemma:2b-code")prompt
is an object defining the prefix, suffix and middle keywords for FIMdebounce
is a number in millisecondsauto_pull
is a boolean that allows bro to pull the model if not listed in ollama api
require('bropilot').setup({
model = "codegemma:2b-code",
prompt = { -- FIM prompt for codegemma
prefix = "<|fim_prefix|>",
suffix = "<|fim_suffix|>",
middle = "<|fim_middle|>",
},
debounce = 1000,
auto_pull = true,
})
Install and configure using lazy.nvim
{
'meeehdi-dev/bropilot.nvim',
event = "VeryLazy", -- preload model on start
dependencies = {
"nvim-lua/plenary.nvim",
"j-hui/fidget.nvim", -- optional
},
config = true, -- setup with default options
keys = {
{
"<Tab>",
function()
require("bropilot").accept_block()
end,
mode = "i",
},
},
}
-- or
{
'meeehdi-dev/bropilot.nvim',
event = "VeryLazy", -- preload model on start
dependencies = {
"nvim-lua/plenary.nvim",
-- "j-hui/fidget.nvim", -- optional
},
opts = {
model = "starcoder2:3b",
prompt = { -- FIM prompt for starcoder2
prefix = "<fim_prefix>",
suffix = "<fim_suffix>",
middle = "<fim_middle>",
},
debounce = 500,
auto_pull = false,
},
config = function (_, opts)
require("bropilot").setup(opts)
end,
keys = {
-- Soon
{
"<C-Right>",
function()
require("bropilot").accept_word()
end,
mode = "i",
},
{
"<M-Right>",
function()
require("bropilot").accept_line()
end,
mode = "i",
},
{
"<Tab>",
function()
require("bropilot").accept_block()
end,
mode = "i",
},
},
}
Roadmap available at ROADMAP.md