Added Mistral OCR client (#326)

- Added Mistral OCR client
- Template updates for pdf-ocr
- Template updates for pdf-ocr-mistral
This commit is contained in:
cybermaggedon 2025-03-22 00:27:20 +00:00 committed by GitHub
parent fe422b2b95
commit 482592b976
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 299 additions and 0 deletions

View file

@ -37,6 +37,10 @@
"graph-rag": import "components/graph-rag.jsonnet",
"document-rag": import "components/document-rag.jsonnet",
// OCR options
"ocr": import "components/ocr.jsonnet",
"mistral-ocr": import "components/mistral-ocr.jsonnet",
// Librarian - document management
"librarian": import "components/librarian.jsonnet",

View file

@ -0,0 +1,47 @@
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
{
with:: function(key, value)
self + {
["mistral-" + key]:: value,
},
"pdf-decoder" +: {
create:: function(engine)
local envSecrets = engine.envSecrets("mistral-credentials")
.with_env_var("MISTRAL_TOKEN", "mistral-token");
local container =
engine.container("mistral-ocr")
.with_image(images.trustgraph_flow)
.with_command([
"pdf-ocr-mistral",
"-p",
url.pulsar,
])
.with_env_var_secrets(envSecrets)
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"mistral-ocr", [ container ]
);
local service =
engine.internalService(containerSet)
.with_port(8080, 8080, "metrics");
engine.resources([
envSecrets,
containerSet,
service,
])
},
} + prompts

View file

@ -0,0 +1,38 @@
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
{
"pdf-decoder" +: {
create:: function(engine)
local container =
engine.container("pdf-ocr")
.with_image(images.trustgraph_ocr)
.with_command([
"pdf-ocr",
"-p",
url.pulsar,
])
.with_limits("1.0", "512M")
.with_reservations("0.1", "512M");
local containerSet = engine.containers(
"pdf-ocr", [ container ]
);
local service =
engine.internalService(containerSet)
.with_port(8080, 8080, "metrics");
engine.resources([
envSecrets,
containerSet,
service,
])
},
} + prompts

View file

@ -11,6 +11,7 @@ local version = import "version.jsonnet";
grafana: "docker.io/grafana/grafana:11.1.4",
trustgraph_base: "docker.io/trustgraph/trustgraph-base:" + version,
trustgraph_flow: "docker.io/trustgraph/trustgraph-flow:" + version,
trustgraph_ocr: "docker.io/trustgraph/trustgraph-ocr:" + version,
trustgraph_bedrock: "docker.io/trustgraph/trustgraph-bedrock:" + version,
trustgraph_vertexai: "docker.io/trustgraph/trustgraph-vertexai:" + version,
trustgraph_hf: "docker.io/trustgraph/trustgraph-hf:" + version,