feat: add config for ollama keep alive (#1858)
This commit is contained in:
committed by
GitHub
parent
37f4e960ae
commit
cff8cbf9c5
@@ -288,6 +288,7 @@ M._defaults = {
|
|||||||
options = {
|
options = {
|
||||||
temperature = 0,
|
temperature = 0,
|
||||||
num_ctx = 20480,
|
num_ctx = 20480,
|
||||||
|
keep_alive = "5m",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
---@type AvanteSupportedProvider
|
---@type AvanteSupportedProvider
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ end
|
|||||||
---@param prompt_opts AvantePromptOptions
|
---@param prompt_opts AvantePromptOptions
|
||||||
function M:parse_curl_args(prompt_opts)
|
function M:parse_curl_args(prompt_opts)
|
||||||
local provider_conf, request_body = P.parse_config(self)
|
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.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
|
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),
|
messages = self:parse_messages(prompt_opts),
|
||||||
stream = true,
|
stream = true,
|
||||||
system = prompt_opts.system_prompt,
|
system = prompt_opts.system_prompt,
|
||||||
|
keep_alive = keep_alive,
|
||||||
}, request_body),
|
}, request_body),
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ vim.g.avante_login = vim.g.avante_login
|
|||||||
---@field model? string
|
---@field model? string
|
||||||
---@field local? boolean
|
---@field local? boolean
|
||||||
---@field proxy? string
|
---@field proxy? string
|
||||||
|
---@field keep_alive? string
|
||||||
---@field timeout? integer
|
---@field timeout? integer
|
||||||
---@field allow_insecure? boolean
|
---@field allow_insecure? boolean
|
||||||
---@field api_key_name? string
|
---@field api_key_name? string
|
||||||
|
|||||||
Reference in New Issue
Block a user