diff --git a/prometheus/prometheus.yml b/prometheus/prometheus.yml index 60a8e488..d1455738 100644 --- a/prometheus/prometheus.yml +++ b/prometheus/prometheus.yml @@ -30,6 +30,7 @@ scrape_configs: - 'kg-extract-topics:8000' - 'kg-extract-relationships:8000' - 'metering:8000' + - 'metering-rag:8000' - 'store-graph-embeddings:8000' - 'store-triples:8000' - 'text-completion:8000' diff --git a/scripts/metering b/scripts/metering old mode 100644 new mode 100755 diff --git a/templates/components/trustgraph.jsonnet b/templates/components/trustgraph.jsonnet index b387f0d3..e178cc27 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/response/text-completion-rag-response", + ]) + .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 diff --git a/tg-launch-azure-cassandra.yaml b/tg-launch-azure-cassandra.yaml index 3969cf0d..53469d07 100644 --- a/tg-launch-azure-cassandra.yaml +++ b/tg-launch-azure-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-azure-neo4j.yaml b/tg-launch-azure-neo4j.yaml index 76206719..889908c0 100644 --- a/tg-launch-azure-neo4j.yaml +++ b/tg-launch-azure-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-bedrock-cassandra.yaml b/tg-launch-bedrock-cassandra.yaml index bf9fcac6..95705407 100644 --- a/tg-launch-bedrock-cassandra.yaml +++ b/tg-launch-bedrock-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-bedrock-neo4j.yaml b/tg-launch-bedrock-neo4j.yaml index 01381794..1a725faa 100644 --- a/tg-launch-bedrock-neo4j.yaml +++ b/tg-launch-bedrock-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-claude-cassandra.yaml b/tg-launch-claude-cassandra.yaml index 1ba47dff..d67fb96b 100644 --- a/tg-launch-claude-cassandra.yaml +++ b/tg-launch-claude-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-claude-neo4j.yaml b/tg-launch-claude-neo4j.yaml index 173f7ec8..4b7652cd 100644 --- a/tg-launch-claude-neo4j.yaml +++ b/tg-launch-claude-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-cohere-cassandra.yaml b/tg-launch-cohere-cassandra.yaml index feba0d82..fb4ee290 100644 --- a/tg-launch-cohere-cassandra.yaml +++ b/tg-launch-cohere-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-cohere-neo4j.yaml b/tg-launch-cohere-neo4j.yaml index e82fb8d1..93a274c6 100644 --- a/tg-launch-cohere-neo4j.yaml +++ b/tg-launch-cohere-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-llamafile-cassandra.yaml b/tg-launch-llamafile-cassandra.yaml index 69c4b9c9..dcea893a 100644 --- a/tg-launch-llamafile-cassandra.yaml +++ b/tg-launch-llamafile-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-llamafile-neo4j.yaml b/tg-launch-llamafile-neo4j.yaml index 65175d86..5bbe44e6 100644 --- a/tg-launch-llamafile-neo4j.yaml +++ b/tg-launch-llamafile-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-ollama-cassandra.yaml b/tg-launch-ollama-cassandra.yaml index 2446a273..0fc5bac4 100644 --- a/tg-launch-ollama-cassandra.yaml +++ b/tg-launch-ollama-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-ollama-neo4j.yaml b/tg-launch-ollama-neo4j.yaml index b97ad5e5..4d030ba5 100644 --- a/tg-launch-ollama-neo4j.yaml +++ b/tg-launch-ollama-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-openai-cassandra.yaml b/tg-launch-openai-cassandra.yaml index 81b98003..93b6d5fe 100644 --- a/tg-launch-openai-cassandra.yaml +++ b/tg-launch-openai-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-openai-neo4j.yaml b/tg-launch-openai-neo4j.yaml index 8193fc0b..637320f8 100644 --- a/tg-launch-openai-neo4j.yaml +++ b/tg-launch-openai-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: diff --git a/tg-launch-vertexai-cassandra.yaml b/tg-launch-vertexai-cassandra.yaml index e4cbfe70..55f69fe5 100644 --- a/tg-launch-vertexai-cassandra.yaml +++ b/tg-launch-vertexai-cassandra.yaml @@ -177,6 +177,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 pdf-decoder: command: - pdf-decoder diff --git a/tg-launch-vertexai-neo4j.yaml b/tg-launch-vertexai-neo4j.yaml index b3fac0cb..b21ac9c5 100644 --- a/tg-launch-vertexai-neo4j.yaml +++ b/tg-launch-vertexai-neo4j.yaml @@ -160,6 +160,23 @@ services: memory: 128M image: docker.io/trustgraph/trustgraph-flow:0.11.1 restart: on-failure:100 + metering-rag: + command: + - metering + - -p + - pulsar://pulsar:6650 + - -i + - non-persistent://tg/response/text-completion-rag-response + deploy: + resources: + limits: + cpus: '0.5' + memory: 128M + reservations: + cpus: '0.1' + memory: 128M + image: docker.io/trustgraph/trustgraph-flow:0.11.1 + restart: on-failure:100 neo4j: deploy: resources: