2024-08-30 17:47:35 +01:00
|
|
|
local base = import "base/base.jsonnet";
|
|
|
|
|
local images = import "values/images.jsonnet";
|
|
|
|
|
local url = import "values/url.jsonnet";
|
2024-10-15 17:14:20 +01:00
|
|
|
local prompts = import "prompts/mixtral.jsonnet";
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-08-14 20:56:57 +01:00
|
|
|
{
|
2024-09-03 00:09:15 +01:00
|
|
|
|
2025-01-11 11:40:42 +00:00
|
|
|
with:: function(key, value)
|
|
|
|
|
self + {
|
|
|
|
|
["ollama-" + key]:: value,
|
|
|
|
|
},
|
|
|
|
|
|
2024-09-03 00:09:15 +01:00
|
|
|
"ollama-model":: "gemma2:9b",
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
"text-completion" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
2024-10-15 00:34:52 +01:00
|
|
|
local envSecrets = engine.envSecrets("ollama-credentials")
|
|
|
|
|
.with_env_var("OLLAMA_HOST", "ollama-host");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local container =
|
|
|
|
|
engine.container("text-completion")
|
2025-01-28 19:36:05 +00:00
|
|
|
.with_image(images.trustgraph_flow)
|
2024-09-05 16:40:47 +01:00
|
|
|
.with_command([
|
|
|
|
|
"text-completion-ollama",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"-m",
|
|
|
|
|
$["ollama-model"],
|
|
|
|
|
])
|
2024-10-15 00:34:52 +01:00
|
|
|
.with_env_var_secrets(envSecrets)
|
2024-09-05 16:40:47 +01:00
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
2024-10-15 00:34:52 +01:00
|
|
|
"text-completion", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8080, 8080, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
2024-10-15 00:34:52 +01:00
|
|
|
envSecrets,
|
2024-09-05 16:40:47 +01:00
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
2024-10-15 00:34:52 +01:00
|
|
|
},
|
2024-09-05 16:40:47 +01:00
|
|
|
|
2024-08-23 23:34:16 +01:00
|
|
|
} + prompts
|
2024-09-05 16:40:47 +01:00
|
|
|
|