trustgraph/templates/components/trustgraph.jsonnet

186 lines
3.1 KiB
Jsonnet
Raw Normal View History

local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompt-template.jsonnet";
{
"chunk-size":: 250,
"chunk-overlap":: 15,
"embeddings-model":: "all-MiniLM-L6-v2",
"graph-rag-entity-limit":: 50,
"graph-rag-triple-limit":: 30,
"graph-rag-max-subgraph-size":: 3000,
services +: {
"pdf-decoder": base + {
image: images.trustgraph,
command: [
"pdf-decoder",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
chunker: base + {
image: images.trustgraph,
command: [
"chunker-token",
"-p",
url.pulsar,
2024-08-21 17:17:24 +01:00
"--chunk-size",
std.toString($["chunk-size"]),
2024-08-21 17:17:24 +01:00
"--chunk-overlap",
std.toString($["chunk-overlap"]),
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
vectorize: base + {
image: images.trustgraph,
command: [
"embeddings-vectorize",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '1.0',
memory: '512M'
},
reservations: {
cpus: '0.5',
memory: '512M'
}
}
},
},
embeddings: base + {
image: images.trustgraph,
command: [
"embeddings-hf",
"-p",
url.pulsar,
2024-08-21 17:17:24 +01:00
"-m",
$["embeddings-model"],
],
deploy: {
resources: {
limits: {
cpus: '1.0',
memory: '256M'
},
reservations: {
cpus: '0.5',
memory: '256M'
}
}
},
},
"kg-extract-definitions": base + {
image: images.trustgraph,
command: [
"kg-extract-definitions",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"kg-extract-relationships": base + {
image: images.trustgraph,
command: [
"kg-extract-relationships",
"-p",
url.pulsar,
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
"graph-rag": base + {
image: images.trustgraph,
command: [
"graph-rag",
"-p",
url.pulsar,
"--prompt-request-queue",
"non-persistent://tg/request/prompt-rag",
"--prompt-response-queue",
"non-persistent://tg/response/prompt-rag-response",
2024-08-21 17:17:24 +01:00
"--entity-limit",
std.toString($["graph-rag-entity-limit"]),
2024-08-21 17:17:24 +01:00
"--triple-limit",
std.toString($["graph-rag-triple-limit"]),
2024-08-21 17:17:24 +01:00
"--max-subgraph-size",
std.toString($["graph-rag-max-subgraph-size"]),
],
deploy: {
resources: {
limits: {
cpus: '0.5',
memory: '128M'
},
reservations: {
cpus: '0.1',
memory: '128M'
}
}
},
},
}
} + prompts