diff --git a/Makefile b/Makefile index 16b0faa7..6f700f6b 100644 --- a/Makefile +++ b/Makefile @@ -36,10 +36,10 @@ set-version: TEMPLATES=azure bedrock claude cohere mix ollama openai vertexai \ openai-neo4j storage -DCS=$(foreach template,${TEMPLATES},${template:%=docker-compose-%.yaml}) +DCS=$(foreach template,${TEMPLATES},${template:%=tg-launch-%.yaml}) update-templates: set-version ${DCS} -docker-compose-%.yaml: templates/docker-compose-%.jsonnet templates/components/version.jsonnet - jsonnet -S ${@:docker-compose-%.yaml=templates/docker-compose-%.jsonnet} > $@ +tg-launch-%.yaml: templates/%.jsonnet templates/components/version.jsonnet + jsonnet -S ${@:tg-launch-%.yaml=templates/%.jsonnet} > $@ diff --git a/templates/docker-compose-azure.jsonnet b/templates/azure.jsonnet similarity index 100% rename from templates/docker-compose-azure.jsonnet rename to templates/azure.jsonnet diff --git a/templates/docker-compose-bedrock.jsonnet b/templates/bedrock.jsonnet similarity index 100% rename from templates/docker-compose-bedrock.jsonnet rename to templates/bedrock.jsonnet diff --git a/templates/docker-compose-claude.jsonnet b/templates/claude.jsonnet similarity index 100% rename from templates/docker-compose-claude.jsonnet rename to templates/claude.jsonnet diff --git a/templates/docker-compose-cohere.jsonnet b/templates/cohere.jsonnet similarity index 100% rename from templates/docker-compose-cohere.jsonnet rename to templates/cohere.jsonnet diff --git a/templates/components/azure.jsonnet b/templates/components/azure.jsonnet index cbf5a3d1..feb63a6e 100644 --- a/templates/components/azure.jsonnet +++ b/templates/components/azure.jsonnet @@ -14,6 +14,10 @@ local url = import "url.jsonnet"; "${AZURE_TOKEN}", "-e", "${AZURE_ENDPOINT}", + "-x", + "4096", + "-t", + "0.0", ], }, @@ -28,6 +32,10 @@ local url = import "url.jsonnet"; "-e", "${AZURE_ENDPOINT}", "-i", + "-x", + "4096", + "-t", + "0.0", "non-persistent://tg/request/text-completion-rag", "-o", "non-persistent://tg/response/text-completion-rag-response", diff --git a/templates/components/bedrock.jsonnet b/templates/components/bedrock.jsonnet index 454e593a..34bfcae1 100644 --- a/templates/components/bedrock.jsonnet +++ b/templates/components/bedrock.jsonnet @@ -29,6 +29,12 @@ local url = import "url.jsonnet"; "${AWS_SECRET_KEY}", "-r", "us-west-2", + "-x", + "4096", + "-t", + "0.0", + "-m", + "mistral.mixtral-8x7b-instruct-v0:1", ], }, @@ -46,6 +52,12 @@ local url = import "url.jsonnet"; "${AWS_SECRET_KEY}", "-r", "us-west-2", + "-x", + "4096", + "-t", + "0.0", + "-m", + "mistral.mixtral-8x7b-instruct-v0:1", "-i", "non-persistent://tg/request/text-completion-rag", "-o", diff --git a/templates/components/claude.jsonnet b/templates/components/claude.jsonnet index d446b748..679d4594 100644 --- a/templates/components/claude.jsonnet +++ b/templates/components/claude.jsonnet @@ -12,6 +12,10 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${CLAUDE_KEY}", + "-x", + "4096", + "-t", + "0.0", ], }, @@ -23,6 +27,10 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${CLAUDE_KEY}", + "-x", + "4096", + "-t", + "0.0", "-i", "non-persistent://tg/request/text-completion-rag", "-o", diff --git a/templates/components/cohere.jsonnet b/templates/components/cohere.jsonnet index 391ae054..69d38c15 100644 --- a/templates/components/cohere.jsonnet +++ b/templates/components/cohere.jsonnet @@ -7,13 +7,13 @@ local url = import "url.jsonnet"; chunker: base + { image: images.trustgraph, command: [ - "chunker-recursive", + "${CHUNKER:-chunker-token}", "-p", url.pulsar, "--chunk-size", - "1000", + "150", "--chunk-overlap", - "50", + "10", ], }, @@ -25,6 +25,8 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${COHERE_KEY}", + "-t", + "0.0", ], }, @@ -36,6 +38,8 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${COHERE_KEY}", + "-t", + "0.0", "-i", "non-persistent://tg/request/text-completion-rag", "-o", diff --git a/templates/components/ollama.jsonnet b/templates/components/ollama.jsonnet index af9922c1..47fd27db 100644 --- a/templates/components/ollama.jsonnet +++ b/templates/components/ollama.jsonnet @@ -10,8 +10,8 @@ local url = import "url.jsonnet"; "text-completion-ollama", "-p", url.pulsar, - // "-m", - // "llama3.1:8b", + "-m", + "gemma2:9b", "-r", "${OLLAMA_HOST}", ], @@ -23,8 +23,8 @@ local url = import "url.jsonnet"; "text-completion-ollama", "-p", url.pulsar, - // "-m", - // "llama3.1:8b", + "-m", + "gemma2:9b", "-r", "${OLLAMA_HOST}", "-i", diff --git a/templates/components/openai.jsonnet b/templates/components/openai.jsonnet index 7bd21e55..a8039400 100644 --- a/templates/components/openai.jsonnet +++ b/templates/components/openai.jsonnet @@ -12,6 +12,10 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${OPENAI_KEY}", + "-x", + "4096", + "-t", + "0.0", ], }, @@ -23,6 +27,10 @@ local url = import "url.jsonnet"; url.pulsar, "-k", "${OPENAI_KEY}", + "-x", + "4096", + "-t", + "0.0", "-i", "non-persistent://tg/request/text-completion-rag", "-o", diff --git a/templates/components/vertexai.jsonnet b/templates/components/vertexai.jsonnet index a0780f9b..00ca5a51 100644 --- a/templates/components/vertexai.jsonnet +++ b/templates/components/vertexai.jsonnet @@ -13,7 +13,11 @@ local url = import "url.jsonnet"; "-k", "/vertexai/private.json", "-r", - "us-west1", + "us-central1", + "-x", + "4096", + "-t", + "0.0", ], volumes: [ "./vertexai:/vertexai" @@ -29,7 +33,11 @@ local url = import "url.jsonnet"; "-k", "/vertexai/private.json", "-r", - "us-west1", + "us-central1", + "-x", + "4096", + "-t", + "0.0", "-i", "non-persistent://tg/request/text-completion-rag", "-o", diff --git a/templates/docker-compose.jsonnet b/templates/docker-compose.jsonnet new file mode 100644 index 00000000..a9b870eb --- /dev/null +++ b/templates/docker-compose.jsonnet @@ -0,0 +1,27 @@ +local components = { + neo4j: import "components/neo4j.jsonnet", + cassandra: import "components/neo4j.jsonnet", + pulsar: import "components/pulsar.jsonnet", + milvus: import "components/milvus.jsonnet", + grafana: import "components/grafana.jsonnet", + trustgraph: import "components/trustgraph.jsonnet", + azure: import "components/azure.jsonnet", + bedrock: import "components/bedrock.jsonnet", + cohere: import "components/cohere.jsonnet", + claude: import "components/claude.jsonnet", + ollama: import "components/ollama.jsonnet", + openai: import "components/openai.jsonnet", + mix: import "components/mix.jsonnet", + vertexai: import "components/vertexai.jsonnet", +}; + +local options = std.split(std.extVar("options"), ","); + +local add = function(state, name) state + components[name]; + +local config = std.foldl(add, options, {}); + +std.manifestYamlDoc(config) + + + diff --git a/templates/docker-compose-mix.jsonnet b/templates/mix.jsonnet similarity index 100% rename from templates/docker-compose-mix.jsonnet rename to templates/mix.jsonnet diff --git a/templates/docker-compose-ollama.jsonnet b/templates/ollama.jsonnet similarity index 100% rename from templates/docker-compose-ollama.jsonnet rename to templates/ollama.jsonnet diff --git a/templates/docker-compose-openai-neo4j.jsonnet b/templates/openai-neo4j.jsonnet similarity index 100% rename from templates/docker-compose-openai-neo4j.jsonnet rename to templates/openai-neo4j.jsonnet diff --git a/templates/docker-compose-openai.jsonnet b/templates/openai.jsonnet similarity index 100% rename from templates/docker-compose-openai.jsonnet rename to templates/openai.jsonnet diff --git a/templates/docker-compose-storage.jsonnet b/templates/storage.jsonnet similarity index 100% rename from templates/docker-compose-storage.jsonnet rename to templates/storage.jsonnet diff --git a/templates/docker-compose-vertexai.jsonnet b/templates/vertexai.jsonnet similarity index 100% rename from templates/docker-compose-vertexai.jsonnet rename to templates/vertexai.jsonnet diff --git a/tg-launch-azure.yaml b/tg-launch-azure.yaml index a91be226..2a378170 100644 --- a/tg-launch-azure.yaml +++ b/tg-launch-azure.yaml @@ -229,14 +229,14 @@ - "text-completion-azure" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${AZURE_TOKEN}" - "-e" - "${AZURE_ENDPOINT}" + - "-x" + - "4096" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -244,15 +244,15 @@ - "text-completion-azure" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${AZURE_TOKEN}" - "-e" - "${AZURE_ENDPOINT}" - "-i" + - "-x" + - "4096" + - "-t" + - "0.0" - "non-persistent://tg/request/text-completion-rag" - "-o" - "non-persistent://tg/response/text-completion-rag-response" diff --git a/tg-launch-bedrock.yaml b/tg-launch-bedrock.yaml index 5ab60f80..e23fb260 100644 --- a/tg-launch-bedrock.yaml +++ b/tg-launch-bedrock.yaml @@ -24,6 +24,7 @@ - "pulsar://pulsar:6650" - "-m" - "all-MiniLM-L6-v2" + "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "etcd": "command": @@ -228,18 +229,18 @@ - "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" + - "-x" + - "4096" + - "-t" + - "0.0" + - "-m" + - "mistral.mixtral-8x7b-instruct-v0:1" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -247,18 +248,18 @@ - "text-completion-bedrock" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-x" - # - "0.0" - # - "-m" - # - "mistral.mixtral-8x7b-instruct-v0:1" - "-z" - "${AWS_ID_KEY}" - "-k" - "${AWS_SECRET_KEY}" - "-r" - "us-west-2" + - "-x" + - "4096" + - "-t" + - "0.0" + - "-m" + - "mistral.mixtral-8x7b-instruct-v0:1" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-claude.yaml b/tg-launch-claude.yaml index ada74a1c..22249b6f 100644 --- a/tg-launch-claude.yaml +++ b/tg-launch-claude.yaml @@ -229,12 +229,12 @@ - "text-completion-claude" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${CLAUDE_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -242,12 +242,12 @@ - "text-completion-claude" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${CLAUDE_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-cohere.yaml b/tg-launch-cohere.yaml index b2c3ec30..cf4f268c 100644 --- a/tg-launch-cohere.yaml +++ b/tg-launch-cohere.yaml @@ -229,10 +229,10 @@ - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" - # - "-t" - # - "0.0" - "-k" - "${COHERE_KEY}" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -240,10 +240,10 @@ - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" - # - "-t" - # - "0.0" - "-k" - "${COHERE_KEY}" + - "-t" + - "0.0" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-mix.yaml b/tg-launch-mix.yaml index c78e7672..cea78fd8 100644 --- a/tg-launch-mix.yaml +++ b/tg-launch-mix.yaml @@ -12,9 +12,9 @@ - "-p" - "pulsar://pulsar:6650" - "--chunk-size" - - "2000" + - "4000" - "--chunk-overlap" - - "100" + - "120" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "embeddings": @@ -229,10 +229,6 @@ - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${COHERE_KEY}" - "-m" @@ -244,10 +240,6 @@ - "text-completion-cohere" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${COHERE_KEY}" - "-i" diff --git a/tg-launch-ollama.yaml b/tg-launch-ollama.yaml index 8b09e211..4eef756c 100644 --- a/tg-launch-ollama.yaml +++ b/tg-launch-ollama.yaml @@ -229,10 +229,10 @@ - "text-completion-ollama" - "-p" - "pulsar://pulsar:6650" + - "-m" + - "gemma2:9b" - "-r" - "${OLLAMA_HOST}" - # - "-m" - # - "phi3.5:latest" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -240,10 +240,10 @@ - "text-completion-ollama" - "-p" - "pulsar://pulsar:6650" + - "-m" + - "gemma2:9b" - "-r" - "${OLLAMA_HOST}" - # - "-m" - # - "phi3.5:latest" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-openai-neo4j.yaml b/tg-launch-openai-neo4j.yaml index 190a20e0..211f3f15 100644 --- a/tg-launch-openai-neo4j.yaml +++ b/tg-launch-openai-neo4j.yaml @@ -232,12 +232,12 @@ - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${OPENAI_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -245,12 +245,12 @@ - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${OPENAI_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-openai.yaml b/tg-launch-openai.yaml index 4e32bf98..b8e9141c 100644 --- a/tg-launch-openai.yaml +++ b/tg-launch-openai.yaml @@ -229,12 +229,12 @@ - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${OPENAI_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "text-completion-rag": @@ -242,12 +242,12 @@ - "text-completion-openai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "${OPENAI_KEY}" + - "-x" + - "4096" + - "-t" + - "0.0" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o" diff --git a/tg-launch-vertexai.yaml b/tg-launch-vertexai.yaml index befd7dcb..d7b13489 100644 --- a/tg-launch-vertexai.yaml +++ b/tg-launch-vertexai.yaml @@ -229,14 +229,14 @@ - "text-completion-vertexai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "/vertexai/private.json" - "-r" - "us-central1" + - "-x" + - "4096" + - "-t" + - "0.0" "image": "docker.io/trustgraph/trustgraph-flow:0.6.9" "restart": "on-failure:100" "volumes": @@ -246,14 +246,14 @@ - "text-completion-vertexai" - "-p" - "pulsar://pulsar:6650" - # - "-x" - # - "4096" - # - "-t" - # - "0.0" - "-k" - "/vertexai/private.json" - "-r" - "us-central1" + - "-x" + - "4096" + - "-t" + - "0.0" - "-i" - "non-persistent://tg/request/text-completion-rag" - "-o"