trustgraph/templates/components/ollama.jsonnet
cybermaggedon 06a9e913dc
Enable model overrides, added a null option in config-loader (#45)
Enable model overrides, added a null option in config-loader
2024-08-30 21:33:03 +01:00

64 lines
1.2 KiB
Jsonnet

local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompts/slm.jsonnet";
{
services +: {
"ollama-model":: "gemma2:9b",
"text-completion": base + {
image: images.trustgraph,
command: [
"text-completion-ollama",
"-p",
url.pulsar,
"-m",
$["ollama-model"],
"-r",
"${OLLAMA_HOST}",
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"text-completion-rag": base + {
image: images.trustgraph,
command: [
"text-completion-ollama",
"-p",
url.pulsar,
"-m",
$["ollama-model"],
"-r",
"${OLLAMA_HOST}",
"-i",
"non-persistent://tg/request/text-completion-rag",
"-o",
"non-persistent://tg/response/text-completion-rag-response",
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
},
} + prompts