diff --git a/Makefile b/Makefile index 2d419147..16b0faa7 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # VERSION=$(shell git describe | sed 's/^v//') -VERSION=0.6.8 +VERSION=0.6.9 DOCKER=podman diff --git a/setup.py b/setup.py index be88d7ed..7eb8522e 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ import os with open("README.md", "r") as fh: long_description = fh.read() -version = "0.6.8" +version = "0.6.9" setuptools.setup( name="trustgraph", diff --git a/tg-launch-azure-neo4j.yaml b/tg-launch-azure-neo4j.yaml new file mode 100644 index 00000000..d659bd88 --- /dev/null +++ b/tg-launch-azure-neo4j.yaml @@ -0,0 +1,271 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "2000" + - "--chunk-overlap" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-azure" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${AZURE_TOKEN}" + - "-e" + - "${AZURE_ENDPOINT}" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-azure" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${AZURE_TOKEN}" + - "-e" + - "${AZURE_ENDPOINT}" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-azure.yaml b/tg-launch-azure.yaml similarity index 87% rename from docker-compose-azure.yaml rename to tg-launch-azure.yaml index 9b35a3fc..a91be226 100644 --- a/docker-compose-azure.yaml +++ b/tg-launch-azure.yaml @@ -15,7 +15,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,24 +222,32 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-azure" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${AZURE_TOKEN}" - "-e" - "${AZURE_ENDPOINT}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-azure" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${AZURE_TOKEN}" - "-e" @@ -248,14 +256,14 @@ - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-bedrock-neo4j.yaml b/tg-launch-bedrock-neo4j.yaml new file mode 100644 index 00000000..427090b4 --- /dev/null +++ b/tg-launch-bedrock-neo4j.yaml @@ -0,0 +1,279 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "500" + - "--chunk-overlap" + - "25" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-bedrock" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + # - "-m" + # - "mistral.mixtral-8x7b-instruct-v0:1" + - "-z" + - "${AWS_ID_KEY}" + - "-k" + - "${AWS_SECRET_KEY}" + - "-r" + - "us-west-2" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-bedrock" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + # - "-m" + # - "mistral.mixtral-8x7b-instruct-v0:1" + - "-z" + - "${AWS_ID_KEY}" + - "-k" + - "${AWS_SECRET_KEY}" + - "-r" + - "us-west-2" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-bedrock.yaml b/tg-launch-bedrock.yaml similarity index 86% rename from docker-compose-bedrock.yaml rename to tg-launch-bedrock.yaml index 19ac5741..5ab60f80 100644 --- a/docker-compose-bedrock.yaml +++ b/tg-launch-bedrock.yaml @@ -15,7 +15,7 @@ - "2000" - "--chunk-overlap" - "100" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,6 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +71,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +88,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +133,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +152,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +167,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +194,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +203,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +212,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,26 +221,38 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-bedrock" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + # - "-m" + # - "mistral.mixtral-8x7b-instruct-v0:1" - "-z" - "${AWS_ID_KEY}" - "-k" - "${AWS_SECRET_KEY}" - "-r" - "us-west-2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-bedrock" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-x" + # - "0.0" + # - "-m" + # - "mistral.mixtral-8x7b-instruct-v0:1" - "-z" - "${AWS_ID_KEY}" - "-k" @@ -252,14 +263,14 @@ - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-claude-neo4j.yaml b/tg-launch-claude-neo4j.yaml new file mode 100644 index 00000000..133a0d59 --- /dev/null +++ b/tg-launch-claude-neo4j.yaml @@ -0,0 +1,267 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "2000" + - "--chunk-overlap" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-claude" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${CLAUDE_KEY}" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-claude" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${CLAUDE_KEY}" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-claude.yaml b/tg-launch-claude.yaml similarity index 87% rename from docker-compose-claude.yaml rename to tg-launch-claude.yaml index 2e9b9849..ada74a1c 100644 --- a/docker-compose-claude.yaml +++ b/tg-launch-claude.yaml @@ -15,7 +15,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,36 +222,44 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-claude" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${CLAUDE_KEY}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-claude" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${CLAUDE_KEY}" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-cohere-neo4j.yaml b/tg-launch-cohere-neo4j.yaml new file mode 100644 index 00000000..ee755bec --- /dev/null +++ b/tg-launch-cohere-neo4j.yaml @@ -0,0 +1,267 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "1000" + - "--chunk-overlap" + - "50" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-cohere" + - "-p" + - "pulsar://pulsar:6650" + # - "-l" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${COHERE_KEY}" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-cohere" + - "-p" + - "pulsar://pulsar:6650" + # - "-l" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${COHERE_KEY}" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-cohere.yaml b/tg-launch-cohere.yaml similarity index 87% rename from docker-compose-cohere.yaml rename to tg-launch-cohere.yaml index 3b7fa360..b2c3ec30 100644 --- a/docker-compose-cohere.yaml +++ b/tg-launch-cohere.yaml @@ -15,7 +15,7 @@ - "1000" - "--chunk-overlap" - "50" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,36 +222,40 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" + # - "-t" + # - "0.0" - "-k" - "${COHERE_KEY}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" + # - "-t" + # - "0.0" - "-k" - "${COHERE_KEY}" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-mix-neo4j.yaml b/tg-launch-mix-neo4j.yaml new file mode 100644 index 00000000..c350974b --- /dev/null +++ b/tg-launch-mix-neo4j.yaml @@ -0,0 +1,271 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "2000" + - "--chunk-overlap" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-cohere" + - "-p" + - "pulsar://pulsar:6650" + # - "-l" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${COHERE_KEY}" + - "-m" + - "c4ai-aya-23-35b" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-cohere" + - "-p" + - "pulsar://pulsar:6650" + # - "-l" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "${COHERE_KEY}" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + - "-m" + - "c4ai-aya-23-8b" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-mix.yaml b/tg-launch-mix.yaml similarity index 87% rename from docker-compose-mix.yaml rename to tg-launch-mix.yaml index 09925303..c78e7672 100644 --- a/docker-compose-mix.yaml +++ b/tg-launch-mix.yaml @@ -12,10 +12,10 @@ - "-p" - "pulsar://pulsar:6650" - "--chunk-size" - - "4000" + - "2000" - "--chunk-overlap" - - "120" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,24 +222,32 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${COHERE_KEY}" - "-m" - "c4ai-aya-23-35b" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${COHERE_KEY}" - "-i" @@ -248,14 +256,14 @@ - "non-persistent://tg/response/text-completion-rag-response" - "-m" - "c4ai-aya-23-8b" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-ollama-neo4j.yaml b/tg-launch-ollama-neo4j.yaml new file mode 100644 index 00000000..167bfc26 --- /dev/null +++ b/tg-launch-ollama-neo4j.yaml @@ -0,0 +1,259 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "2000" + - "--chunk-overlap" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-ollama" + - "-p" + - "pulsar://pulsar:6650" + - "-r" + - "${OLLAMA_HOST}" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion-rag": + "command": + - "text-completion-ollama" + - "-p" + - "pulsar://pulsar:6650" + - "-r" + - "${OLLAMA_HOST}" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-ollama.yaml b/tg-launch-ollama.yaml similarity index 87% rename from docker-compose-ollama.yaml rename to tg-launch-ollama.yaml index b75fc44e..8b09e211 100644 --- a/docker-compose-ollama.yaml +++ b/tg-launch-ollama.yaml @@ -15,7 +15,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,7 +222,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": @@ -231,7 +231,9 @@ - "pulsar://pulsar:6650" - "-r" - "${OLLAMA_HOST}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + # - "-m" + # - "phi3.5:latest" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": @@ -240,18 +242,20 @@ - "pulsar://pulsar:6650" - "-r" - "${OLLAMA_HOST}" + # - "-m" + # - "phi3.5:latest" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/docker-compose-openai-neo4j.yaml b/tg-launch-openai-neo4j.yaml similarity index 87% rename from docker-compose-openai-neo4j.yaml rename to tg-launch-openai-neo4j.yaml index 07cff05d..190a20e0 100644 --- a/docker-compose-openai-neo4j.yaml +++ b/tg-launch-openai-neo4j.yaml @@ -8,7 +8,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -17,7 +17,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -65,7 +65,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -82,14 +82,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -137,7 +137,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -156,7 +156,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -171,7 +171,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -198,7 +198,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -207,7 +207,7 @@ - "pulsar://pulsar:6650" - "-g" - "bolt://neo4j:7687" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -216,7 +216,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -225,36 +225,44 @@ - "pulsar://pulsar:6650" - "-g" - "bolt://neo4j:7687" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${OPENAI_KEY}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${OPENAI_KEY}" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "etcd": {} diff --git a/docker-compose-openai.yaml b/tg-launch-openai.yaml similarity index 87% rename from docker-compose-openai.yaml rename to tg-launch-openai.yaml index ab9326fc..4e32bf98 100644 --- a/docker-compose-openai.yaml +++ b/tg-launch-openai.yaml @@ -15,7 +15,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,36 +222,44 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${OPENAI_KEY}" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": "command": - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "${OPENAI_KEY}" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "vectorize": "command": - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/tg-launch-vertexai-neo4j.yaml b/tg-launch-vertexai-neo4j.yaml new file mode 100644 index 00000000..cf99cd27 --- /dev/null +++ b/tg-launch-vertexai-neo4j.yaml @@ -0,0 +1,275 @@ +"services": + "neo4j": + "environment": + "NEO4J_AUTH": "neo4j/password" + "image": "docker.io/neo4j:5.22.0-community-bullseye" + "ports": + - "7474:7474" + - "7687:7687" + "restart": "on-failure:100" + "volumes": + - "neo4j:/data" + "chunker": + "command": + - "chunker-recursive" + - "-p" + - "pulsar://pulsar:6650" + - "--chunk-size" + - "2000" + - "--chunk-overlap" + - "100" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "embeddings": + "command": + - "embeddings-hf" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "etcd": + "command": + - "etcd" + - "-advertise-client-urls=http://127.0.0.1:2379" + - "-listen-client-urls" + - "http://0.0.0.0:2379" + - "--data-dir" + - "/etcd" + "environment": + "ETCD_AUTO_COMPACTION_MODE": "revision" + "ETCD_AUTO_COMPACTION_RETENTION": "1000" + "ETCD_QUOTA_BACKEND_BYTES": "4294967296" + "ETCD_SNAPSHOT_COUNT": "50000" + "image": "quay.io/coreos/etcd:v3.5.5" + "ports": + - "2379:2379" + "restart": "on-failure:100" + "volumes": + - "etcd:/etcd" + "grafana": + "environment": + "GF_ORG_NAME": "trustgraph.ai" + "image": "docker.io/grafana/grafana:10.0.0" + "ports": + - "3000:3000" + "restart": "on-failure:100" + "volumes": + - "grafana-storage:/var/lib/grafana" + - "./grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/dashboard.yml" + - "./grafana/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml" + - "./grafana/dashboard.json:/var/lib/grafana/dashboards/dashboard.json" + "graph-rag": + "command": + - "graph-rag" + - "-p" + - "pulsar://pulsar:6650" + - "--prompt-request-queue" + - "non-persistent://tg/request/prompt-rag" + - "--prompt-response-queue" + - "non-persistent://tg/response/prompt-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "init-pulsar": + "command": + - "sh" + - "-c" + - "pulsar-admin --admin-url http://pulsar:8080 tenants create tg && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/flow && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/request && pulsar-admin --admin-url http://pulsar:8080 namespaces create tg/response && pulsar-admin --admin-url http://pulsar:8080 namespaces set-retention --size -1 --time 3m tg/response" + "depends_on": + "pulsar": + "condition": "service_started" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "restart": "on-failure:100" + "kg-extract-definitions": + "command": + - "kg-extract-definitions" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "kg-extract-relationships": + "command": + - "kg-extract-relationships" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "milvus": + "command": + - "milvus" + - "run" + - "standalone" + "environment": + "ETCD_ENDPOINTS": "etcd:2379" + "MINIO_ADDRESS": "minio:9000" + "image": "docker.io/milvusdb/milvus:v2.4.5" + "ports": + - "9091:9091" + - "19530:19530" + "restart": "on-failure:100" + "volumes": + - "milvus:/var/lib/milvus" + "minio": + "command": + - "minio" + - "server" + - "/minio_data" + - "--console-address" + - ":9001" + "environment": + "MINIO_ROOT_PASSWORD": "minioadmin" + "MINIO_ROOT_USER": "minioadmin" + "image": "docker.io/minio/minio:RELEASE.2024-07-04T14-25-45Z" + "ports": + - "9001:9001" + "restart": "on-failure:100" + "volumes": + - "minio-data:/minio_data" + "pdf-decoder": + "command": + - "pdf-decoder" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prometheus": + "image": "docker.io/prom/prometheus:v2.53.1" + "ports": + - "9090:9090" + "restart": "on-failure:100" + "volumes": + - "./prometheus:/etc/prometheus" + - "prometheus-data:/prometheus" + "prompt": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "prompt-rag": + "command": + - "prompt-generic" + - "-p" + - "pulsar://pulsar:6650" + - "-i" + - "non-persistent://tg/request/prompt-rag" + - "-o" + - "non-persistent://tg/response/prompt-rag-response" + - "--text-completion-request-queue" + - "non-persistent://tg/request/text-completion-rag" + - "--text-completion-response-queue" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "pulsar": + "command": "bin/pulsar standalone" + "image": "docker.io/apachepulsar/pulsar:3.3.0" + "ports": + - "6650:6650" + - "8080:8080" + "restart": "on-failure:100" + "volumes": + - "pulsar-conf:/pulsar/conf" + - "pulsar-data:/pulsar/data" + "pulsar-manager": + "environment": + "SPRING_CONFIGURATION_FILE": "/pulsar-manager/pulsar-manager/application.properties" + "image": "docker.io/apachepulsar/pulsar-manager:v0.3.0" + "ports": + - "9527:9527" + - "7750:7750" + "restart": "on-failure:100" + "query-graph-embeddings": + "command": + - "ge-query-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "query-triples": + "command": + - "triples-query-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-graph-embeddings": + "command": + - "ge-write-milvus" + - "-p" + - "pulsar://pulsar:6650" + - "-t" + - "http://milvus:19530" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "store-triples": + "command": + - "triples-write-neo4j" + - "-p" + - "pulsar://pulsar:6650" + - "-g" + - "bolt://neo4j:7687" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "text-completion": + "command": + - "text-completion-vertexai" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "/vertexai/private.json" + - "-r" + - "us-central1" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "volumes": + - "./vertexai:/vertexai" + "text-completion-rag": + "command": + - "text-completion-vertexai" + - "-p" + - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" + - "-k" + - "/vertexai/private.json" + - "-r" + - "us-central1" + - "-i" + - "non-persistent://tg/request/text-completion-rag" + - "-o" + - "non-persistent://tg/response/text-completion-rag-response" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" + "volumes": + - "./vertexai:/vertexai" + "vectorize": + "command": + - "embeddings-vectorize" + - "-p" + - "pulsar://pulsar:6650" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" + "restart": "on-failure:100" +"volumes": + "neo4j": {} + "etcd": {} + "grafana-storage": {} + "milvus": {} + "minio-data": {} + "prometheus-data": {} + "pulsar-conf": {} + "pulsar-data": {} diff --git a/docker-compose-vertexai.yaml b/tg-launch-vertexai.yaml similarity index 87% rename from docker-compose-vertexai.yaml rename to tg-launch-vertexai.yaml index 551aa830..befd7dcb 100644 --- a/docker-compose-vertexai.yaml +++ b/tg-launch-vertexai.yaml @@ -15,7 +15,7 @@ - "250" - "--chunk-overlap" - "15" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": "command": @@ -24,7 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -72,7 +72,7 @@ - "30" - "--max-subgraph-size" - "3000" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "init-pulsar": "command": @@ -89,14 +89,14 @@ - "kg-extract-definitions" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "kg-extract-relationships": "command": - "kg-extract-relationships" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "milvus": "command": @@ -134,7 +134,7 @@ - "pdf-decoder" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prometheus": "image": "docker.io/prom/prometheus:v2.53.1" @@ -153,7 +153,7 @@ - "non-persistent://tg/request/text-completion" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "prompt-rag": "command": @@ -168,7 +168,7 @@ - "non-persistent://tg/request/text-completion-rag" - "--text-completion-response-queue" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "pulsar": "command": "bin/pulsar standalone" @@ -195,7 +195,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "query-triples": "command": @@ -204,7 +204,7 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-graph-embeddings": "command": @@ -213,7 +213,7 @@ - "pulsar://pulsar:6650" - "-t" - "http://milvus:19530" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "store-triples": "command": @@ -222,18 +222,22 @@ - "pulsar://pulsar:6650" - "-g" - "cassandra" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion": "command": - "text-completion-vertexai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "/vertexai/private.json" - "-r" - - "us-west1" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + - "us-central1" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": - "./vertexai:/vertexai" @@ -242,15 +246,19 @@ - "text-completion-vertexai" - "-p" - "pulsar://pulsar:6650" + # - "-x" + # - "4096" + # - "-t" + # - "0.0" - "-k" - "/vertexai/private.json" - "-r" - - "us-west1" + - "us-central1" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": - "./vertexai:/vertexai" @@ -259,7 +267,7 @@ - "embeddings-vectorize" - "-p" - "pulsar://pulsar:6650" - "image": "docker.io/trustgraph/trustgraph-flow:0.6.8" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": "cassandra": {} diff --git a/trustgraph/model/text_completion/azure/llm.py b/trustgraph/model/text_completion/azure/llm.py index 71338455..38484820 100755 --- a/trustgraph/model/text_completion/azure/llm.py +++ b/trustgraph/model/text_completion/azure/llm.py @@ -19,6 +19,8 @@ module = ".".join(__name__.split(".")[1:-1]) default_input_queue = text_completion_request_queue default_output_queue = text_completion_response_queue default_subscriber = module +default_temperature = 0.0 +default_max_output = 4192 class Processor(ConsumerProducer): @@ -29,6 +31,8 @@ class Processor(ConsumerProducer): subscriber = params.get("subscriber", default_subscriber) endpoint = params.get("endpoint") token = params.get("token") + temperature = params.get("temperature", default_temperature) + max_output = params.get("max_output", default_max_output) super(Processor, self).__init__( **params | { @@ -37,11 +41,15 @@ class Processor(ConsumerProducer): "subscriber": subscriber, "input_schema": TextCompletionRequest, "output_schema": TextCompletionResponse, + "temperature": temperature, + "max_output": max_output, } ) self.endpoint = endpoint self.token = token + self.temperature = temperature + self.max_output = max_output def build_prompt(self, system, content): @@ -54,8 +62,8 @@ class Processor(ConsumerProducer): "role": "user", "content": content } ], - "max_tokens": 4192, - "temperature": 0.2, + "max_tokens": self.max_output, + "temperature": self.temperature, "top_p": 1 } @@ -105,7 +113,11 @@ class Processor(ConsumerProducer): response = self.call_llm(prompt) print("Send response...", flush=True) - r = TextCompletionResponse(response=response) + + resp = response.replace("```json", "") + resp = response.replace("```", "") + + r = TextCompletionResponse(response=resp) self.producer.send(r, properties={"id": id}) print("Done.", flush=True) @@ -128,6 +140,20 @@ class Processor(ConsumerProducer): help=f'LLM model token' ) + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + + parser.add_argument( + '-x', '--max-output', + type=int, + default=default_max_output, + help=f'LLM max output tokens (default: {default_max_output})' + ) + def run(): Processor.start(module, __doc__) diff --git a/trustgraph/model/text_completion/bedrock/llm.py b/trustgraph/model/text_completion/bedrock/llm.py index 11485af0..cd504a16 100755 --- a/trustgraph/model/text_completion/bedrock/llm.py +++ b/trustgraph/model/text_completion/bedrock/llm.py @@ -6,7 +6,6 @@ Input is prompt, output is response. Mistral is default. import boto3 import json -import re from .... schema import TextCompletionRequest, TextCompletionResponse from .... schema import text_completion_request_queue @@ -22,6 +21,9 @@ default_output_queue = text_completion_response_queue default_subscriber = module default_model = 'mistral.mistral-large-2407-v1:0' default_region = 'us-west-2' +default_temperature = 0.0 +default_max_output = 2048 + class Processor(ConsumerProducer): @@ -34,6 +36,8 @@ class Processor(ConsumerProducer): aws_id = params.get("aws_id_key") aws_secret = params.get("aws_secret") aws_region = params.get("aws_region", default_region) + temperature = params.get("temperature", default_temperature) + max_output = params.get("max_output", default_max_output) super(Processor, self).__init__( **params | { @@ -43,10 +47,14 @@ class Processor(ConsumerProducer): "input_schema": TextCompletionRequest, "output_schema": TextCompletionResponse, "model": model, + "temperature": temperature, + "max_output": max_output, } ) self.model = model + self.temperature = temperature + self.max_output = max_output self.session = boto3.Session( aws_access_key_id=aws_id, @@ -74,8 +82,8 @@ class Processor(ConsumerProducer): if self.model.startswith("mistral"): promptbody = json.dumps({ "prompt": prompt, - "max_tokens": 8192, - "temperature": 0.0, + "max_tokens": self.max_output, + "temperature": self.temperature, "top_p": 0.99, "top_k": 40 }) @@ -84,8 +92,8 @@ class Processor(ConsumerProducer): elif self.model.startswith("meta"): promptbody = json.dumps({ "prompt": prompt, - "max_gen_len": 2048, - "temperature": 0.0, + "max_gen_len": self.max_output, + "temperature": self.temperature, "top_p": 0.95, }) @@ -93,8 +101,8 @@ class Processor(ConsumerProducer): elif self.model.startswith("anthropic"): promptbody = json.dumps({ "anthropic_version": "bedrock-2023-05-31", - "max_tokens": 8192, - "temperature": 0, + "max_tokens": self.max_output, + "temperature": self.temperature, "top_p": 0.999, "messages": [ { @@ -113,8 +121,8 @@ class Processor(ConsumerProducer): else: promptbody = json.dumps({ "prompt": prompt, - "max_tokens": 8192, - "temperature": 0.0, + "max_tokens": self.max_output, + "temperature": self.temperature, "top_p": 0.99, "top_k": 40 }) @@ -147,22 +155,12 @@ class Processor(ConsumerProducer): outputtext = response_body['outputs'][0]['text'] print(outputtext, flush=True) - - # Parse output for ```json``` delimiters - pattern = r'```json\s*([\s\S]*?)\s*```' - match = re.search(pattern, outputtext) - if match: - # If delimiters are found, extract the JSON content - json_content = match.group(1) - json_resp = json_content.strip() - - else: - # If no delimiters are found, return the original text - json_resp = outputtext.strip() - + resp = outputtext.replace("```json", "") + resp = outputtext.replace("```", "") + print("Send response...", flush=True) - r = TextCompletionResponse(response=json_resp) + r = TextCompletionResponse(response=resp) self.send(r, properties={"id": id}) print("Done.", flush=True) @@ -196,6 +194,20 @@ class Processor(ConsumerProducer): help=f'AWS Region (default: us-west-2)' ) + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + + parser.add_argument( + '-x', '--max-output', + type=int, + default=default_max_output, + help=f'LLM max output tokens (default: {default_max_output})' + ) + def run(): Processor.start(module, __doc__) diff --git a/trustgraph/model/text_completion/claude/llm.py b/trustgraph/model/text_completion/claude/llm.py index 29e5277d..89c8607d 100755 --- a/trustgraph/model/text_completion/claude/llm.py +++ b/trustgraph/model/text_completion/claude/llm.py @@ -18,6 +18,8 @@ default_input_queue = text_completion_request_queue default_output_queue = text_completion_response_queue default_subscriber = module default_model = 'claude-3-5-sonnet-20240620' +default_temperature = 0.0 +default_max_output = 8192 class Processor(ConsumerProducer): @@ -28,6 +30,8 @@ class Processor(ConsumerProducer): subscriber = params.get("subscriber", default_subscriber) model = params.get("model", default_model) api_key = params.get("api_key") + temperature = params.get("temperature", default_temperature) + max_output = params.get("max_output", default_max_output) super(Processor, self).__init__( **params | { @@ -37,12 +41,15 @@ class Processor(ConsumerProducer): "input_schema": TextCompletionRequest, "output_schema": TextCompletionResponse, "model": model, + "temperature": temperature, + "max_output": max_output, } ) self.model = model - self.claude = anthropic.Anthropic(api_key=api_key) + self.temperature = temperature + self.max_output = max_output print("Initialised", flush=True) @@ -61,8 +68,8 @@ class Processor(ConsumerProducer): # FIXME: Rate limits? response = message = self.claude.messages.create( model=self.model, - max_tokens=1000, - temperature=0.1, + max_tokens=self.max_output, + temperature=self.temperature, system = "You are a helpful chatbot.", messages=[ { @@ -105,6 +112,20 @@ class Processor(ConsumerProducer): help=f'Claude API key' ) + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + + parser.add_argument( + '-x', '--max-output', + type=int, + default=default_max_output, + help=f'LLM max output tokens (default: {default_max_output})' + ) + def run(): Processor.start(module, __doc__) diff --git a/trustgraph/model/text_completion/cohere/llm.py b/trustgraph/model/text_completion/cohere/llm.py index e52c2889..018a272b 100755 --- a/trustgraph/model/text_completion/cohere/llm.py +++ b/trustgraph/model/text_completion/cohere/llm.py @@ -5,7 +5,6 @@ Input is prompt, output is response. """ import cohere -import re from .... schema import TextCompletionRequest, TextCompletionResponse from .... schema import text_completion_request_queue @@ -19,6 +18,7 @@ default_input_queue = text_completion_request_queue default_output_queue = text_completion_response_queue default_subscriber = module default_model = 'c4ai-aya-23-8b' +default_temperature = 0.0 class Processor(ConsumerProducer): @@ -29,6 +29,7 @@ class Processor(ConsumerProducer): subscriber = params.get("subscriber", default_subscriber) model = params.get("model", default_model) api_key = params.get("api_key") + temperature = params.get("temperature", default_temperature) super(Processor, self).__init__( **params | { @@ -38,11 +39,12 @@ class Processor(ConsumerProducer): "input_schema": TextCompletionRequest, "output_schema": TextCompletionResponse, "model": model, + "temperature": temperature, } ) self.model = model - + self.temperature = temperature self.cohere = cohere.Client(api_key=api_key) print("Initialised", flush=True) @@ -64,7 +66,7 @@ class Processor(ConsumerProducer): model=self.model, message=prompt, preamble = "You are a helpful AI-assistant.", - temperature=0.0, + temperature=self.temperature, chat_history=[], prompt_truncation='auto', connectors=[] @@ -73,21 +75,11 @@ class Processor(ConsumerProducer): resp = output.text print(resp, flush=True) - # Parse output for ```json``` delimiters - pattern = r'```json\s*([\s\S]*?)\s*```' - match = re.search(pattern, resp) - - if match: - # If delimiters are found, extract the JSON content - json_content = match.group(1) - json_resp = json_content.strip() - - else: - # If no delimiters are found, return the original text - json_resp = resp.strip() + resp = resp.replace("```json", "") + resp = resp.replace("```", "") print("Send response...", flush=True) - r = TextCompletionResponse(response=json_resp) + r = TextCompletionResponse(response=resp) self.send(r, properties={"id": id}) print("Done.", flush=True) @@ -111,6 +103,13 @@ class Processor(ConsumerProducer): help=f'Cohere API key' ) + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + def run(): Processor.start(module, __doc__) diff --git a/trustgraph/model/text_completion/ollama/llm.py b/trustgraph/model/text_completion/ollama/llm.py index 900140a2..a5b3d873 100755 --- a/trustgraph/model/text_completion/ollama/llm.py +++ b/trustgraph/model/text_completion/ollama/llm.py @@ -71,7 +71,10 @@ class Processor(ConsumerProducer): print("Send response...", flush=True) - r = TextCompletionResponse(response=response) + resp = response.replace("```json", "") + resp = response.replace("```", "") + + r = TextCompletionResponse(response=resp) self.send(r, properties={"id": id}) diff --git a/trustgraph/model/text_completion/openai/llm.py b/trustgraph/model/text_completion/openai/llm.py index 25b84070..aba92e96 100755 --- a/trustgraph/model/text_completion/openai/llm.py +++ b/trustgraph/model/text_completion/openai/llm.py @@ -18,6 +18,8 @@ default_input_queue = text_completion_request_queue default_output_queue = text_completion_response_queue default_subscriber = module default_model = 'gpt-3.5-turbo' +default_temperature = 0.0 +default_max_output = 4096 class Processor(ConsumerProducer): @@ -28,6 +30,8 @@ class Processor(ConsumerProducer): subscriber = params.get("subscriber", default_subscriber) model = params.get("model", default_model) api_key = params.get("api_key") + temperature = params.get("temperature", default_temperature) + max_output = params.get("max_output", default_max_output) super(Processor, self).__init__( **params | { @@ -37,11 +41,14 @@ class Processor(ConsumerProducer): "input_schema": TextCompletionRequest, "output_schema": TextCompletionResponse, "model": model, + "temperature": temperature, + "max_output": max_output, } ) self.model = model - + self.temperature = temperature + self.max_output = max_output self.openai = OpenAI(api_key=api_key) print("Initialised", flush=True) @@ -72,8 +79,8 @@ class Processor(ConsumerProducer): ] } ], - temperature=0, - max_tokens=4096, + temperature=self.temperature, + max_tokens=self.max_output, top_p=1, frequency_penalty=0, presence_penalty=0, @@ -109,6 +116,20 @@ class Processor(ConsumerProducer): help=f'OpenAI API key' ) + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + + parser.add_argument( + '-x', '--max-output', + type=int, + default=default_max_output, + help=f'LLM max output tokens (default: {default_max_output})' + ) + def run(): Processor.start(module, __doc__) diff --git a/trustgraph/model/text_completion/vertexai/llm.py b/trustgraph/model/text_completion/vertexai/llm.py index 3da0c041..f9b2de22 100755 --- a/trustgraph/model/text_completion/vertexai/llm.py +++ b/trustgraph/model/text_completion/vertexai/llm.py @@ -33,6 +33,10 @@ module = ".".join(__name__.split(".")[1:-1]) default_input_queue = text_completion_request_queue default_output_queue = text_completion_response_queue default_subscriber = module +default_model = 'gemini-1.0-pro-001' +default_region = 'us-central1' +default_temperature = 0.0 +default_max_output = 8192 class Processor(ConsumerProducer): @@ -41,9 +45,11 @@ class Processor(ConsumerProducer): input_queue = params.get("input_queue", default_input_queue) output_queue = params.get("output_queue", default_output_queue) subscriber = params.get("subscriber", default_subscriber) - region = params.get("region", "us-west1") - model = params.get("model", "gemini-1.0-pro-001") + region = params.get("region", default_region) + model = params.get("model", default_model) private_key = params.get("private_key") + temperature = params.get("temperature", default_temperature) + max_output = params.get("max_output", default_max_output) super(Processor, self).__init__( **params | { @@ -56,19 +62,19 @@ class Processor(ConsumerProducer): ) self.parameters = { - "temperature": 0.2, + "temperature": temperature, "top_p": 1.0, "top_k": 32, "candidate_count": 1, - "max_output_tokens": 8192, + "max_output_tokens": max_output, } self.generation_config = GenerationConfig( - temperature=0.2, + temperature=temperature, top_p=1.0, top_k=10, candidate_count=1, - max_output_tokens=8191, + max_output_tokens=max_output, ) # Block none doesn't seem to work @@ -155,8 +161,8 @@ class Processor(ConsumerProducer): parser.add_argument( '-m', '--model', - default="gemini-1.0-pro-001", - help=f'LLM model (default: gemini-1.0-pro-001)' + default=default_model, + help=f'LLM model (default: {default_model})' ) # Also: text-bison-32k @@ -167,8 +173,22 @@ class Processor(ConsumerProducer): parser.add_argument( '-r', '--region', - default='us-west1', - help=f'Google Cloud region (default: us-west1)', + default=default_region, + help=f'Google Cloud region (default: {default_region})', + ) + + parser.add_argument( + '-t', '--temperature', + type=float, + default=default_temperature, + help=f'LLM temperature parameter (default: {default_temperature})' + ) + + parser.add_argument( + '-x', '--max-output', + type=int, + default=default_max_output, + help=f'LLM max output tokens (default: {default_max_output})' ) def run():