From db9c41d1c050340da47caa73cafb6499c7e9c951 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Sun, 29 Sep 2024 20:02:01 +0100 Subject: [PATCH] Add metering-rag for RAG token metrics --- templates/components/trustgraph.jsonnet | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/templates/components/trustgraph.jsonnet b/templates/components/trustgraph.jsonnet index b387f0d3..1a342d64 100644 --- a/templates/components/trustgraph.jsonnet +++ b/templates/components/trustgraph.jsonnet @@ -132,5 +132,37 @@ local prompt = import "prompt-template.jsonnet"; }, + "metering-rag" +: { + + create:: function(engine) + + local container = + engine.container("metering-rag") + .with_image(images.trustgraph) + .with_command([ + "metering", + "-p", + url.pulsar, + "-i", + "non-persistent://tg/request/text-completion-rag", + ]) + .with_limits("0.5", "128M") + .with_reservations("0.1", "128M"); + + local containerSet = engine.containers( + "metering-rag", [ container ] + ); + + local service = + engine.internalService(containerSet) + .with_port(8000, 8000, "metrics"); + + engine.resources([ + containerSet, + service, + ]) + + }, + } + prompt