feat: add config for ollama keep alive (#1858)

This commit is contained in:
Ricardo Maraschini
2025-04-17 04:47:51 +02:00
committed by GitHub
parent 37f4e960ae
commit cff8cbf9c5
3 changed files with 4 additions and 0 deletions

View File

@@ -288,6 +288,7 @@ M._defaults = {
options = {
temperature = 0,
num_ctx = 20480,
keep_alive = "5m",
},
},
---@type AvanteSupportedProvider

View File

@@ -38,6 +38,7 @@ end
---@param prompt_opts AvantePromptOptions
function M:parse_curl_args(prompt_opts)
local provider_conf, request_body = P.parse_config(self)
local keep_alive = provider_conf.keep_alive or "5m"
if not provider_conf.model or provider_conf.model == "" then error("Ollama model must be specified in config") end
if not provider_conf.endpoint then error("Ollama requires endpoint configuration") end
@@ -53,6 +54,7 @@ function M:parse_curl_args(prompt_opts)
messages = self:parse_messages(prompt_opts),
stream = true,
system = prompt_opts.system_prompt,
keep_alive = keep_alive,
}, request_body),
}
end

View File

@@ -206,6 +206,7 @@ vim.g.avante_login = vim.g.avante_login
---@field model? string
---@field local? boolean
---@field proxy? string
---@field keep_alive? string
---@field timeout? integer
---@field allow_insecure? boolean
---@field api_key_name? string