48 lines
1.1 KiB
Lua
48 lines
1.1 KiB
Lua
local bifrost_endpoint = vim.env.BIFROST_COMPLETIONS_URL
|
|
or "https://bifrost.th3r00t.net/v1/completions"
|
|
local key_path = vim.fn.expand("~/.config/bifrost/api-key")
|
|
local key_file = io.open(key_path, "r")
|
|
local bifrost_api_key = key_file and vim.trim(key_file:read("*a")) or nil
|
|
if key_file then
|
|
key_file:close()
|
|
end
|
|
|
|
require("corridor").setup({
|
|
enabled = true,
|
|
provider = "lmstudio", -- OpenAI-compatible completions (Bifrost)
|
|
endpoint = bifrost_endpoint,
|
|
model = vim.env.CORRIDOR_MODEL or "OllamaMSI/qwen2.5-coder:7b",
|
|
api_key = vim.env.BIFROST_API_KEY or bifrost_api_key,
|
|
|
|
debounce_ms = 400,
|
|
max_tokens = 64,
|
|
temperature = 0.1,
|
|
|
|
-- CoC owns <Tab>; keep Corridor's mappings out of its way.
|
|
accept_keymap = "<C-l>",
|
|
dismiss_keymap = "<C-h>",
|
|
|
|
max_context_lines = 256,
|
|
cross_file_context = true,
|
|
max_cross_file_lines = 100,
|
|
max_cross_file_count = 5,
|
|
|
|
exclude_filetypes = {
|
|
"Avante",
|
|
"TelescopePrompt",
|
|
"help",
|
|
"lazy",
|
|
"mason",
|
|
"neo-tree",
|
|
"snacks_picker_input",
|
|
"terminal",
|
|
},
|
|
|
|
-- qwen2.5-coder FIM token order.
|
|
fim = {
|
|
prefix = "<|fim_prefix|>",
|
|
suffix = "<|fim_suffix|>",
|
|
middle = "<|fim_middle|>",
|
|
},
|
|
})
|