diff --git a/dot_config/nvim/lua/plugins/minuet.lua b/dot_config/nvim/lua/plugins/minuet.lua index 5d09dba..4565510 100644 --- a/dot_config/nvim/lua/plugins/minuet.lua +++ b/dot_config/nvim/lua/plugins/minuet.lua @@ -2,34 +2,33 @@ vim.pack.add({ { src = "https://github.com/milanglacier/minuet-ai.nvim" }, }) -local function opencode_go_api_key() - local ok, lines = pcall(vim.fn.readfile, vim.fn.expand("~/.local/share/opencode/auth.json")) - if not ok then - return nil - end - local ok_decode, auth = pcall(vim.fn.json_decode, table.concat(lines, "\n")) - if not ok_decode or not auth["opencode-go"] or not auth["opencode-go"].key then - return nil - end - return auth["opencode-go"].key -end - local function setup_minuet() pcall(require("minuet").setup, { - provider = "openai_compatible", + provider = "openai_fim_compatible", + n_completions = 1, + context_window = 2048, request_timeout = 2.5, - throttle = 1500, - debounce = 600, + throttle = 600, + debounce = 250, provider_options = { - openai_compatible = { - api_key = opencode_go_api_key, - end_point = "https://opencode.ai/zen/go/v1/chat/completions", - model = "deepseek-v4-flash", - name = "Opencode", + openai_fim_compatible = { + api_key = "TERM", + name = "Llama.cpp", + end_point = "http://localhost:8012/v1/completions", + model = "PLACEHOLDER", optional = { max_tokens = 56, top_p = 0.9, - thinking = { type = "disabled" }, + }, + template = { + prompt = function(context_before_cursor, context_after_cursor, _) + return "<|fim_prefix|>" + .. context_before_cursor + .. "<|fim_suffix|>" + .. context_after_cursor + .. "<|fim_middle|>" + end, + suffix = false, }, }, },