feat: added optional docker args for rag service (#1589)

This commit is contained in:
Ellis Rahhal
2025-03-18 04:06:37 +00:00
committed by GitHub
parent 6fc4f16a4e
commit 51eb8fc2d9
2 changed files with 3 additions and 1 deletions

View File

@@ -43,6 +43,7 @@ M._defaults = {
llm_model = "", -- The LLM model to use for RAG service llm_model = "", -- The LLM model to use for RAG service
embed_model = "", -- The embedding model to use for RAG service embed_model = "", -- The embedding model to use for RAG service
endpoint = "https://api.openai.com/v1", -- The API endpoint for RAG service endpoint = "https://api.openai.com/v1", -- The API endpoint for RAG service
docker_extra_args = "", -- Extra arguments to pass to the docker command
}, },
web_search_engine = { web_search_engine = {
provider = "tavily", provider = "tavily",

View File

@@ -74,7 +74,7 @@ function M.launch_rag_service(cb)
M.stop_rag_service() M.stop_rag_service()
end end
local cmd_ = string.format( local cmd_ = string.format(
"docker run -d -p %d:8000 --name %s -v %s:/data -v %s:/host:ro -e ALLOW_RESET=TRUE -e DATA_DIR=/data -e RAG_PROVIDER=%s -e %s_API_KEY=%s -e %s_API_BASE=%s -e RAG_LLM_MODEL=%s -e RAG_EMBED_MODEL=%s %s", "docker run -d -p %d:8000 --name %s -v %s:/data -v %s:/host:ro -e ALLOW_RESET=TRUE -e DATA_DIR=/data -e RAG_PROVIDER=%s -e %s_API_KEY=%s -e %s_API_BASE=%s -e RAG_LLM_MODEL=%s -e RAG_EMBED_MODEL=%s %s %s",
port, port,
container_name, container_name,
data_path, data_path,
@@ -86,6 +86,7 @@ function M.launch_rag_service(cb)
Config.rag_service.endpoint, Config.rag_service.endpoint,
Config.rag_service.llm_model, Config.rag_service.llm_model,
Config.rag_service.embed_model, Config.rag_service.embed_model,
Config.rag_service.docker_extra_args,
image image
) )
vim.fn.jobstart(cmd_, { vim.fn.jobstart(cmd_, {