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-09-05 16:40:47 +01:00
|
|
|
local prompt = import "prompt-template.jsonnet";
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
{
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-08-30 17:47:35 +01:00
|
|
|
"chunk-size":: 250,
|
|
|
|
|
"chunk-overlap":: 15,
|
2024-08-13 17:30:59 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
"chunker" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
2024-08-30 17:47:35 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local container =
|
|
|
|
|
engine.container("chunker")
|
|
|
|
|
.with_image(images.trustgraph)
|
|
|
|
|
.with_command([
|
|
|
|
|
"chunker-token",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"--chunk-size",
|
|
|
|
|
std.toString($["chunk-size"]),
|
|
|
|
|
"--chunk-overlap",
|
|
|
|
|
std.toString($["chunk-overlap"]),
|
|
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
2024-08-30 17:47:35 +01:00
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"chunker", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"pdf-decoder" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("pdf-decoder")
|
|
|
|
|
.with_image(images.trustgraph)
|
|
|
|
|
.with_command([
|
|
|
|
|
"pdf-decoder",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
])
|
|
|
|
|
.with_limits("0.5", "128M")
|
|
|
|
|
.with_reservations("0.1", "128M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"pdf-decoder", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"vectorize" +: {
|
|
|
|
|
|
|
|
|
|
create:: function(engine)
|
|
|
|
|
|
|
|
|
|
local container =
|
|
|
|
|
engine.container("vectorize")
|
|
|
|
|
.with_image(images.trustgraph)
|
|
|
|
|
.with_command([
|
|
|
|
|
"embeddings-vectorize",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
])
|
|
|
|
|
.with_limits("1.0", "512M")
|
|
|
|
|
.with_reservations("0.5", "512M");
|
|
|
|
|
|
|
|
|
|
local containerSet = engine.containers(
|
|
|
|
|
"vectorize", [ container ]
|
|
|
|
|
);
|
|
|
|
|
|
2024-09-07 18:59:38 +01:00
|
|
|
local service =
|
|
|
|
|
engine.internalService(containerSet)
|
|
|
|
|
.with_port(8000, 8000, "metrics");
|
|
|
|
|
|
2024-09-05 16:40:47 +01:00
|
|
|
engine.resources([
|
|
|
|
|
containerSet,
|
2024-09-07 18:59:38 +01:00
|
|
|
service,
|
2024-09-05 16:40:47 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
} + prompt
|
2024-08-13 17:30:59 +01:00
|
|
|
|