mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-08 12:52:12 +02:00
Squashed 'ai-context/trustgraph-templates/' content from commit 42a5fd1b
git-subtree-dir: ai-context/trustgraph-templates git-subtree-split: 42a5fd1b678f32be378062e30451e2052ccb95dd
This commit is contained in:
commit
74cc8a4685
1216 changed files with 116347 additions and 0 deletions
125
trustgraph_configurator/templates/1.6/README.md
Normal file
125
trustgraph_configurator/templates/1.6/README.md
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
|
||||
# TrustGraph template generation
|
||||
|
||||
There are two utilities here:
|
||||
|
||||
- `generate`: Generates a single Docker Compose launch configuration
|
||||
based on configuration you provide.
|
||||
- `generate-all`: Generates the release bundle for releases. You won't
|
||||
need to use this unless you are managing releases.
|
||||
|
||||
## `generate-all`
|
||||
|
||||
Previously, this generates a full set of all vector DB / triple store / LLM
|
||||
combinations, and put them in a single ZIP file. But this got out of
|
||||
hand, so at the time of writing, this generates a single configuraton
|
||||
using Qdrant vector DB, Ollama LLM support and Cassandra for a triple store.
|
||||
|
||||
The combinations are contained withing the code, it takes two arguments:
|
||||
- output ZIP file (is over-written)
|
||||
- TrustGraph version number
|
||||
|
||||
```
|
||||
templates/generate-all output.zip 0.18.11
|
||||
```
|
||||
|
||||
## `generate`
|
||||
|
||||
This utility takes a configuration file describing the components to bundle,
|
||||
and outputs a Docker Compose YAML file.
|
||||
|
||||
### Input configuration
|
||||
|
||||
The input configuration is a JSON file, an array of components to pull into
|
||||
the configuration. For each component, there is a name and a (possibly empty)
|
||||
object describing addtional parameters for that component.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
[
|
||||
{
|
||||
"name": "cassandra",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "pulsar",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "qdrant",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "embeddings-hf",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "graph-rag",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "grafana",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "trustgraph",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "googleaistudio",
|
||||
"parameters": {
|
||||
"googleaistudio-temperature": 0.3,
|
||||
"googleaistudio-max-output-tokens": 2048,
|
||||
"googleaistudio-model": "gemini-1.5-pro-002"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "prompt-template",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "override-recursive-chunker",
|
||||
"parameters": {
|
||||
"chunk-size": 1000,
|
||||
"chunk-overlap": 50
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "workbench-ui",
|
||||
"parameters": {}
|
||||
},
|
||||
{
|
||||
"name": "agent-manager-react",
|
||||
"parameters": {}
|
||||
}
|
||||
]
|
||||
```
|
||||
|
||||
If you want to make your own configuration you could try changing the
|
||||
configuration above:
|
||||
- Components which are essential: pulsar, trustgraph, graph-rag, grafana,
|
||||
agent-manager-react
|
||||
- You need a triple store, one of: cassandra, memgraph, falkordb, neo4j
|
||||
- You need a vector store, one of: qdrant, pinecone
|
||||
- You need an LLM, one of: azure, azure-openai, bedrock, claude, cohere,
|
||||
llamafile, ollama, openai, vertexai.
|
||||
- You need an embeddings implementation, one of: embeddings-hf,
|
||||
embeddings-ollama
|
||||
- Optionally add the Workbench tool: workbench-ui
|
||||
|
||||
Components have over-ridable parameters, look in the component definition
|
||||
in `templates/components/` to see what you can override.
|
||||
|
||||
### Invocation
|
||||
|
||||
Two parameters:
|
||||
- The output ZIP file
|
||||
- The version number
|
||||
|
||||
The configuration file described above is provided on standard input
|
||||
|
||||
```
|
||||
templates/generate out.zip 0.18.9 < config.json
|
||||
```
|
||||
|
||||
3
trustgraph_configurator/templates/1.6/base/base.jsonnet
Normal file
3
trustgraph_configurator/templates/1.6/base/base.jsonnet
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
restart: "on-failure:100",
|
||||
}
|
||||
98
trustgraph_configurator/templates/1.6/components.jsonnet
Normal file
98
trustgraph_configurator/templates/1.6/components.jsonnet
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
{
|
||||
|
||||
// Essentials
|
||||
"trustgraph-base": import "components/trustgraph.jsonnet",
|
||||
"rev-gateway": import "components/rev-gateway.jsonnet",
|
||||
"pulsar": import "components/pulsar.jsonnet",
|
||||
|
||||
// LLMs
|
||||
"azure": import "components/azure.jsonnet",
|
||||
"azure-openai": import "components/azure-openai.jsonnet",
|
||||
"bedrock": import "components/bedrock.jsonnet",
|
||||
"claude": import "components/claude.jsonnet",
|
||||
"cohere": import "components/cohere.jsonnet",
|
||||
"googleaistudio": import "components/googleaistudio.jsonnet",
|
||||
"llamafile": import "components/llamafile.jsonnet",
|
||||
"lmstudio": import "components/lmstudio.jsonnet",
|
||||
"mistral": import "components/mistral.jsonnet",
|
||||
"ollama": import "components/ollama.jsonnet",
|
||||
"openai": import "components/openai.jsonnet",
|
||||
"vertexai": import "components/vertexai.jsonnet",
|
||||
"tgi": import "components/tgi.jsonnet",
|
||||
"vllm": import "components/vllm.jsonnet",
|
||||
|
||||
// LLMs for RAG. RAG components have been collapsed into the core
|
||||
// component, so gone away.
|
||||
"azure-rag": {},
|
||||
"azure-openai-rag": {},
|
||||
"bedrock-rag": {},
|
||||
"claude-rag": {},
|
||||
"cohere-rag": {},
|
||||
"googleaistudio-rag": {},
|
||||
"llamafile-rag": {},
|
||||
"lmstudio-rag": {},
|
||||
"mistral-rag": {},
|
||||
"ollama-rag": {},
|
||||
"openai-rag": {},
|
||||
"vertexai-rag": {},
|
||||
"tgi-rag": import "components/tgi-rag.jsonnet",
|
||||
"vllm-rag": {},
|
||||
|
||||
"tgi-service-cpu": import "components/tgi-service-cpu.jsonnet",
|
||||
"tgi-service-intel-gpu": import "components/tgi-service-intel-gpu.jsonnet",
|
||||
"tgi-service-gaudi": import "components/tgi-service-gaudi.jsonnet",
|
||||
|
||||
"vllm-service-intel-gpu": import "components/vllm-service-intel-gpu.jsonnet",
|
||||
"vllm-service-gaudi": import "components/vllm-service-gaudi.jsonnet",
|
||||
"vllm-service-nvidia": import "components/vllm-service-nvidia.jsonnet",
|
||||
|
||||
// Embeddings
|
||||
"embeddings-ollama": import "components/embeddings-ollama.jsonnet",
|
||||
"embeddings-hf": import "components/embeddings-hf.jsonnet",
|
||||
"embeddings-fastembed": import "components/embeddings-fastembed.jsonnet",
|
||||
|
||||
// OCR options
|
||||
"ocr": import "components/ocr.jsonnet",
|
||||
"mistral-ocr": import "components/mistral-ocr.jsonnet",
|
||||
|
||||
// Vector stores
|
||||
"vector-store-milvus": import "components/vector-store-milvus.jsonnet",
|
||||
"vector-store-qdrant": import "components/vector-store-qdrant.jsonnet",
|
||||
"vector-store-pinecone": import "components/vector-store-pinecone.jsonnet",
|
||||
|
||||
// Triples stores
|
||||
"triple-store-cassandra": import "components/triple-store-cassandra.jsonnet",
|
||||
"triple-store-neo4j": import "components/triple-store-neo4j.jsonnet",
|
||||
"triple-store-falkordb": import "components/triple-store-falkordb.jsonnet",
|
||||
"triple-store-memgraph": import "components/triple-store-memgraph.jsonnet",
|
||||
|
||||
// Object stores
|
||||
"row-store-cassandra": import "components/row-store-cassandra.jsonnet",
|
||||
|
||||
// Observability support
|
||||
"grafana": import "components/grafana.jsonnet",
|
||||
|
||||
// Pulsar manager is a UI for Pulsar. Uses a LOT of memory
|
||||
"pulsar-manager": import "components/pulsar-manager.jsonnet",
|
||||
|
||||
"override-recursive-chunker": import "components/chunker-recursive.jsonnet",
|
||||
|
||||
// The prompt manager
|
||||
"prompt-overrides": import "components/prompt-overrides.jsonnet",
|
||||
|
||||
// Archaic - part of core system, just making sure these don't
|
||||
// cause a failure
|
||||
"workbench-ui": {},
|
||||
"prompt-template": {},
|
||||
"agent-manager-react": {},
|
||||
"graph-rag": {},
|
||||
"document-rag": {},
|
||||
"librarian": {},
|
||||
|
||||
// Extra MCP services
|
||||
"ddg-mcp-server": import "mcp/ddg-mcp-server.jsonnet",
|
||||
|
||||
// Does nothing. But, can be a hack to overwrite parameters
|
||||
"null": {},
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"agent-manager" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("agent-manager")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"agent-manager-react",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"agent-manager", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,113 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/azure-openai.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["azure-openai-" + key]:: value,
|
||||
},
|
||||
|
||||
// Strategy is to specify the model with the AZURE_MODEL environment
|
||||
// variable. This isn't something that can just be specified dynamically,
|
||||
// it has to match what was provisioned in Azure.
|
||||
|
||||
"azure-openai-max-output-tokens":: 4192,
|
||||
"azure-openai-temperature":: 0.0,
|
||||
"azure-openai-models":: models,
|
||||
|
||||
"llm-models" +:: $["azure-openai-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("azure-openai-credentials")
|
||||
.with_env_var("AZURE_TOKEN", "azure-token")
|
||||
.with_env_var("AZURE_MODEL", "azure-model")
|
||||
.with_env_var("AZURE_ENDPOINT", "azure-endpoint");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-azure-openai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["azure-openai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["azure-openai-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("azure-openai-credentials")
|
||||
.with_env_var("AZURE_TOKEN", "azure-token")
|
||||
.with_env_var("AZURE_MODEL", "azure-model")
|
||||
.with_env_var("AZURE_ENDPOINT", "azure-endpoint");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-azure-openai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["azure-openai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["azure-openai-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
106
trustgraph_configurator/templates/1.6/components/azure.jsonnet
Normal file
106
trustgraph_configurator/templates/1.6/components/azure.jsonnet
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/azure.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["azure-" + key]:: value,
|
||||
},
|
||||
|
||||
"azure-max-output-tokens":: 4096,
|
||||
"azure-temperature":: 0.0,
|
||||
"azure-models":: models,
|
||||
|
||||
"llm-models" +:: $["azure-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("azure-ai-credentials")
|
||||
.with_env_var("AZURE_TOKEN", "azure-token")
|
||||
.with_env_var("AZURE_ENDPOINT", "azure-endpoint");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-azure",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["azure-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["azure-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("azure-ai-credentials")
|
||||
.with_env_var("AZURE_TOKEN", "azure-token")
|
||||
.with_env_var("AZURE_ENDPOINT", "azure-endpoint");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-azure",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["azure-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["azure-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
106
trustgraph_configurator/templates/1.6/components/bedrock.jsonnet
Normal file
106
trustgraph_configurator/templates/1.6/components/bedrock.jsonnet
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local chunker = import "chunker-recursive.jsonnet";
|
||||
local models = import "parameters/bedrock.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["bedrock-" + key]:: value,
|
||||
},
|
||||
|
||||
"bedrock-max-output-tokens":: 4096,
|
||||
"bedrock-temperature":: 0.0,
|
||||
"bedrock-models":: models,
|
||||
|
||||
"llm-models" +:: $["bedrock-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("bedrock-credentials")
|
||||
.with_env_var("AWS_ACCESS_KEY_ID", "aws-id-key")
|
||||
.with_env_var("AWS_SECRET_ACCESS_KEY", "aws-secret")
|
||||
.with_env_var("AWS_DEFAULT_REGION", "aws-region");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_bedrock)
|
||||
.with_command([
|
||||
"text-completion-bedrock",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["bedrock-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["bedrock-temperature"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("bedrock-credentials")
|
||||
.with_env_var("AWS_ACCESS_KEY_ID", "aws-id-key")
|
||||
.with_env_var("AWS_SECRET_ACCESS_KEY", "aws-secret")
|
||||
.with_env_var("AWS_DEFAULT_REGION", "aws-region");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_bedrock)
|
||||
.with_command([
|
||||
"text-completion-bedrock",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["bedrock-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["bedrock-temperature"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts + chunker
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"chunk-size":: 2000,
|
||||
"chunk-overlap":: 100,
|
||||
|
||||
"chunker" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("chunker")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"chunker-recursive",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--chunk-size",
|
||||
std.toString($["chunk-size"]),
|
||||
"--chunk-overlap",
|
||||
std.toString($["chunk-overlap"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"chunker", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
105
trustgraph_configurator/templates/1.6/components/claude.jsonnet
Normal file
105
trustgraph_configurator/templates/1.6/components/claude.jsonnet
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/claude.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["claude-" + key]:: value,
|
||||
},
|
||||
|
||||
"claude-max-output-tokens":: 4096,
|
||||
"claude-temperature":: 0.0,
|
||||
"claude-models":: models,
|
||||
|
||||
"llm-models" +:: $["claude-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("claude-credentials")
|
||||
.with_env_var("CLAUDE_KEY", "claude-key");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-claude",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["claude-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["claude-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("claude-credentials")
|
||||
.with_env_var("CLAUDE_KEY", "claude-key");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-claude",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["claude-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["claude-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,98 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/cohere.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["cohere-" + key]:: value,
|
||||
},
|
||||
|
||||
"cohere-temperature":: 0.0,
|
||||
"cohere-models":: models,
|
||||
|
||||
"llm-models" +:: $["cohere-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("cohere-credentials")
|
||||
.with_env_var("COHERE_KEY", "cohere-key");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-cohere",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
"%0.3f" % $["cohere-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("cohere-credentials")
|
||||
.with_env_var("COHERE_KEY", "cohere-key");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-cohere",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-t",
|
||||
"%0.3f" % $["cohere-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
|
||||
// This puts the default configuration together. References many things,
|
||||
// flow classes, a default flow, token costs, prompts, agent tools
|
||||
|
||||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"init-trustgraph" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local cfgVol = engine.configVolume(
|
||||
"trustgraph-cfg", "trustgraph",
|
||||
{
|
||||
"config.json": importstr "trustgraph/config.json",
|
||||
}
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("init-trustgraph")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command(
|
||||
[
|
||||
"tg-init-trustgraph",
|
||||
"-p",
|
||||
url.pulsar_admin,
|
||||
"--config-file",
|
||||
"/trustgraph/config.json",
|
||||
]
|
||||
)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M")
|
||||
.with_volume_mount(cfgVol, "/trustgraph/");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"init-trustgraph", [ container ]
|
||||
);
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
containerSet,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"document-rag-doc-limit":: 20,
|
||||
|
||||
"document-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("document-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"document-rag",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--doc-limit",
|
||||
std.toString($["document-rag-doc-limit"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"document-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"document-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("document-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"document-embeddings",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("1.0", "512M")
|
||||
.with_reservations("0.5", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"document-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/embeddings-fastembed.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"fastembed-models":: models,
|
||||
|
||||
"embeddings-models" +:: $["fastembed-models"],
|
||||
|
||||
embeddings +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"embeddings-fastembed",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["embeddings-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("1.0", "400M")
|
||||
.with_reservations("0.5", "400M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,46 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/embeddings-huggingface.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"huggingface-embeddings-models":: models,
|
||||
|
||||
"embeddings-models" +:: $["huggingface-embeddings-models"],
|
||||
|
||||
embeddings +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("embeddings")
|
||||
.with_image(images.trustgraph_hf)
|
||||
.with_command([
|
||||
"embeddings-hf",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["embeddings-concurrency"]),
|
||||
])
|
||||
.with_limits("1.0", "400M")
|
||||
.with_reservations("0.5", "400M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local models = import "parameters/embeddings-ollama.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"ollama-url":: "${OLLAMA_HOST}",
|
||||
|
||||
"ollama-models":: models,
|
||||
|
||||
"embeddings-models" +:: $["ollama-models"],
|
||||
|
||||
embeddings +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"embeddings-ollama",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["embeddings-concurrency"]),
|
||||
"-r",
|
||||
$["ollama-url"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/googleaistudio.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["googleaistudio-" + key]:: value,
|
||||
},
|
||||
|
||||
"googleaistudio-max-output-tokens":: 4096,
|
||||
"googleaistudio-temperature":: 0.0,
|
||||
"googleaistudio-models":: models,
|
||||
|
||||
"llm-models" +:: $["googleaistudio-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("googleaistudio-credentials")
|
||||
.with_env_var("GOOGLE_AI_STUDIO_KEY", "googleaistudio-key");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-googleaistudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["googleaistudio-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["googleaistudio-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("googleaistudio-credentials")
|
||||
.with_env_var("GOOGLE_AI_STUDIO_KEY", "googleaistudio-key");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-googleaistudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["googleaistudio-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["googleaistudio-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
122
trustgraph_configurator/templates/1.6/components/grafana.jsonnet
Normal file
122
trustgraph_configurator/templates/1.6/components/grafana.jsonnet
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"prometheus" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("prometheus-data").with_size("20G");
|
||||
|
||||
local cfgVol = engine.configVolume(
|
||||
"prometheus-cfg", "prometheus",
|
||||
{
|
||||
"prometheus.yml": importstr "prometheus/prometheus.yml",
|
||||
}
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("prometheus")
|
||||
.with_image(images.prometheus)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M")
|
||||
.with_port(9090, 9090, "http")
|
||||
.with_volume_mount(cfgVol, "/etc/prometheus/")
|
||||
.with_volume_mount(vol, "/prometheus");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"prometheus", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(9090, 9090, "http");
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"grafana" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("grafana-storage").with_size("20G");
|
||||
|
||||
local provDashVol = engine.configVolume(
|
||||
"prov-dash", "grafana/provisioning/",
|
||||
{
|
||||
"dashboard.yml":
|
||||
importstr "grafana/provisioning/dashboard.yml",
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
local provDataVol = engine.configVolume(
|
||||
"prov-data", "grafana/provisioning/",
|
||||
{
|
||||
"datasource.yml":
|
||||
importstr "grafana/provisioning/datasource.yml",
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
local dashVol = engine.configVolume(
|
||||
"dashboards", "grafana/dashboards/",
|
||||
{
|
||||
"dashboard.json":
|
||||
importstr "grafana/dashboards/dashboard.json",
|
||||
}
|
||||
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("grafana")
|
||||
.with_image(images.grafana)
|
||||
.with_environment({
|
||||
// GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin",
|
||||
// GF_AUTH_ANONYMOUS_ENABLED: "true",
|
||||
// GF_ORG_ROLE: "Admin",
|
||||
GF_ORG_NAME: "trustgraph.ai",
|
||||
// GF_SERVER_ROOT_URL: "https://example.com",
|
||||
})
|
||||
.with_limits("1.0", "256M")
|
||||
.with_reservations("0.5", "256M")
|
||||
.with_port(3000, 3000, "cassandra")
|
||||
.with_volume_mount(vol, "/var/lib/grafana")
|
||||
.with_volume_mount(
|
||||
provDashVol, "/etc/grafana/provisioning/dashboards/"
|
||||
)
|
||||
.with_volume_mount(
|
||||
provDataVol, "/etc/grafana/provisioning/datasources/"
|
||||
)
|
||||
.with_volume_mount(
|
||||
dashVol, "/var/lib/grafana/dashboards/"
|
||||
);
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"grafana", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(3000, 3000, "http");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
provDashVol,
|
||||
provDataVol,
|
||||
dashVol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,223 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"graph-rag-entity-limit":: 50,
|
||||
"graph-rag-triple-limit":: 30,
|
||||
"graph-rag-max-subgraph-size":: 400,
|
||||
"graph-rag-max-path-length":: 2,
|
||||
|
||||
"kg-extract-definitions" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-extract-definitions")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-extract-definitions",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["kg-extraction-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-extract-definitions", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-extract-relationships" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-extract-relationships")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-extract-relationships",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["kg-extraction-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-extract-relationships", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-extract-agent" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-extract-agent")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-extract-agent",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["kg-extraction-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-extract-agent", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-extract-ontology" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-extract-ontology")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-extract-ontology",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["kg-extraction-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "300M")
|
||||
.with_reservations("0.1", "300M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-extract-ontology", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"graph-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("graph-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"graph-rag",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
// "--concurrency",
|
||||
// std.toString($["graph-rag-concurrency"]),
|
||||
"--entity-limit",
|
||||
std.toString($["graph-rag-entity-limit"]),
|
||||
"--triple-limit",
|
||||
std.toString($["graph-rag-triple-limit"]),
|
||||
"--max-subgraph-size",
|
||||
std.toString($["graph-rag-max-subgraph-size"]),
|
||||
"--max-path-length",
|
||||
std.toString($["graph-rag-max-path-length"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"graph-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"graph-embeddings",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("1.0", "512M")
|
||||
.with_reservations("0.5", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local minio = import "stores/minio.jsonnet";
|
||||
local cassandra = import "stores/cassandra.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"librarian" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("librarian")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"librarian",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"librarian", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
// Minio and Cassandra are used by the Librarian
|
||||
} + minio + cassandra
|
||||
|
||||
|
|
@ -0,0 +1,95 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/slm.jsonnet";
|
||||
local models = import "parameters/llamafile.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["llamafile-" + key]:: value,
|
||||
},
|
||||
|
||||
"llamafile-models":: models,
|
||||
|
||||
"llm-models" +:: $["llamafile-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("llamafile-credentials")
|
||||
.with_env_var("LLAMAFILE_URL", "llamafile-url");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-llamafile",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("llamafile-credentials")
|
||||
.with_env_var("LLAMAFILE_URL", "llamafile-url");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-llamafile",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,105 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/lmstudio.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["lmstudio-" + key]:: value,
|
||||
},
|
||||
|
||||
"lmstudio-max-output-tokens":: 4096,
|
||||
"lmstudio-temperature":: 0.0,
|
||||
"lmstudio-models":: models,
|
||||
|
||||
"llm-models" +:: $["lmstudio-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("lmstudio-credentials")
|
||||
.with_env_var("LMSTUDIO_URL", "lmstudio-url");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-lmstudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["lmstudio-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["lmstudio-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("lmstudio-credentials")
|
||||
.with_env_var("LMSTUDIO_URL", "lmstudio-url");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-lmstudio",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["lmstudio-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["lmstudio-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"mcp-server-port":: 8000,
|
||||
|
||||
"mcp-server" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("mcp-server-secret")
|
||||
.with_env_var("MCP_SERVER_SECRET", "mcp-server-secret");
|
||||
|
||||
local port = $["mcp-server-port"];
|
||||
|
||||
local container =
|
||||
engine.container("mcp-server")
|
||||
.with_image(images.trustgraph_mcp)
|
||||
.with_command([
|
||||
"mcp-server",
|
||||
"--port",
|
||||
std.toString(port),
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_port(port, port, "mcp");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"mcp-server", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(port, port, "mcp");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,49 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["mistral-" + key]:: value,
|
||||
},
|
||||
|
||||
"pdf-decoder" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("mistral-credentials")
|
||||
.with_env_var("MISTRAL_TOKEN", "mistral-token");
|
||||
|
||||
local container =
|
||||
engine.container("mistral-ocr")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"pdf-ocr-mistral",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"mistral-ocr", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
105
trustgraph_configurator/templates/1.6/components/mistral.jsonnet
Normal file
105
trustgraph_configurator/templates/1.6/components/mistral.jsonnet
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/mistral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["mistral-" + key]:: value,
|
||||
},
|
||||
|
||||
"mistral-max-output-tokens":: 4096,
|
||||
"mistral-temperature":: 0.0,
|
||||
"mistral-models":: models,
|
||||
|
||||
"llm-models" +:: $["mistral-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("mistral-credentials")
|
||||
.with_env_var("MISTRAL_TOKEN", "mistral-token");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-mistral",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["mistral-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["mistral-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("mistral-credentials")
|
||||
.with_env_var("MISTRAL_TOKEN", "mistral-token");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-mistral",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["mistral-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["mistral-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
{
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local cassandra_hosts = "cassandra";
|
||||
local cassandra = import "stores/cassandra.jsonnet";
|
||||
|
||||
cassandra + {
|
||||
|
||||
"store-objects" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-objects")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"objects-write-cassandra",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--cassandra-host",
|
||||
cassandra_hosts,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-objects", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-objects" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-objects")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"objects-query-cassandra",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--cassandra-host",
|
||||
cassandra_hosts,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "512M")
|
||||
.with_reservations("0.1", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-objects", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
37
trustgraph_configurator/templates/1.6/components/ocr.jsonnet
Normal file
37
trustgraph_configurator/templates/1.6/components/ocr.jsonnet
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"pdf-decoder" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("pdf-ocr")
|
||||
.with_image(images.trustgraph_ocr)
|
||||
.with_command([
|
||||
"pdf-ocr",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
])
|
||||
.with_limits("1.0", "512M")
|
||||
.with_reservations("0.1", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"pdf-ocr", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,99 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/ollama.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["ollama-" + key]:: value,
|
||||
},
|
||||
|
||||
"ollama-models":: models,
|
||||
|
||||
"llm-models" +:: $["ollama-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("ollama-credentials")
|
||||
.with_env_var("OLLAMA_HOST", "ollama-host");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-ollama",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("ollama-credentials")
|
||||
.with_env_var("OLLAMA_HOST", "ollama-host");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-ollama",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-rag-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
107
trustgraph_configurator/templates/1.6/components/openai.jsonnet
Normal file
107
trustgraph_configurator/templates/1.6/components/openai.jsonnet
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/openai.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["openai-" + key]:: value,
|
||||
},
|
||||
|
||||
"openai-max-output-tokens":: 4096,
|
||||
"openai-temperature":: 0.0,
|
||||
"openai-models":: models,
|
||||
|
||||
"llm-models" +:: $["openai-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("openai-credentials")
|
||||
.with_env_var("OPENAI_TOKEN", "openai-token")
|
||||
.with_env_var("OPENAI_BASE_URL", "openai-url");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-openai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-x",
|
||||
std.toString($["openai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["openai-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("openai-credentials")
|
||||
.with_env_var("OPENAI_TOKEN", "openai-token")
|
||||
.with_env_var("OPENAI_BASE_URL", "openai-url");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-openai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-x",
|
||||
std.toString($["openai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["openai-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
local default_prompts = import "prompts/default-prompts.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
if (key == "system-template") then
|
||||
self + {
|
||||
prompts +:: {
|
||||
"system-template": value,
|
||||
}
|
||||
}
|
||||
else
|
||||
self + {
|
||||
prompts +:: {
|
||||
templates +:: {
|
||||
[key] +:: {
|
||||
prompt: value
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
} + default_prompts
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"prompt" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("prompt")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"prompt-template",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["prompt-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"prompt", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"prompt-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("prompt-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"prompt-template",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"prompt-rag",
|
||||
"--concurrency",
|
||||
std.toString($["prompt-rag-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"prompt-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"pulsar" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
// FIXME: Should persist something?
|
||||
// local volume = engine.volume(...)
|
||||
|
||||
local container =
|
||||
engine.container("pulsar")
|
||||
.with_image(images.pulsar_manager)
|
||||
.with_environment({
|
||||
SPRING_CONFIGURATION_FILE: "/pulsar-manager/pulsar-manager/application.properties",
|
||||
})
|
||||
.with_limits("0.5", "1.4G")
|
||||
.with_reservations("0.1", "1.4G")
|
||||
.with_port(9527, 9527, "api")
|
||||
.with_port(7750, 7750, "api2");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"pulsar", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(9527, 9527, "api")
|
||||
.with_port(7750, 7750, "api2);
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
171
trustgraph_configurator/templates/1.6/components/pulsar.jsonnet
Normal file
171
trustgraph_configurator/templates/1.6/components/pulsar.jsonnet
Normal file
|
|
@ -0,0 +1,171 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
// This is a Pulsar configuration. Non-standalone mode so we deploy
|
||||
// individual components: bookkeeper, broker and zookeeper.
|
||||
//
|
||||
// This also deploys the TrustGraph 'admin' container which initialises
|
||||
// TrustGraph-specific namespaces etc.
|
||||
|
||||
{
|
||||
|
||||
"pulsar" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
// Zookeeper volume
|
||||
local zkVolume = engine.volume("zookeeper").with_size("1G");
|
||||
|
||||
// Zookeeper container
|
||||
local zkContainer =
|
||||
engine.container("zookeeper")
|
||||
.with_image(images.pulsar)
|
||||
.with_command([
|
||||
"bash",
|
||||
"-c",
|
||||
"bin/apply-config-from-env.py conf/zookeeper.conf && bin/generate-zookeeper-config.sh conf/zookeeper.conf && exec bin/pulsar zookeeper"
|
||||
])
|
||||
.with_limits("1", "400M")
|
||||
.with_reservations("0.05", "400M")
|
||||
.with_user("0:1000")
|
||||
.with_volume_mount(zkVolume, "/pulsar/data/zookeeper")
|
||||
.with_environment({
|
||||
"metadataStoreUrl": "zk:zookeeper:2181",
|
||||
"PULSAR_MEM": "-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m",
|
||||
})
|
||||
.with_port(2181, 2181, "zookeeper")
|
||||
.with_port(2888, 2888, "zookeeper2")
|
||||
.with_port(3888, 3888, "zookeeper3");
|
||||
|
||||
// Pulsar cluster init container
|
||||
local initContainer =
|
||||
engine.container("pulsar-init")
|
||||
.with_image(images.pulsar)
|
||||
.with_command([
|
||||
"bash",
|
||||
"-c",
|
||||
"sleep 10 && bin/pulsar initialize-cluster-metadata --cluster cluster-a --zookeeper zookeeper:2181 --configuration-store zookeeper:2181 --web-service-url http://pulsar:8080 --broker-service-url pulsar://pulsar:6650",
|
||||
])
|
||||
.with_limits("1", "512M")
|
||||
.with_reservations("0.05", "512M")
|
||||
.with_environment({
|
||||
"PULSAR_MEM": "-Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m",
|
||||
});
|
||||
|
||||
|
||||
// Bookkeeper volume
|
||||
local bookieVolume = engine.volume("bookie").with_size("20G");
|
||||
|
||||
// Bookkeeper container
|
||||
local bookieContainer =
|
||||
engine.container("bookie")
|
||||
.with_image(images.pulsar)
|
||||
.with_command([
|
||||
"bash",
|
||||
"-c",
|
||||
"bin/apply-config-from-env.py conf/bookkeeper.conf && exec bin/pulsar bookie"
|
||||
// false ^ causes this to be a 'failure' exit.
|
||||
])
|
||||
.with_limits("1", "1024M")
|
||||
.with_reservations("0.1", "1024M")
|
||||
.with_user("0:1000")
|
||||
.with_volume_mount(bookieVolume, "/pulsar/data/bookkeeper")
|
||||
.with_environment({
|
||||
"clusterName": "cluster-a",
|
||||
"zkServers": "zookeeper:2181",
|
||||
"bookieId": "bookie",
|
||||
"metadataStoreUri": "metadata-store:zk:zookeeper:2181",
|
||||
"advertisedAddress": "bookie",
|
||||
"BOOKIE_MEM": "-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m",
|
||||
})
|
||||
.with_port(3181, 3181, "bookie");
|
||||
|
||||
// Pulsar broker, stateless (uses ZK and Bookkeeper for state)
|
||||
local brokerContainer =
|
||||
engine.container("pulsar")
|
||||
.with_image(images.pulsar)
|
||||
.with_command([
|
||||
"bash",
|
||||
"-c",
|
||||
"bin/apply-config-from-env.py conf/broker.conf && exec bin/pulsar broker"
|
||||
])
|
||||
.with_limits("1", "800M")
|
||||
.with_reservations("0.1", "800M")
|
||||
.with_environment({
|
||||
"metadataStoreUrl": "zk:zookeeper:2181",
|
||||
"zookeeperServers": "zookeeper:2181",
|
||||
"clusterName": "cluster-a",
|
||||
"managedLedgerDefaultEnsembleSize": "1",
|
||||
"managedLedgerDefaultWriteQuorum": "1",
|
||||
"managedLedgerDefaultAckQuorum": "1",
|
||||
"advertisedAddress": "pulsar",
|
||||
"advertisedListeners": "external:pulsar://pulsar:6650,localhost:pulsar://localhost:6650",
|
||||
"PULSAR_MEM": "-Xms512m -Xmx512m -XX:MaxDirectMemorySize=256m",
|
||||
})
|
||||
.with_port(6650, 6650, "pulsar")
|
||||
.with_port(8080, 8080, "admin");
|
||||
|
||||
// Container sets
|
||||
local zkContainerSet = engine.containers(
|
||||
"zookeeper",
|
||||
[
|
||||
zkContainer,
|
||||
]
|
||||
);
|
||||
|
||||
local initContainerSet = engine.containers(
|
||||
"init-pulsar",
|
||||
[
|
||||
initContainer,
|
||||
]
|
||||
);
|
||||
|
||||
local bookieContainerSet = engine.containers(
|
||||
"bookie",
|
||||
[
|
||||
bookieContainer,
|
||||
]
|
||||
);
|
||||
|
||||
local brokerContainerSet = engine.containers(
|
||||
"pulsar",
|
||||
[
|
||||
brokerContainer,
|
||||
]
|
||||
);
|
||||
|
||||
// Zookeeper service
|
||||
local zkService =
|
||||
engine.service(zkContainerSet)
|
||||
.with_port(2181, 2181, "zookeeper")
|
||||
.with_port(2888, 2888, "zookeeper2")
|
||||
.with_port(3888, 3888, "zookeeper3");
|
||||
|
||||
// Bookkeeper service
|
||||
local bookieService =
|
||||
engine.service(bookieContainerSet)
|
||||
.with_port(3181, 3181, "bookie");
|
||||
|
||||
// Pulsar broker service
|
||||
local brokerService =
|
||||
engine.service(brokerContainerSet)
|
||||
.with_port(6650, 6650, "pulsar")
|
||||
.with_port(8080, 8080, "admin");
|
||||
|
||||
engine.resources([
|
||||
zkVolume,
|
||||
bookieVolume,
|
||||
zkContainerSet,
|
||||
initContainerSet,
|
||||
bookieContainerSet,
|
||||
brokerContainerSet,
|
||||
zkService,
|
||||
bookieService,
|
||||
brokerService,
|
||||
])
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
// Invalid, but at least means the rev-gateway won't connect to anything
|
||||
// it shouldn't.
|
||||
"rev-gateway-token":: "INVALID_TOKEN",
|
||||
"rev-gateway-uri":: "wss://127.0.0.1/api/v1/relay?token=" + $["rev-gateway-token"],
|
||||
|
||||
"rev-gateway" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("rev-gateway-secret")
|
||||
.with_env_var("REV_GATEWAY_SECRET", "rev-gateway-secret");
|
||||
|
||||
local container =
|
||||
engine.container("api-gateway")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"rev-gateway",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--websocket-uri",
|
||||
std.toString($["rev-gateway-uri"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_port(8000, 8000, "metrics")
|
||||
.with_port(port, port, "api");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"api-gateway", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics")
|
||||
.with_port(port, port, "api");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,137 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"nlp-query" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("nlp-query")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"nlp-query",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"nlp-query", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"structured-query" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("structured-query")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"structured-query",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"structured-query", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"structured-diag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("structured-diag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"structured-diag",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "96M")
|
||||
.with_reservations("0.1", "96M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"structured-diag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-extract-objects" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-extract-objects")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-extract-objects",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["kg-extraction-concurrency"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-extract-objects", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["tgi-rag-" + key]:: value,
|
||||
},
|
||||
|
||||
"tgi-rag-max-output-tokens":: 1024,
|
||||
"tgi-rag-temperature":: 0.0,
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("tgi-credentials")
|
||||
.with_env_var("TGI_BASE_URL", "tgi-url");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-tgi",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-rag-concurrency"]),
|
||||
"-x",
|
||||
std.toString($["tgi-rag-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["tgi-rag-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["tgi-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"tgi-service-model":: "teknium/OpenHermes-2.5-Mistral-7B",
|
||||
"tgi-service-cpus":: "8.0",
|
||||
"tgi-service-memory":: "16G",
|
||||
|
||||
"tgi-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("tgi-storage").with_size("20G");
|
||||
|
||||
local container =
|
||||
engine.container("tgi-service")
|
||||
.with_image(images["tgi-service-cpu"])
|
||||
.with_command([
|
||||
"--model-id",
|
||||
$["tgi-service-model"],
|
||||
"--cuda-graphs",
|
||||
"0",
|
||||
"--port",
|
||||
"8899"
|
||||
])
|
||||
.with_privileged(true)
|
||||
.with_device("/dev/dri", "/dev/dri")
|
||||
.with_environment({
|
||||
HF_TOKEN: $["hf-token"],
|
||||
})
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "tgi")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"tgi-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "tgi");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["tgi-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"tgi-service-model":: "meta-llama/Llama-3.3-70B-Instruct",
|
||||
"tgi-service-cpus":: "64.0",
|
||||
"tgi-service-memory":: "64G",
|
||||
|
||||
"tgi-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("tgi-storage").with_size("50G");
|
||||
|
||||
local container =
|
||||
engine.container("tgi-service")
|
||||
.with_image(images["tgi-service-gaudi"])
|
||||
.with_command([
|
||||
"--model-id",
|
||||
$["tgi-service-model"],
|
||||
"--sharded",
|
||||
"true",
|
||||
"--num-shard",
|
||||
"8",
|
||||
"--max-input-tokens",
|
||||
"4096",
|
||||
"--max-total-tokens",
|
||||
"4096",
|
||||
"--max-batch-size",
|
||||
"128",
|
||||
// "--max-batch-prefill-tokens",
|
||||
// "16384",
|
||||
"--max-waiting-tokens",
|
||||
"7",
|
||||
// "--waiting-served-ratio",
|
||||
// "1.2",
|
||||
"--max-concurrent-requests",
|
||||
"512",
|
||||
"--cuda-graphs",
|
||||
"0",
|
||||
"--port",
|
||||
"8899"
|
||||
])
|
||||
.with_runtime("habana")
|
||||
.with_environment({
|
||||
HABANA_VISIBLE_DEVICES: "all",
|
||||
OMPI_MCA_btl_vader_single_copy_mechanism: "none",
|
||||
HF_TOKEN: $["hf-token"],
|
||||
ENABLE_HPU_GRAPH: 'true',
|
||||
LIMIT_HPU_GRAPH: 'true',
|
||||
USE_FLASH_ATTENTION: 'true',
|
||||
FLASH_ATTENTION_RECOMPUTE: 'true',
|
||||
// PT_HPU_ENABLE_LAZY_COLLECTIVES: 'true',
|
||||
// PREFILL_BATCH_BUCKET_SIZE: "1",
|
||||
// BATCH_BUCKET_SIZE: "1",
|
||||
|
||||
})
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "tgi")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"tgi-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "tgi");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["tgi-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"tgi-service-model":: "teknium/OpenHermes-2.5-Mistral-7B",
|
||||
"tgi-service-cpus":: "8.0",
|
||||
"tgi-service-memory":: "16G",
|
||||
|
||||
"tgi-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("tgi-storage").with_size("20G");
|
||||
|
||||
local container =
|
||||
engine.container("tgi-service")
|
||||
.with_image(images["tgi-service-intel-xpu"])
|
||||
.with_command([
|
||||
"--model-id",
|
||||
$["tgi-service-model"],
|
||||
"--cuda-graphs",
|
||||
"0",
|
||||
"--port",
|
||||
"8899"
|
||||
])
|
||||
.with_environment({
|
||||
HF_TOKEN: $["hf-token"],
|
||||
})
|
||||
.with_privileged(true)
|
||||
.with_device("/dev/dri", "/dev/dri")
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["tgi-service-cpus"], $["tgi-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "tgi")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"tgi-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "tgi");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
60
trustgraph_configurator/templates/1.6/components/tgi.jsonnet
Normal file
60
trustgraph_configurator/templates/1.6/components/tgi.jsonnet
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["tgi-" + key]:: value,
|
||||
},
|
||||
|
||||
"tgi-max-output-tokens":: 1024,
|
||||
"tgi-temperature":: 0.0,
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("tgi-credentials")
|
||||
.with_env_var("TGI_BASE_URL", "tgi-url");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-tgi",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-concurrency"]),
|
||||
"-x",
|
||||
std.toString($["tgi-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["tgi-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local cassandra_hosts = "cassandra";
|
||||
local cassandra = import "stores/cassandra.jsonnet";
|
||||
|
||||
cassandra + {
|
||||
|
||||
"store-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-write-cassandra",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--cassandra-host",
|
||||
cassandra_hosts,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-query-cassandra",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--cassandra-host",
|
||||
cassandra_hosts,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "512M")
|
||||
.with_reservations("0.1", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local falkordb = import "stores/falkordb.jsonnet";
|
||||
|
||||
falkordb + {
|
||||
|
||||
"falkordb-url":: "falkor://falkordb:6379",
|
||||
|
||||
"store-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-write-falkordb",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["falkordb-url"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-query-falkordb",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["falkordb-url"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,85 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local memgraph = import "stores/memgraph.jsonnet";
|
||||
|
||||
memgraph + {
|
||||
|
||||
"memgraph-url":: "bolt://memgraph:7687",
|
||||
"memgraph-database":: "memgraph",
|
||||
|
||||
"store-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-write-memgraph",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["memgraph-url"],
|
||||
"--database",
|
||||
$["memgraph-database"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-query-memgraph",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["memgraph-url"],
|
||||
"--database",
|
||||
$["memgraph-database"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,80 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local neo4j = import "stores/neo4j.jsonnet";
|
||||
|
||||
neo4j + {
|
||||
|
||||
"neo4j-url":: "bolt://neo4j:7687",
|
||||
|
||||
"store-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-write-neo4j",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["neo4j-url"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-triples" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-triples")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"triples-query-neo4j",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-g",
|
||||
$["neo4j-url"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-triples", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,349 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
local config_initialiser = import "configuration.jsonnet";
|
||||
local config = import "trustgraph-config.jsonnet";
|
||||
local librarian = import "librarian.jsonnet";
|
||||
local mcp_server = import "mcp-server.jsonnet";
|
||||
local workbench = import "workbench-ui.jsonnet";
|
||||
local graphrag = import "graph-rag.jsonnet";
|
||||
local documentrag = import "document-rag.jsonnet";
|
||||
local prompt_template = import "prompt-template.jsonnet";
|
||||
local agent_manager = import "agent-manager-react.jsonnet";
|
||||
local structured_data = import "structured-data.jsonnet";
|
||||
local ddg = import "mcp/ddg-mcp-server.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"log-level":: "INFO",
|
||||
|
||||
"api-gateway-port":: 8088,
|
||||
"api-gateway-timeout":: 600,
|
||||
|
||||
"chunk-size":: 250,
|
||||
"chunk-overlap":: 15,
|
||||
|
||||
"prompt-concurrency":: 1,
|
||||
"prompt-rag-concurrency":: 1,
|
||||
|
||||
"text-completion-concurrency":: 1,
|
||||
"text-completion-rag-concurrency":: 1,
|
||||
|
||||
"kg-extraction-concurrency":: 1,
|
||||
"graph-rag-concurrency":: 1,
|
||||
|
||||
"embeddings-concurrency":: 1,
|
||||
|
||||
"api-gateway" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("gateway-secret")
|
||||
.with_env_var("GATEWAY_SECRET", "gateway-secret");
|
||||
|
||||
local port = $["api-gateway-port"];
|
||||
|
||||
local container =
|
||||
engine.container("api-gateway")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"api-gateway",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--timeout",
|
||||
std.toString($["api-gateway-timeout"]),
|
||||
"--port",
|
||||
std.toString(port),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_port(port, port, "api");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"api-gateway", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics")
|
||||
.with_port(port, port, "api");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"chunker" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("chunker")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"chunker-token",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--chunk-size",
|
||||
std.toString($["chunk-size"]),
|
||||
"--chunk-overlap",
|
||||
std.toString($["chunk-overlap"]),
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"chunker", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"config-svc" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("config-svc")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"config-svc",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"config-svc", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"pdf-decoder" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("pdf-decoder")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"pdf-decoder",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "512M")
|
||||
.with_reservations("0.1", "512M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"pdf-decoder", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"mcp-tool" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("mcp-tool")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"mcp-tool",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"mcp-tool", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"metering" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("metering")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"metering",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"metering", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"metering-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("metering-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"metering",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"metering-rag",
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"metering-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-store" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-store")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-store",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-store", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"kg-manager" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("kg-manager")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"kg-manager",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"kg-manager", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + librarian + mcp_server + workbench + graphrag
|
||||
+ documentrag + prompt_template + agent_manager + structured_data
|
||||
+ config_initialiser + config
|
||||
+ ddg
|
||||
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local cassandra_hosts = "cassandra";
|
||||
local milvus = import "stores/milvus.jsonnet";
|
||||
|
||||
milvus + {
|
||||
|
||||
"store-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-write-milvus",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.milvus,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-query-milvus",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.milvus,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"store-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-write-milvus",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.milvus,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-query-milvus",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.milvus,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local cassandra_hosts = "cassandra";
|
||||
|
||||
{
|
||||
|
||||
"pinecone-cloud":: "aws",
|
||||
"pinecone-region":: "us-east-1",
|
||||
|
||||
"store-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("pinecone-api-key")
|
||||
.with_env_var("PINECONE_API_KEY", "pinecone-api-key");
|
||||
|
||||
local container =
|
||||
engine.container("store-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-write-pinecone",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("pinecone-api-key")
|
||||
.with_env_var("PINECONE_API_KEY", "pinecone-api-key");
|
||||
|
||||
local container =
|
||||
engine.container("query-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-query-pinecone",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"store-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("pinecone-api-key")
|
||||
.with_env_var("PINECONE_API_KEY", "pinecone-api-key");
|
||||
|
||||
local container =
|
||||
engine.container("store-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-write-pinecone",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("pinecone-api-key")
|
||||
.with_env_var("PINECONE_API_KEY", "pinecone-api-key");
|
||||
|
||||
local container =
|
||||
engine.container("query-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-query-pinecone",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,147 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local cassandra_hosts = "cassandra";
|
||||
local qdrant = import "stores/qdrant.jsonnet";
|
||||
|
||||
qdrant + {
|
||||
|
||||
"store-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-write-qdrant",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.qdrant,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-graph-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-graph-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"ge-query-qdrant",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.qdrant,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-graph-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"store-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("store-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-write-qdrant",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.qdrant,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"store-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"query-doc-embeddings" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("query-doc-embeddings")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"de-query-qdrant",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-t",
|
||||
url.qdrant,
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"query-doc-embeddings", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/vertexai.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["vertexai-" + key]:: value,
|
||||
},
|
||||
|
||||
"vertexai-private-key":: "/vertexai/private.json",
|
||||
"vertexai-region":: "us-central1",
|
||||
"vertexai-max-output-tokens":: 4096,
|
||||
"vertexai-temperature":: 0.0,
|
||||
"vertexai-models":: models,
|
||||
|
||||
"llm-models" +:: $["vertexai-models"],
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local cfgVol = engine.secretVolume(
|
||||
"vertexai-creds",
|
||||
"./vertexai",
|
||||
{
|
||||
"private.json": importstr "vertexai/private.json",
|
||||
}
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_vertexai)
|
||||
.with_command([
|
||||
"text-completion-vertexai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"-k",
|
||||
$["vertexai-private-key"],
|
||||
"-r",
|
||||
$["vertexai-region"],
|
||||
"-x",
|
||||
std.toString($["vertexai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["vertexai-temperature"],
|
||||
])
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_volume_mount(cfgVol, "/vertexai");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local cfgVol = engine.secretVolume(
|
||||
"vertexai-creds",
|
||||
"./vertexai",
|
||||
{
|
||||
"private.json": importstr "vertexai/private.json",
|
||||
}
|
||||
);
|
||||
|
||||
local container =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_vertexai)
|
||||
.with_command([
|
||||
"text-completion-vertexai",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"-k",
|
||||
$["vertexai-private-key"],
|
||||
"-r",
|
||||
$["vertexai-region"],
|
||||
"-x",
|
||||
std.toString($["vertexai-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["vertexai-temperature"],
|
||||
])
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_volume_mount(cfgVol, "/vertexai");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion-rag", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
cfgVol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,66 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["vllm-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"vllm-service-model":: "teknium/OpenHermes-2.5-Mistral-7B",
|
||||
"vllm-service-cpus":: "64.0",
|
||||
"vllm-service-memory":: "64G",
|
||||
|
||||
"vllm-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("vllm-storage").with_size("50G");
|
||||
|
||||
local container =
|
||||
engine.container("vllm-service")
|
||||
.with_image(images["vllm-service-gaudi"])
|
||||
.with_command([
|
||||
"--model",
|
||||
$["vllm-service-model"],
|
||||
"--tensor-parallel-size=8",
|
||||
"--port",
|
||||
"8899",
|
||||
])
|
||||
.with_runtime("habana")
|
||||
.with_environment({
|
||||
VLLM_SKIP_WARMUP: "true",
|
||||
HUGGING_FACE_HUB_TOKEN: $["hf-token"],
|
||||
HABANA_VISIBLE_DEVICES: "all",
|
||||
VLLM_CACHE_ROOT: "/data",
|
||||
})
|
||||
.with_privileged(true)
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "vllm")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"vllm-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "vllm");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,77 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["vllm-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"vllm-service-model":: "teknium/OpenHermes-2.5-Mistral-7B",
|
||||
"vllm-service-cpus":: "8.0",
|
||||
"vllm-service-memory":: "16G",
|
||||
|
||||
"vllm-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("vllm-storage").with_size("20G");
|
||||
|
||||
local container =
|
||||
engine.container("vllm-service")
|
||||
.with_image(images["vllm-service-intel-xpu"])
|
||||
.with_command([
|
||||
"python",
|
||||
"-m",
|
||||
"vllm.entrypoints.openai.api_server",
|
||||
"--model",
|
||||
$["vllm-service-model"],
|
||||
"--dtype=float16",
|
||||
"--device=xpu",
|
||||
"--enforce-eager",
|
||||
"--port",
|
||||
"8899",
|
||||
"--block-size",
|
||||
"64",
|
||||
"--gpu-memory-util",
|
||||
"0.85",
|
||||
"--trust-remote-code",
|
||||
"--disable-sliding-window",
|
||||
])
|
||||
.with_environment({
|
||||
HF_TOKEN: $["hf-token"],
|
||||
VLLM_USE_V1: "1",
|
||||
W_LONG_MAX_MODEL_LEN: "1",
|
||||
VLLM_WORKER_MULTIPROC_METHOD: "spawn",
|
||||
})
|
||||
.with_privileged(true)
|
||||
.with_device("/dev/dri", "/dev/dri")
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "vllm")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"vllm-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "vllm");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["vllm-service-" + key]:: value,
|
||||
},
|
||||
|
||||
"vllm-service-model":: "mistralai/Mistral-7B-Instruct-v0.3",
|
||||
"vllm-service-cpus":: "0.5",
|
||||
"vllm-service-memory":: "1G",
|
||||
|
||||
"vllm-service" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local vol = engine.volume("vllm-storage").with_size("50G");
|
||||
|
||||
local container =
|
||||
engine.container("vllm-service")
|
||||
.with_image(images["vllm-service-nvidia"])
|
||||
.with_command([
|
||||
"--model",
|
||||
$["vllm-service-model"],
|
||||
"--port",
|
||||
"8899",
|
||||
])
|
||||
.with_runtime("nvidia")
|
||||
.with_environment({
|
||||
VLLM_SKIP_WARMUP: "true",
|
||||
HUGGING_FACE_HUB_TOKEN: $["hf-token"],
|
||||
VLLM_CACHE_ROOT: "/data",
|
||||
})
|
||||
.with_privileged(true)
|
||||
.with_ipc("host")
|
||||
.with_capability("SYS_NICE")
|
||||
.with_limits(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_reservations(
|
||||
$["vllm-service-cpus"], $["vllm-service-memory"]
|
||||
)
|
||||
.with_port(8899, 8899, "vllm")
|
||||
.with_volume_mount(vol, "/data");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"vllm-service", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.service(containerSet)
|
||||
.with_port(8899, 8899, "vllm");
|
||||
|
||||
engine.resources([
|
||||
vol,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
110
trustgraph_configurator/templates/1.6/components/vllm.jsonnet
Normal file
110
trustgraph_configurator/templates/1.6/components/vllm.jsonnet
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
local prompts = import "prompts/mixtral.jsonnet";
|
||||
local models = import "parameters/vllm.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
with:: function(key, value)
|
||||
self + {
|
||||
["vllm-" + key]:: value,
|
||||
},
|
||||
|
||||
"vllm-models":: models,
|
||||
|
||||
"llm-models" +:: $["vllm-models"],
|
||||
|
||||
"vllm-max-output-tokens":: 1024,
|
||||
"vllm-temperature":: 0.0,
|
||||
|
||||
"text-completion" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("vllm-credentials")
|
||||
.with_env_var("VLLM_BASE_URL", "vllm-url");
|
||||
|
||||
local container =
|
||||
engine.container("text-completion")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-vllm",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-concurrency"]),
|
||||
"-x",
|
||||
std.toString($["vllm-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["vllm-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"text-completion", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
"text-completion-rag" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local envSecrets = engine.envSecrets("vllm-credentials")
|
||||
.with_env_var("VLLM_BASE_URL", "vllm-url");
|
||||
|
||||
local containerRag =
|
||||
engine.container("text-completion-rag")
|
||||
.with_image(images.trustgraph_flow)
|
||||
.with_command([
|
||||
"text-completion-vllm",
|
||||
"-p",
|
||||
url.pulsar,
|
||||
"--id",
|
||||
"text-completion-rag",
|
||||
"--concurrency",
|
||||
std.toString($["text-completion-rag-concurrency"]),
|
||||
"-x",
|
||||
std.toString($["vllm-max-output-tokens"]),
|
||||
"-t",
|
||||
"%0.3f" % $["vllm-temperature"],
|
||||
"--log-level",
|
||||
$["log-level"],
|
||||
])
|
||||
.with_env_var_secrets(envSecrets)
|
||||
.with_limits("0.5", "128M")
|
||||
.with_reservations("0.1", "128M");
|
||||
|
||||
local containerSetRag = engine.containers(
|
||||
"text-completion-rag", [ containerRag ]
|
||||
);
|
||||
|
||||
local serviceRag =
|
||||
engine.internalService(containerSetRag)
|
||||
.with_port(8000, 8000, "metrics");
|
||||
|
||||
engine.resources([
|
||||
envSecrets,
|
||||
containerSetRag,
|
||||
serviceRag,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
} + prompts
|
||||
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
local images = import "values/images.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"workbench-ui" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local container =
|
||||
engine.container("workbench-ui")
|
||||
.with_image(images["workbench-ui"])
|
||||
.with_limits("0.1", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_port(8888, 8888, "ui");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"workbench-ui", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(8888, 8888, "ui");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
local engine = import "engine/aks-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
local engine = import "engine/docker-compose.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resources = std.foldl(
|
||||
function(state, p) state + p.create(engine),
|
||||
std.objectValues(patterns),
|
||||
{}
|
||||
);
|
||||
|
||||
resources
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
local engine = import "engine/eks-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
local engine = import "engine/gcp-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
|
||||
local engine = import "engine/minikube-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
// Extract resources using the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
20
trustgraph_configurator/templates/1.6/config-to-noop.jsonnet
Normal file
20
trustgraph_configurator/templates/1.6/config-to-noop.jsonnet
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
local engine = import "engine/noop.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resources = std.foldl(
|
||||
function(state, p) state + p.create(engine),
|
||||
std.objectValues(patterns),
|
||||
{}
|
||||
);
|
||||
|
||||
resources
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
local engine = import "engine/ovh-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
|
||||
local engine = import "engine/docker-compose.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resources = std.foldl(
|
||||
function(state, p) state + p.create(engine),
|
||||
std.objectValues(patterns),
|
||||
{}
|
||||
);
|
||||
|
||||
resources
|
||||
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
|
||||
local engine = import "engine/scw-k8s.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract resources usnig the engine
|
||||
local resourceList = engine.package(patterns);
|
||||
|
||||
resourceList
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
|
||||
local engine = import "engine/noop.jsonnet";
|
||||
local decode = import "util/decode-config.jsonnet";
|
||||
local components = import "components.jsonnet";
|
||||
|
||||
// Import config
|
||||
local config = import "config.json";
|
||||
|
||||
// Produce patterns from config
|
||||
local patterns = decode(config);
|
||||
|
||||
// Extract configuration directly from patterns
|
||||
patterns.configuration.configuration
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
// Configuration Composer Module
|
||||
// Orchestrates the complete configuration building process
|
||||
// Combines all components into the final TrustGraph configuration
|
||||
|
||||
local flow_builder = import "flow-builder.jsonnet";
|
||||
local interface_builder = import "interface-builder.jsonnet";
|
||||
|
||||
{
|
||||
// Main function to build the complete configuration
|
||||
build: function(config_spec)
|
||||
// Extract configuration parameters
|
||||
local flow_classes = config_spec.flow_classes;
|
||||
local default_flow_class = config_spec.default_flow_class;
|
||||
local default_flow_id = config_spec.default_flow_id;
|
||||
local flow_init_parameters = config_spec.flow_init_parameters;
|
||||
|
||||
// Build all processors for the default flow
|
||||
local class_processors = flow_builder.build_class_processors(
|
||||
flow_classes,
|
||||
default_flow_class,
|
||||
flow_init_parameters
|
||||
);
|
||||
|
||||
local flow_processors = flow_builder.build_flow_processors(
|
||||
flow_classes,
|
||||
default_flow_class,
|
||||
default_flow_id,
|
||||
flow_init_parameters
|
||||
);
|
||||
|
||||
// Combine processors into flow objects
|
||||
local processor_array = class_processors + flow_processors;
|
||||
local flow_objects = flow_builder.build_flow_objects(processor_array);
|
||||
local flows_active = flow_builder.merge_flow_objects(flow_objects);
|
||||
|
||||
// Build interfaces for the default flow
|
||||
local default_flow_interfaces = interface_builder.build_interfaces(
|
||||
flow_classes,
|
||||
default_flow_class,
|
||||
default_flow_id,
|
||||
flow_init_parameters
|
||||
);
|
||||
|
||||
// Return object with nested configuration (for backwards compatibility)
|
||||
{
|
||||
// Create function (for backwards compatibility)
|
||||
create: function(engine) {},
|
||||
|
||||
// The actual configuration object
|
||||
configuration: {
|
||||
// Prompts configuration
|
||||
prompt: {
|
||||
"system": config_spec.prompts["system-template"],
|
||||
"template-index": std.objectFieldsAll(config_spec.prompts.templates),
|
||||
} + {
|
||||
["template." + template.key]: template.value
|
||||
for template in std.objectKeysValuesAll(config_spec.prompts.templates)
|
||||
},
|
||||
|
||||
// Tools configuration
|
||||
tool: {
|
||||
[tool.id]: tool
|
||||
for tool in config_spec.tools
|
||||
},
|
||||
|
||||
// MCP configuration
|
||||
mcp: config_spec.mcp,
|
||||
|
||||
// Flow classes reference
|
||||
"flow-classes": flow_classes,
|
||||
|
||||
// Interface descriptions
|
||||
"interface-descriptions": config_spec.interface_descriptions,
|
||||
|
||||
// Flow instances
|
||||
"flows": {
|
||||
[default_flow_id]: {
|
||||
"description": "Default processing flow",
|
||||
"class-name": default_flow_class,
|
||||
"interfaces": default_flow_interfaces,
|
||||
"parameters": flow_init_parameters,
|
||||
},
|
||||
},
|
||||
|
||||
// Active flow processors
|
||||
"flows-active": flows_active,
|
||||
|
||||
// Token costs and parameter types
|
||||
"token-costs": config_spec.token_costs,
|
||||
"parameter-types": config_spec.parameter_types,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
// Flow Builder Module
|
||||
// Processes flow classes and builds complete flow configurations
|
||||
// Handles {class}, {id}, and parameter substitutions
|
||||
|
||||
local param_processor = import "parameter-processor.jsonnet";
|
||||
|
||||
{
|
||||
// Builds class-level processors with parameter substitution
|
||||
// Processes the 'class' section of flow classes
|
||||
build_class_processors: function(flow_classes, class_name, parameters)
|
||||
[
|
||||
[
|
||||
// Replace {class} in the processor key
|
||||
local key = std.strReplace(processor.key, "{class}", class_name);
|
||||
local parts = std.splitLimit(key, ":", 2);
|
||||
parts,
|
||||
{
|
||||
// Process each field in the processor configuration
|
||||
[field.key]:
|
||||
// First replace {class}, then substitute parameters
|
||||
local class_replaced = std.strReplace(field.value, "{class}", class_name);
|
||||
param_processor.substitute_parameters(class_replaced, parameters)
|
||||
for field in std.objectKeysValuesAll(processor.value)
|
||||
}
|
||||
]
|
||||
for processor in std.objectKeysValuesAll(flow_classes[class_name].class)
|
||||
],
|
||||
|
||||
// Builds flow-level processors with parameter substitution
|
||||
// Processes the 'flow' section of flow classes
|
||||
build_flow_processors: function(flow_classes, class_name, flow_id, parameters)
|
||||
[
|
||||
[
|
||||
// Replace both {class} and {id} in the processor key
|
||||
local key = std.strReplace(
|
||||
std.strReplace(processor.key, "{class}", class_name),
|
||||
"{id}", flow_id
|
||||
);
|
||||
local parts = std.splitLimit(key, ":", 2);
|
||||
parts,
|
||||
{
|
||||
// Process each field in the processor configuration
|
||||
[field.key]:
|
||||
// Replace {class} and {id}, then substitute parameters
|
||||
local class_replaced = std.strReplace(field.value, "{class}", class_name);
|
||||
local id_replaced = std.strReplace(class_replaced, "{id}", flow_id);
|
||||
param_processor.substitute_parameters(id_replaced, parameters)
|
||||
for field in std.objectKeysValuesAll(processor.value)
|
||||
}
|
||||
]
|
||||
for processor in std.objectKeysValuesAll(flow_classes[class_name].flow)
|
||||
],
|
||||
|
||||
// Combines class and flow processors into flow objects
|
||||
build_flow_objects: function(processor_array)
|
||||
std.map(
|
||||
function(item) {
|
||||
[item[0][0]] +: {
|
||||
[item[0][1]]: item[1]
|
||||
}
|
||||
},
|
||||
processor_array
|
||||
),
|
||||
|
||||
// Merges all flow objects into a single flows_active configuration
|
||||
merge_flow_objects: function(flow_objects)
|
||||
std.foldr(
|
||||
function(a, b) a + b,
|
||||
flow_objects,
|
||||
{}
|
||||
),
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// Interface Builder Module
|
||||
// Processes flow class interfaces with parameter substitution
|
||||
// Handles both string interfaces and nested object interfaces
|
||||
|
||||
local param_processor = import "parameter-processor.jsonnet";
|
||||
|
||||
{
|
||||
// Builds interfaces for a specific flow class and instance
|
||||
// Processes the 'interfaces' section of flow classes
|
||||
build_interfaces: function(flow_classes, class_name, flow_id, parameters)
|
||||
local interface_spec = flow_classes[class_name].interfaces;
|
||||
{
|
||||
[interface.key]:
|
||||
if std.isString(interface.value) then
|
||||
// Simple string interface - apply all substitutions
|
||||
local class_replaced = std.strReplace(interface.value, "{class}", class_name);
|
||||
local id_replaced = std.strReplace(class_replaced, "{id}", flow_id);
|
||||
param_processor.substitute_parameters(id_replaced, parameters)
|
||||
else
|
||||
// Complex object interface - process nested fields
|
||||
{
|
||||
[field.key]:
|
||||
local class_replaced = std.strReplace(field.value, "{class}", class_name);
|
||||
local id_replaced = std.strReplace(class_replaced, "{id}", flow_id);
|
||||
param_processor.substitute_parameters(id_replaced, parameters)
|
||||
for field in std.objectKeysValuesAll(interface.value)
|
||||
}
|
||||
for interface in std.objectKeysValuesAll(interface_spec)
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,89 @@
|
|||
// Interface Descriptions Module
|
||||
// Defines all external interfaces available in TrustGraph flows
|
||||
// These are the 'endpoints' that external systems can interact with
|
||||
|
||||
{
|
||||
// Document loading interfaces - for data ingestion
|
||||
"document-load": {
|
||||
"description": "Document loader",
|
||||
"kind": "send",
|
||||
"visible": true,
|
||||
},
|
||||
"text-load": {
|
||||
"description": "Text document loader",
|
||||
"kind": "send",
|
||||
"visible": true,
|
||||
},
|
||||
|
||||
// Data storage interfaces - for processed data streams
|
||||
"entity-contexts-load": {
|
||||
"description": "Entity contexts loader",
|
||||
"kind": "send",
|
||||
},
|
||||
"triples-store": {
|
||||
"description": "Triples loader",
|
||||
"kind": "send",
|
||||
},
|
||||
"graph-embeddings-store": {
|
||||
"description": "Graph embeddings loader",
|
||||
"kind": "send",
|
||||
},
|
||||
"document-embeddings-store": {
|
||||
"description": "Document embeddings loader",
|
||||
"kind": "send",
|
||||
},
|
||||
"objects-store": {
|
||||
"description": "Object store",
|
||||
"kind": "request-response",
|
||||
},
|
||||
|
||||
// Query interfaces - for retrieving information
|
||||
"graph-rag": {
|
||||
"description": "GraphRAG service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"document-rag": {
|
||||
"description": "ChunkRAG service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"triples": {
|
||||
"description": "Triples query service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"graph-embeddings": {
|
||||
"description": "Graph embeddings service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"document-embeddings": {
|
||||
"description": "Document embeddings service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"objects": {
|
||||
"description": "Object query service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
|
||||
// Processing services - for text and data processing
|
||||
"prompt": {
|
||||
"description": "Prompt service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"agent": {
|
||||
"description": "Agent service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"text-completion": {
|
||||
"description": "Text completion service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
|
||||
// Query translation services - for natural language queries
|
||||
"nlp-query": {
|
||||
"description": "NLP question to GraphQL service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
"structured-query": {
|
||||
"description": "Structured query service",
|
||||
"kind": "request-response",
|
||||
},
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
// Parameter Processing Module
|
||||
// Handles dynamic parameter replacement in configuration values
|
||||
// Replaces {parameter_name} placeholders with actual parameter values
|
||||
|
||||
{
|
||||
// Applies parameter substitutions to string values
|
||||
// Only processes strings - leaves other types unchanged
|
||||
substitute_parameters: function(value, parameters)
|
||||
if std.isString(value) then
|
||||
std.foldl(
|
||||
function(acc, param)
|
||||
// Only do string replacement if param.value is a string
|
||||
if std.isString(param.value) then
|
||||
std.strReplace(acc, "{" + param.key + "}", param.value)
|
||||
else
|
||||
acc, // Skip replacement for non-string parameter values
|
||||
std.objectKeysValuesAll(parameters),
|
||||
value
|
||||
)
|
||||
else
|
||||
value,
|
||||
|
||||
// Applies parameter substitutions to all values in an object
|
||||
// Recursively processes nested objects and arrays
|
||||
substitute_parameters_in_object: function(obj, parameters)
|
||||
if std.isObject(obj) then
|
||||
{
|
||||
[key]: $.substitute_parameters_in_object(obj[key], parameters)
|
||||
for key in std.objectFields(obj)
|
||||
}
|
||||
else if std.isArray(obj) then
|
||||
[
|
||||
$.substitute_parameters_in_object(item, parameters)
|
||||
for item in obj
|
||||
]
|
||||
else
|
||||
$.substitute_parameters(obj, parameters),
|
||||
}
|
||||
52
trustgraph_configurator/templates/1.6/config/tools.jsonnet
Normal file
52
trustgraph_configurator/templates/1.6/config/tools.jsonnet
Normal file
|
|
@ -0,0 +1,52 @@
|
|||
// Tools Configuration Module
|
||||
// Defines all available tools that can be used by agents and flows
|
||||
// Each tool specifies its interface, arguments, and behavior
|
||||
|
||||
[
|
||||
// Knowledge extraction tool - extracts structured knowledge from text
|
||||
{
|
||||
id: "knowledge-extraction",
|
||||
name: "Knowledge extraction",
|
||||
description: "Takes a chunk of text and extracts knowledge in definition and relationship formats. The input is a text chunk",
|
||||
type: "prompt",
|
||||
template: "agent-kg-extract",
|
||||
arguments: [
|
||||
{
|
||||
"name": "text",
|
||||
"type": "string",
|
||||
"description": "The text chunk",
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
// Knowledge query tool - queries the knowledge base
|
||||
{
|
||||
id: "knowledge-query",
|
||||
name: "Knowledge query",
|
||||
description: "This tool queries a knowledge base that holds information about domain-specific information. The question should be a natural language question.",
|
||||
type: "knowledge-query",
|
||||
collection: "default",
|
||||
arguments: [
|
||||
{
|
||||
name: "question",
|
||||
type: "string",
|
||||
description: "A simple natural language question.",
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// LLM completion tool - general purpose text completion
|
||||
{
|
||||
id: "llm-completion",
|
||||
name: "LLM text completion",
|
||||
type: "text-completion",
|
||||
description: "This tool queries an LLM for non-domain-specific information. The question should be a natural language question.",
|
||||
arguments: [
|
||||
{
|
||||
name: "question",
|
||||
type: "string",
|
||||
description: "The question which should be asked of the LLM.",
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
45
trustgraph_configurator/templates/1.6/engine/aks-k8s.jsonnet
Normal file
45
trustgraph_configurator/templates/1.6/engine/aks-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "disk.csi.azure.com",
|
||||
parameters: {
|
||||
// Standard disks (spinning magnetic), Locally Redundant Storage
|
||||
// Cheapest, basically
|
||||
skuName: "Standard_LRS",
|
||||
},
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [sc, ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: resources,
|
||||
};
|
||||
resourceList
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,230 @@
|
|||
{
|
||||
|
||||
// Extract resources using the engine
|
||||
package:: function(patterns)
|
||||
std.foldl(
|
||||
function(state, p) state + p.create(self),
|
||||
std.objectValues(patterns),
|
||||
{}
|
||||
),
|
||||
|
||||
container:: function(name)
|
||||
{
|
||||
|
||||
local container = self,
|
||||
|
||||
name:: name,
|
||||
|
||||
with_image:: function(x) self + { image: x },
|
||||
|
||||
with_user:: function(x) self + { user: x },
|
||||
|
||||
with_command:: function(x) self + { command: x },
|
||||
|
||||
with_runtime:: function(x) self + { runtime: x },
|
||||
|
||||
with_privileged:: function(x) self + { privileged: x },
|
||||
|
||||
with_ipc:: function(x) self + { ipc: x },
|
||||
|
||||
with_capability:: function(x) self +
|
||||
if std.objectHas(container, "capability") then
|
||||
{ cap_add: container.capability + x }
|
||||
else
|
||||
{ cap_add: [x], },
|
||||
|
||||
with_environment:: function(x) self +
|
||||
if std.objectHas(container, "environment") then
|
||||
{ environment: container.environment + x }
|
||||
else
|
||||
{ environment: x, },
|
||||
|
||||
with_device:: function(hdev, cdev) self +
|
||||
if std.objectHas(container, "devices") then
|
||||
{ devices: container.devices + "%s:%s" % [hdev, cdev] }
|
||||
else
|
||||
{ devices: [ "%s:%s" % [hdev, cdev] ], },
|
||||
|
||||
with_limits:: function(c, m) self + {
|
||||
deploy +: { resources +: {
|
||||
limits: { cpus: c, memory: m }
|
||||
} },
|
||||
},
|
||||
|
||||
with_reservations:: function(c, m) self + {
|
||||
deploy +: { resources +: {
|
||||
reservations: { cpus: c, memory: m }
|
||||
} },
|
||||
},
|
||||
|
||||
with_volume_mount::
|
||||
function(vol, mnt)
|
||||
self + {
|
||||
volumes:
|
||||
if std.objectHas(container, "volumes") then
|
||||
container.volumes + [
|
||||
"%s:%s" % [vol.volid, mnt]
|
||||
]
|
||||
else
|
||||
[
|
||||
"%s:%s" % [vol.volid, mnt]
|
||||
]
|
||||
},
|
||||
|
||||
with_port::
|
||||
function(src, dest, name)
|
||||
self + {
|
||||
ports:
|
||||
if std.objectHas(container, "ports") then
|
||||
container.ports + [ "%d:%d" % [src, dest] ]
|
||||
else
|
||||
[ "%d:%d" % [src, dest] ]
|
||||
},
|
||||
|
||||
with_env_var_secrets::
|
||||
function(vars)
|
||||
std.foldl(
|
||||
function(obj, x) obj.with_environment(
|
||||
{ [x]: "${" + x + "}" }
|
||||
),
|
||||
vars.variables,
|
||||
self
|
||||
),
|
||||
|
||||
restart: "on-failure:100",
|
||||
|
||||
add:: function() {
|
||||
services +: {
|
||||
[container.name]: container,
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
internalService:: function(containers)
|
||||
{
|
||||
|
||||
local service = self,
|
||||
|
||||
name: containers.name,
|
||||
|
||||
with_port:: function(src, dest, name)
|
||||
self + { port: [src, dest] },
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
service:: function(containers)
|
||||
{
|
||||
|
||||
local service = self,
|
||||
|
||||
name: containers.name,
|
||||
|
||||
with_port:: function(src, dest, name)
|
||||
self + { port: [src, dest] },
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
volume:: function(name)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
volid:: name,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() {
|
||||
volumes +: {
|
||||
[volume.name]: {}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
configVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: dir,
|
||||
|
||||
volid:: "./" + dir,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
secretVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: dir,
|
||||
|
||||
volid:: dir,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
envSecrets:: function(name)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
volid:: name,
|
||||
|
||||
variables:: [],
|
||||
|
||||
with_env_var::
|
||||
function(name, key) self + {
|
||||
variables: super.variables + [name],
|
||||
},
|
||||
|
||||
add:: function() {
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
containers:: function(name, containers)
|
||||
{
|
||||
|
||||
local cont = self,
|
||||
|
||||
name: name,
|
||||
containers: containers,
|
||||
|
||||
add:: function() std.foldl(
|
||||
function(state, c) state + c.add(),
|
||||
cont.containers,
|
||||
{}
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
resources:: function(res)
|
||||
std.foldl(
|
||||
function(state, c) state + c.add(),
|
||||
res,
|
||||
{}
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
46
trustgraph_configurator/templates/1.6/engine/eks-k8s.jsonnet
Normal file
46
trustgraph_configurator/templates/1.6/engine/eks-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "ebs.csi.aws.com",
|
||||
parameters: {
|
||||
type: "gp3",
|
||||
encrypted: "true",
|
||||
iops: "6000",
|
||||
throughput: "400",
|
||||
},
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [sc, ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: resources,
|
||||
};
|
||||
resourceList
|
||||
|
||||
}
|
||||
|
||||
44
trustgraph_configurator/templates/1.6/engine/gcp-k8s.jsonnet
Normal file
44
trustgraph_configurator/templates/1.6/engine/gcp-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "pd.csi.storage.gke.io",
|
||||
parameters: {
|
||||
type: "pd-balanced",
|
||||
"csi.storage.k8s.io/fstype": "ext4",
|
||||
},
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [sc, ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: resources,
|
||||
};
|
||||
resourceList
|
||||
|
||||
}
|
||||
|
||||
358
trustgraph_configurator/templates/1.6/engine/k8s.jsonnet
Normal file
358
trustgraph_configurator/templates/1.6/engine/k8s.jsonnet
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
{
|
||||
|
||||
container:: function(name)
|
||||
{
|
||||
|
||||
local container = self,
|
||||
|
||||
name: name,
|
||||
limits: {},
|
||||
reservations: {},
|
||||
ports: [],
|
||||
volumes: [],
|
||||
environment: [],
|
||||
|
||||
with_image:: function(x) self + { image: x },
|
||||
|
||||
with_user:: function(x) self + { user: x },
|
||||
|
||||
with_command:: function(x) self + { command: x },
|
||||
|
||||
with_environment:: function(x) self + {
|
||||
environment: super.environment + [
|
||||
{
|
||||
name: v.key, value: v.value
|
||||
}
|
||||
for v in std.objectKeysValues(x)
|
||||
],
|
||||
},
|
||||
|
||||
with_limits:: function(c, m) self + { limits: { cpu: c, memory: m } },
|
||||
|
||||
with_reservations::
|
||||
function(c, m) self + { reservations: { cpu: c, memory: m } },
|
||||
|
||||
with_volume_mount::
|
||||
function(vol, mnt)
|
||||
self + {
|
||||
volumes: super.volumes + [{
|
||||
volume: vol, mount: mnt
|
||||
}]
|
||||
},
|
||||
|
||||
with_port::
|
||||
function(src, dest, name) self + {
|
||||
ports: super.ports + [
|
||||
{ src: src, dest: dest, name : name }
|
||||
]
|
||||
},
|
||||
|
||||
with_env_var_secrets::
|
||||
function(vars)
|
||||
std.foldl(
|
||||
function(obj, x) obj + {
|
||||
environment: super.environment + [{
|
||||
name: x,
|
||||
valueFrom: {
|
||||
secretKeyRef: {
|
||||
name: vars.name,
|
||||
key: vars.keyMap[x],
|
||||
}
|
||||
}
|
||||
}]
|
||||
},
|
||||
vars.variables,
|
||||
self
|
||||
),
|
||||
|
||||
add:: function() [
|
||||
|
||||
{
|
||||
apiVersion: "apps/v1",
|
||||
kind: "Deployment",
|
||||
metadata: {
|
||||
name: container.name,
|
||||
namespace: "trustgraph",
|
||||
labels: {
|
||||
app: container.name
|
||||
}
|
||||
},
|
||||
spec: {
|
||||
replicas: 1,
|
||||
selector: {
|
||||
matchLabels: {
|
||||
app: container.name,
|
||||
}
|
||||
},
|
||||
template: {
|
||||
metadata: {
|
||||
labels: {
|
||||
app: container.name,
|
||||
}
|
||||
},
|
||||
spec: {
|
||||
containers: [
|
||||
{
|
||||
name: container.name,
|
||||
image: container.image,
|
||||
|
||||
// FIXME: Make everything run as
|
||||
// root. Needed to get filesystems
|
||||
// to be accessible. There's a
|
||||
// better way of doing this?
|
||||
securityContext: {
|
||||
runAsUser: 0,
|
||||
runAsGroup: 0,
|
||||
},
|
||||
|
||||
resources: {
|
||||
requests: container.reservations,
|
||||
limits: container.limits
|
||||
},
|
||||
} + (
|
||||
if std.length(container.ports) > 0 then
|
||||
{
|
||||
ports: [
|
||||
{
|
||||
hostPort: port.src,
|
||||
containerPort: port.dest,
|
||||
}
|
||||
for port in container.ports
|
||||
]
|
||||
} else
|
||||
{}) +
|
||||
|
||||
(if std.objectHas(container, "command") then
|
||||
{ command: container.command }
|
||||
else {}) +
|
||||
|
||||
(if std.length(container.environment) > 0 then
|
||||
{
|
||||
env: container.environment,
|
||||
}
|
||||
else {}) +
|
||||
|
||||
(if std.length(container.volumes) > 0 then
|
||||
{
|
||||
volumeMounts: [
|
||||
{
|
||||
mountPath: vol.mount,
|
||||
name: vol.volume.name,
|
||||
}
|
||||
for vol in container.volumes
|
||||
]
|
||||
}
|
||||
|
||||
else
|
||||
{}
|
||||
)
|
||||
],
|
||||
volumes: [
|
||||
vol.volume.volRef()
|
||||
for vol in container.volumes
|
||||
|
||||
]
|
||||
}
|
||||
},
|
||||
} + {}
|
||||
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
},
|
||||
|
||||
// Just an alias
|
||||
internalService:: self.service,
|
||||
|
||||
service:: function(containers)
|
||||
{
|
||||
|
||||
local service = self,
|
||||
|
||||
name: containers.name,
|
||||
|
||||
ports: [],
|
||||
|
||||
with_port::
|
||||
function(src, dest, name)
|
||||
self + {
|
||||
ports: super.ports + [
|
||||
{ src: src, dest: dest, name: name }
|
||||
]
|
||||
},
|
||||
|
||||
add:: function() [
|
||||
|
||||
{
|
||||
|
||||
apiVersion: "v1",
|
||||
kind: "Service",
|
||||
metadata: {
|
||||
name: service.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
spec: {
|
||||
selector: {
|
||||
app: service.name,
|
||||
},
|
||||
ports: [
|
||||
{
|
||||
port: port.src,
|
||||
targetPort: port.dest,
|
||||
name: port.name,
|
||||
}
|
||||
for port in service.ports
|
||||
],
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
volume:: function(name)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() [
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "PersistentVolumeClaim",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
spec: {
|
||||
storageClassName: "tg",
|
||||
accessModes: [ "ReadWriteOnce" ],
|
||||
resources: {
|
||||
requests: {
|
||||
storage: volume.size,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
persistentVolumeClaim: { claimName: volume.name },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
configVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() [
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "ConfigMap",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
data: parts
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
configMap: { name: volume.name },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
secretVolume:: function(name, dir, parts)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() [
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "Secret",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
data: {
|
||||
[item.key]: std.base64(item.value)
|
||||
for item in std.objectKeysValues(parts)
|
||||
}
|
||||
},
|
||||
],
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
secret: { secretName: volume.name },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
envSecrets:: function(name)
|
||||
{
|
||||
|
||||
local volume = self,
|
||||
|
||||
name: name,
|
||||
|
||||
variables: [],
|
||||
keyMap: {},
|
||||
|
||||
with_size:: function(size) self + { size: size },
|
||||
|
||||
add:: function() [
|
||||
],
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
secret: { secretName: volume.name },
|
||||
},
|
||||
|
||||
with_env_var::
|
||||
function(name, key) self + {
|
||||
variables: super.variables + [name],
|
||||
keyMap: super.keyMap + { [name]: key },
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
containers:: function(name, containers)
|
||||
{
|
||||
|
||||
local cont = self,
|
||||
|
||||
name: name,
|
||||
containers: containers,
|
||||
|
||||
add:: function() std.flattenArrays(
|
||||
[ c.add() for c in cont.containers ]
|
||||
),
|
||||
|
||||
},
|
||||
|
||||
resources:: function(res)
|
||||
|
||||
std.flattenArrays(
|
||||
[ c.add() for c in res ]
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,115 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: resources,
|
||||
};
|
||||
resourceList,
|
||||
|
||||
volume:: function(name)
|
||||
{
|
||||
local volume = self,
|
||||
name: name,
|
||||
with_size:: function(size) self + { size: size },
|
||||
add:: function() [
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "PersistentVolume",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
},
|
||||
spec: {
|
||||
accessModes: [ "ReadWriteOnce" ],
|
||||
capacity: {
|
||||
storage: volume.size,
|
||||
},
|
||||
persistentVolumeReclaimPolicy: "Delete",
|
||||
hostPath: {
|
||||
path: "/data/pv-" + volume.name,
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "PersistentVolumeClaim",
|
||||
metadata: {
|
||||
name: volume.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
spec: {
|
||||
accessModes: [ "ReadWriteOnce" ],
|
||||
resources: {
|
||||
requests: {
|
||||
storage: volume.size,
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
volRef:: function() {
|
||||
name: volume.name,
|
||||
persistentVolumeClaim: { claimName: volume.name },
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
service:: function(containers)
|
||||
{
|
||||
local service = self,
|
||||
name: containers.name,
|
||||
ports: [],
|
||||
with_port::
|
||||
function(src, dest, name)
|
||||
self + {
|
||||
ports: super.ports + [
|
||||
{ src: src, dest: dest, name: name }
|
||||
]
|
||||
},
|
||||
add:: function() [
|
||||
{
|
||||
apiVersion: "v1",
|
||||
kind: "Service",
|
||||
metadata: {
|
||||
name: service.name,
|
||||
namespace: "trustgraph",
|
||||
},
|
||||
spec: {
|
||||
selector: {
|
||||
app: service.name,
|
||||
},
|
||||
type: "LoadBalancer",
|
||||
ports: [
|
||||
{
|
||||
port: port.src,
|
||||
targetPort: port.dest,
|
||||
name: port.name,
|
||||
}
|
||||
for port in service.ports
|
||||
],
|
||||
}
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
79
trustgraph_configurator/templates/1.6/engine/noop.jsonnet
Normal file
79
trustgraph_configurator/templates/1.6/engine/noop.jsonnet
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
{
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns) {},
|
||||
|
||||
container:: function(name) {
|
||||
|
||||
with_image:: function(x) self + {},
|
||||
|
||||
with_user:: function(x) self + {},
|
||||
|
||||
with_command:: function(x) self + {},
|
||||
|
||||
with_runtime:: function(x) self + {},
|
||||
|
||||
with_privileged:: function(x) self + {},
|
||||
|
||||
with_ipc:: function(x) self + {},
|
||||
|
||||
with_capability:: function(x) self + {},
|
||||
|
||||
with_environment:: function(x) self + {},
|
||||
|
||||
with_device:: function(hdev, cdev) self + {},
|
||||
|
||||
with_limits:: function(c, m) self + {},
|
||||
|
||||
with_reservations:: function(c, m) self + {},
|
||||
|
||||
with_volume_mount:: self + {},
|
||||
|
||||
with_port:: function(src, dest, name) self + {},
|
||||
|
||||
with_env_var_secrets:: function(vars) self + {},
|
||||
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
internalService:: function(containers) {
|
||||
with_port:: function(src, dest, name) self + {},
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
service:: function(containers) {
|
||||
with_port:: function(src, dest, name) self + {},
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
volume:: function(name) {
|
||||
with_size:: function(size) self + {},
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
configVolume:: function(name, dir, parts) {
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
secretVolume:: function(name, dir, parts) {
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
envSecrets:: function(name) {
|
||||
with_env_var:: function(name, key) self + {},
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
containers:: function(name, containers) {
|
||||
add:: function() {},
|
||||
},
|
||||
|
||||
resources:: function(res)
|
||||
std.foldl(
|
||||
function(state, c) state + c.add(),
|
||||
res,
|
||||
{}
|
||||
),
|
||||
|
||||
}
|
||||
|
||||
45
trustgraph_configurator/templates/1.6/engine/ovh-k8s.jsonnet
Normal file
45
trustgraph_configurator/templates/1.6/engine/ovh-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "cinder.csi.openstack.org",
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
parameters: {
|
||||
availability: "nova",
|
||||
fsType: "ext4",
|
||||
type: "high-speed",
|
||||
},
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [sc, ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: [ns, sc] + resources,
|
||||
};
|
||||
resourceList
|
||||
|
||||
}
|
||||
|
||||
40
trustgraph_configurator/templates/1.6/engine/scw-k8s.jsonnet
Normal file
40
trustgraph_configurator/templates/1.6/engine/scw-k8s.jsonnet
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
local k8s = import "k8s.jsonnet";
|
||||
|
||||
local ns = {
|
||||
apiVersion: "v1",
|
||||
kind: "Namespace",
|
||||
metadata: {
|
||||
name: "trustgraph",
|
||||
},
|
||||
"spec": {
|
||||
},
|
||||
};
|
||||
|
||||
local sc = {
|
||||
apiVersion: "storage.k8s.io/v1",
|
||||
kind: "StorageClass",
|
||||
metadata: {
|
||||
name: "tg",
|
||||
},
|
||||
provisioner: "csi.scaleway.com",
|
||||
reclaimPolicy: "Delete",
|
||||
volumeBindingMode: "WaitForFirstConsumer",
|
||||
};
|
||||
|
||||
k8s + {
|
||||
|
||||
// Extract resources usnig the engine
|
||||
package:: function(patterns)
|
||||
local resources = [sc, ns] + std.flattenArrays([
|
||||
p.create(self) for p in std.objectValues(patterns)
|
||||
]);
|
||||
local resourceList = {
|
||||
apiVersion: "v1",
|
||||
kind: "List",
|
||||
items: [ns, sc] + resources,
|
||||
};
|
||||
resourceList
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Agent-based extraction module
|
||||
// Uses AI agents for more sophisticated knowledge extraction from text
|
||||
// Leverages agent tools and reasoning for complex extraction tasks
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
|
||||
{
|
||||
// No external interfaces - internal agent extraction service
|
||||
"interfaces" +: {
|
||||
},
|
||||
|
||||
// No configurable parameters for agent extraction
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for agent-based extraction
|
||||
"flow" +: {
|
||||
// Agent-based knowledge extraction processor
|
||||
// Uses AI agents with tools to extract structured knowledge
|
||||
"kg-extract-agent:{id}": {
|
||||
input: flow("chunk-load:{id}"), // Input text chunks
|
||||
triples: flow("triples-store:{id}"), // Output knowledge triples
|
||||
"entity-contexts": flow("entity-contexts-load:{id}"), // Entity context information
|
||||
"agent-request": request("agent:{id}"), // Agent service requests
|
||||
"agent-response": response("agent:{id}"), // Agent service responses
|
||||
},
|
||||
},
|
||||
|
||||
// No class-level processors needed
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
59
trustgraph_configurator/templates/1.6/flows/agent.jsonnet
Normal file
59
trustgraph_configurator/templates/1.6/flows/agent.jsonnet
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
// Agent management module
|
||||
// Provides AI agent orchestration and tool integration
|
||||
// Manages agent conversations, tool calls, and response coordination
|
||||
// Supports MCP tools, GraphRAG, and structured queries
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
|
||||
{
|
||||
// External interfaces for agent operations
|
||||
"interfaces" +: {
|
||||
"agent": request_response("agent:{id}"), // Main agent service interface
|
||||
"mcp-tool": request_response("mcp-tool:{id}"), // MCP tool execution interface
|
||||
},
|
||||
|
||||
// No configurable parameters for agent management
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for agent management
|
||||
"flow" +: {
|
||||
// Agent manager orchestrates agent conversations and tool usage
|
||||
"agent-manager:{id}": {
|
||||
// Agent communication channels
|
||||
request: request("agent:{id}"), // Incoming agent requests
|
||||
next: request("agent:{id}"), // Multi-turn conversation support
|
||||
response: response("agent:{id}"), // Agent responses
|
||||
|
||||
// LLM and prompt services
|
||||
"text-completion-request": request("text-completion:{id}"), // LLM requests
|
||||
"text-completion-response": response("text-completion:{id}"), // LLM responses
|
||||
"prompt-request": request("prompt:{id}"), // Prompt processing
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
|
||||
// Tool integrations
|
||||
"mcp-tool-request": request("mcp-tool:{id}"), // MCP tool calls
|
||||
"mcp-tool-response": response("mcp-tool:{id}"),
|
||||
"graph-rag-request": request("graph-rag:{id}"), // GraphRAG queries
|
||||
"graph-rag-response": response("graph-rag:{id}"),
|
||||
"structured-query-request": request("structured-query:{id}"), // Structured data queries
|
||||
"structured-query-response": response("structured-query:{id}"),
|
||||
},
|
||||
|
||||
// MCP tool executor for agent tool usage
|
||||
"mcp-tool:{id}": {
|
||||
request: request("mcp-tool:{id}"), // Tool invocation requests
|
||||
response: response("mcp-tool:{id}"), // Tool execution results
|
||||
"text-completion-request": request("text-completion:{id}"), // LLM for tool reasoning
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
// Class-level processors for agent-related services
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
100
trustgraph_configurator/templates/1.6/flows/documentrag.jsonnet
Normal file
100
trustgraph_configurator/templates/1.6/flows/documentrag.jsonnet
Normal file
|
|
@ -0,0 +1,100 @@
|
|||
// Document RAG (Retrieval Augmented Generation) module
|
||||
// Implements document-based RAG using chunk embeddings
|
||||
// Provides semantic search and context-aware question answering
|
||||
// Supports MCP (Model Context Protocol) tool integration
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
local llm_parameters = import "llm-parameters.jsonnet";
|
||||
|
||||
{
|
||||
// External interfaces for document RAG functionality
|
||||
"interfaces" +: {
|
||||
// Document embedding storage and retrieval
|
||||
"document-embeddings-store": flow("document-embeddings-store:{id}"), // Embedding storage stream
|
||||
"document-rag": request_response("document-rag:{id}"), // Main document RAG interface
|
||||
"document-embeddings": request_response("document-embeddings:{id}"), // Document embedding queries
|
||||
|
||||
// Supporting services
|
||||
"embeddings": request_response("embeddings:{id}"), // General embedding service
|
||||
"prompt": request_response("prompt:{id}"), // Prompt processing
|
||||
"mcp-tool": request_response("mcp-tool:{id}"), // MCP tool integration
|
||||
"text-completion": request_response("text-completion:{id}"), // LLM text completion
|
||||
},
|
||||
|
||||
// Parameters that can be configured for this flow
|
||||
"parameters" +: llm_parameters,
|
||||
|
||||
// Flow-level processors for document embedding and storage
|
||||
"flow" +: {
|
||||
"document-embeddings:{id}": {
|
||||
input: flow("chunk-load:{id}"),
|
||||
output: flow("document-embeddings-store:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
},
|
||||
"de-write:{id}": {
|
||||
input: flow("document-embeddings-store:{id}"),
|
||||
},
|
||||
"text-completion:{id}": {
|
||||
request: request("text-completion:{id}"),
|
||||
response: response("text-completion:{id}"),
|
||||
model: "{llm-model}",
|
||||
},
|
||||
"text-completion-rag:{id}": {
|
||||
request: request("text-completion-rag:{id}"),
|
||||
response: response("text-completion-rag:{id}"),
|
||||
model: "{llm-rag-model}",
|
||||
},
|
||||
"embeddings:{id}": {
|
||||
request: request("embeddings:{id}"),
|
||||
response: response("embeddings:{id}"),
|
||||
model: "{embeddings-model}",
|
||||
},
|
||||
"document-rag:{id}": {
|
||||
request: request("document-rag:{id}"),
|
||||
response: response("document-rag:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
"prompt-request": request("prompt-rag:{id}"),
|
||||
"prompt-response": response("prompt-rag:{id}"),
|
||||
"document-embeddings-request": request("document-embeddings:{id}"),
|
||||
"document-embeddings-response": response("document-embeddings:{id}"),
|
||||
},
|
||||
"de-query:{id}": {
|
||||
request: request("document-embeddings:{id}"),
|
||||
response: response("document-embeddings:{id}"),
|
||||
},
|
||||
"prompt:{id}": {
|
||||
request: request("prompt:{id}"),
|
||||
response: response("prompt:{id}"),
|
||||
"text-completion-request": request("text-completion:{id}"),
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
"prompt-rag:{id}": {
|
||||
request: request("prompt-rag:{id}"),
|
||||
response: response("prompt-rag:{id}"),
|
||||
"text-completion-request": request("text-completion-rag:{id}"),
|
||||
"text-completion-response": response("text-completion-rag:{id}"),
|
||||
},
|
||||
"mcp-tool:{id}": {
|
||||
request: request("mcp-tool:{id}"),
|
||||
response: response("mcp-tool:{id}"),
|
||||
"text-completion-request": request("text-completion:{id}"),
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
"metering:{id}": {
|
||||
input: response("text-completion:{id}"),
|
||||
},
|
||||
"metering-rag:{id}": {
|
||||
input: response("text-completion-rag:{id}"),
|
||||
},
|
||||
},
|
||||
|
||||
// Class-level processors for document RAG operations
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
105
trustgraph_configurator/templates/1.6/flows/flow-classes.jsonnet
Normal file
105
trustgraph_configurator/templates/1.6/flows/flow-classes.jsonnet
Normal file
|
|
@ -0,0 +1,105 @@
|
|||
// TrustGraph Flow Classes Configuration
|
||||
// Defines different flow combinations for various use cases
|
||||
// Each flow class combines multiple functional modules to create complete processing pipelines
|
||||
//
|
||||
// Available modules:
|
||||
// - graphrag: Graph-based RAG with knowledge graphs
|
||||
// - documentrag: Document-based RAG with chunk embeddings
|
||||
// - structured: Structured data processing and NLP queries
|
||||
// - agent: AI agent orchestration and tool integration
|
||||
// - load: Document loading and preprocessing
|
||||
// - kg-base: Basic knowledge extraction from text
|
||||
// - agent-extract: Agent-based knowledge extraction
|
||||
// - kgcore: Knowledge graph core storage
|
||||
|
||||
// Import all the modular flow components
|
||||
local graphrag_part = import "graphrag.jsonnet";
|
||||
local kg_base_part = import "kg-base.jsonnet";
|
||||
local onto_base_part = import "onto-base.jsonnet";
|
||||
local agent_extract_part = import "agent-extract.jsonnet";
|
||||
local structured_part = import "structured.jsonnet";
|
||||
local documentrag_part = import "documentrag.jsonnet";
|
||||
local agent_part = import "agent.jsonnet";
|
||||
local load_part = import "load.jsonnet";
|
||||
local kgcore_part = import "kgcore.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
// Complete TrustGraph system with all capabilities
|
||||
// Includes GraphRAG, DocumentRAG, structured data processing, and knowledge cores
|
||||
"everything": {
|
||||
description: "GraphRAG, DocumentRAG, structured data + knowledge cores",
|
||||
tags: [
|
||||
"document-rag", "graph-rag", "knowledge-extraction",
|
||||
"structured-data", "kgcore"
|
||||
],
|
||||
} +
|
||||
graphrag_part + documentrag_part + agent_part + load_part +
|
||||
kg_base_part + structured_part,
|
||||
|
||||
// Dual RAG system without knowledge core creation
|
||||
// Combines both document and graph-based retrieval
|
||||
"document-rag+graph-rag": {
|
||||
description: "Supports GraphRAG and document RAG, no core creation",
|
||||
tags: ["document-rag", "graph-rag", "knowledge-extraction"],
|
||||
} +
|
||||
graphrag_part + documentrag_part + agent_part + load_part + kg_base_part,
|
||||
|
||||
// Graph-based RAG only
|
||||
// Uses knowledge graphs for context-aware question answering
|
||||
"graph-rag": {
|
||||
description: "GraphRAG only",
|
||||
tags: ["graph-rag", "knowledge-extraction"],
|
||||
} +
|
||||
graphrag_part + agent_part + load_part + kg_base_part,
|
||||
|
||||
// Graph-based RAG only
|
||||
// Uses knowledge graphs for context-aware question answering
|
||||
"onto-rag": {
|
||||
description: "Ontology RAG only",
|
||||
tags: ["graph-rag", "knowledge-extraction"],
|
||||
} +
|
||||
graphrag_part + agent_part + load_part + onto_base_part,
|
||||
|
||||
// Document-based RAG only
|
||||
// Uses document embeddings for semantic search and answers
|
||||
"document-rag": {
|
||||
description: "DocumentRAG only",
|
||||
tags: ["document-rag"],
|
||||
} +
|
||||
documentrag_part + load_part,
|
||||
|
||||
// Full RAG system with knowledge core creation
|
||||
// Includes both RAG types plus persistent knowledge storage
|
||||
"document-rag+graph-rag+kgcore": {
|
||||
description: "GraphRAG + DocumentRAG + knowledge core creation",
|
||||
tags: ["document-rag", "graph-rag", "knowledge-extraction"],
|
||||
} +
|
||||
graphrag_part + documentrag_part + agent_part + load_part +
|
||||
kgcore_part + kg_base_part,
|
||||
|
||||
// GraphRAG with advanced agent-based extraction
|
||||
// Uses AI agents for sophisticated knowledge extraction
|
||||
"graph-rag+agent-extract": {
|
||||
description: "GraphRAG + agent extract",
|
||||
tags: ["graph-rag", "knowledge-extraction", "agent-extract"],
|
||||
} +
|
||||
graphrag_part + agent_part + load_part + agent_extract_part,
|
||||
|
||||
// GraphRAG with structured data processing
|
||||
// Combines knowledge graphs with structured data queries
|
||||
"graph-rag+structured-data": {
|
||||
description: "GraphRAG + structured data",
|
||||
tags: ["graph-rag", "knowledge-extraction", "structured-data"],
|
||||
} +
|
||||
graphrag_part + agent_part + load_part + structured_part,
|
||||
|
||||
// Structured data processing only
|
||||
// Handles structured data extraction and NLP queries
|
||||
"structured-data": {
|
||||
description: "Structured data only",
|
||||
tags: ["knowledge-extraction", "structured-data"],
|
||||
} +
|
||||
agent_part + load_part + structured_part,
|
||||
|
||||
}
|
||||
107
trustgraph_configurator/templates/1.6/flows/graphrag.jsonnet
Normal file
107
trustgraph_configurator/templates/1.6/flows/graphrag.jsonnet
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
// GraphRAG flow configuration module
|
||||
// Implements graph-based retrieval augmented generation (GraphRAG) functionality
|
||||
// Handles knowledge graph storage, embeddings, and graph-based question answering
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
local llm_parameters = import "llm-parameters.jsonnet";
|
||||
|
||||
{
|
||||
// External interfaces exposed by the GraphRAG flow
|
||||
"interfaces" +: {
|
||||
// Data ingestion interfaces for graph construction
|
||||
"entity-contexts-load": flow("entity-contexts-load:{id}"), // Entity context data stream
|
||||
"triples-store": flow("triples-store:{id}"), // RDF triples storage stream
|
||||
"graph-embeddings-store": flow("graph-embeddings-store:{id}"), // Graph embedding storage
|
||||
|
||||
// Query interfaces for graph-based operations
|
||||
"graph-rag": request_response("graph-rag:{id}"), // Main GraphRAG query interface
|
||||
"triples": request_response("triples:{id}"), // Triple store queries
|
||||
"graph-embeddings": request_response("graph-embeddings:{id}"), // Graph embedding queries
|
||||
|
||||
// Supporting services
|
||||
"embeddings": request_response("embeddings:{id}"), // General embedding service
|
||||
"prompt": request_response("prompt:{id}"), // Prompt processing service
|
||||
"text-completion": request_response("text-completion:{id}"), // LLM text completion
|
||||
},
|
||||
|
||||
|
||||
// Parameters that can be configured for this flow
|
||||
"parameters" +: llm_parameters,
|
||||
|
||||
// Flow-level processors - handle data streams for a specific flow instance
|
||||
"flow" +: {
|
||||
"graph-embeddings:{id}": {
|
||||
input: flow("entity-contexts-load:{id}"),
|
||||
output: flow("graph-embeddings-store:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
},
|
||||
"triples-write:{id}": {
|
||||
input: flow("triples-store:{id}"),
|
||||
},
|
||||
"ge-write:{id}": {
|
||||
input: flow("graph-embeddings-store:{id}"),
|
||||
},
|
||||
"text-completion:{id}": {
|
||||
request: request("text-completion:{id}"),
|
||||
response: response("text-completion:{id}"),
|
||||
model: "{llm-model}",
|
||||
},
|
||||
"text-completion-rag:{id}": {
|
||||
request: request("text-completion-rag:{id}"),
|
||||
response: response("text-completion-rag:{id}"),
|
||||
model: "{llm-rag-model}",
|
||||
},
|
||||
"embeddings:{id}": {
|
||||
request: request("embeddings:{id}"),
|
||||
response: response("embeddings:{id}"),
|
||||
model: "{embeddings-model}",
|
||||
},
|
||||
"graph-rag:{id}": {
|
||||
request: request("graph-rag:{id}"),
|
||||
response: response("graph-rag:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
"prompt-request": request("prompt-rag:{id}"),
|
||||
"prompt-response": response("prompt-rag:{id}"),
|
||||
"graph-embeddings-request": request("graph-embeddings:{id}"),
|
||||
"graph-embeddings-response": response("graph-embeddings:{id}"),
|
||||
"triples-request": request("triples:{id}"),
|
||||
"triples-response": response("triples:{id}"),
|
||||
},
|
||||
"triples-query:{id}": {
|
||||
request: request("triples:{id}"),
|
||||
response: response("triples:{id}"),
|
||||
},
|
||||
"ge-query:{id}": {
|
||||
request: request("graph-embeddings:{id}"),
|
||||
response: response("graph-embeddings:{id}"),
|
||||
},
|
||||
"prompt:{id}": {
|
||||
request: request("prompt:{id}"),
|
||||
response: response("prompt:{id}"),
|
||||
"text-completion-request": request("text-completion:{id}"),
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
"prompt-rag:{id}": {
|
||||
request: request("prompt-rag:{id}"),
|
||||
response: response("prompt-rag:{id}"),
|
||||
"text-completion-request": request("text-completion-rag:{id}"),
|
||||
"text-completion-response": response("text-completion-rag:{id}"),
|
||||
},
|
||||
"metering:{id}": {
|
||||
input: response("text-completion:{id}"),
|
||||
},
|
||||
"metering-rag:{id}": {
|
||||
input: response("text-completion-rag:{id}"),
|
||||
},
|
||||
},
|
||||
|
||||
// Class-level processors - shared across all flow instances of this class
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
29
trustgraph_configurator/templates/1.6/flows/helpers.jsonnet
Normal file
29
trustgraph_configurator/templates/1.6/flows/helpers.jsonnet
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
// Helper functions for flow configuration
|
||||
// Provides utility functions for constructing flow, request, and response URIs
|
||||
// used throughout the TrustGraph flow configuration system
|
||||
|
||||
// Creates a persistent flow URI for data streams
|
||||
// Persistent flows retain messages until consumed
|
||||
local flow(x) = "persistent://tg/flow/" + x;
|
||||
|
||||
// Creates a non-persistent request URI for request-response patterns
|
||||
// Non-persistent means messages are not retained if no consumer is present
|
||||
local request(x) = "non-persistent://tg/request/" + x;
|
||||
|
||||
// Creates a non-persistent response URI for request-response patterns
|
||||
local response(x) = "non-persistent://tg/response/" + x;
|
||||
|
||||
// Creates a request-response pair for bidirectional communication
|
||||
// Returns an object with both request and response URIs
|
||||
local request_response(x) = {
|
||||
request: request(x),
|
||||
response: response(x),
|
||||
};
|
||||
|
||||
// Export all helper functions for use in other modules
|
||||
{
|
||||
flow: flow,
|
||||
request: request,
|
||||
response: response,
|
||||
request_response: request_response,
|
||||
}
|
||||
44
trustgraph_configurator/templates/1.6/flows/kg-base.jsonnet
Normal file
44
trustgraph_configurator/templates/1.6/flows/kg-base.jsonnet
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
// Knowledge Graph Base extraction module
|
||||
// Provides basic knowledge extraction capabilities from text chunks
|
||||
// Extracts entity definitions and relationships using prompt-based processing
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
|
||||
{
|
||||
// No external interfaces - this module provides internal extraction services
|
||||
"interfaces" +: {
|
||||
},
|
||||
|
||||
// No configurable parameters for basic KG extraction
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for knowledge extraction
|
||||
"flow" +: {
|
||||
// Extracts entity definitions from text chunks
|
||||
// Identifies and defines key entities mentioned in the text
|
||||
"kg-extract-definitions:{id}": {
|
||||
input: flow("chunk-load:{id}"), // Input text chunks
|
||||
triples: flow("triples-store:{id}"), // Output definition triples
|
||||
"entity-contexts": flow("entity-contexts-load:{id}"), // Entity context information
|
||||
"prompt-request": request("prompt:{id}"), // Definition extraction prompts
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
},
|
||||
|
||||
// Extracts relationships between entities
|
||||
// Identifies how entities are connected and interact
|
||||
"kg-extract-relationships:{id}": {
|
||||
input: flow("chunk-load:{id}"), // Input text chunks
|
||||
triples: flow("triples-store:{id}"), // Output relationship triples
|
||||
"prompt-request": request("prompt:{id}"), // Relationship extraction prompts
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
},
|
||||
},
|
||||
|
||||
// No class-level processors needed
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
31
trustgraph_configurator/templates/1.6/flows/kgcore.jsonnet
Normal file
31
trustgraph_configurator/templates/1.6/flows/kgcore.jsonnet
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
// Knowledge Graph Core storage module
|
||||
// Handles persistent storage of knowledge graph data
|
||||
// Consolidates triples and graph embeddings into permanent storage
|
||||
// Creates the core knowledge base for long-term use
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
|
||||
{
|
||||
// No external interfaces - internal storage service
|
||||
"interfaces" +: {
|
||||
},
|
||||
|
||||
// No configurable parameters for core storage
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for knowledge graph storage
|
||||
"flow" +: {
|
||||
// Knowledge graph store consolidates extracted knowledge
|
||||
// Takes processed triples and embeddings and stores them permanently
|
||||
"kg-store:{id}": {
|
||||
"triples-input": flow("triples-store:{id}"), // Input RDF triples stream
|
||||
"graph-embeddings-input": flow("graph-embeddings-store:{id}"), // Input graph embeddings
|
||||
},
|
||||
},
|
||||
|
||||
// No class-level processors needed
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
{
|
||||
|
||||
// LLM model selection for normal LLM
|
||||
"llm-model": {
|
||||
"type": "llm-model",
|
||||
"description": "LLM model",
|
||||
"order": 1,
|
||||
"advanced": false,
|
||||
},
|
||||
|
||||
// LLM model for RAG operations
|
||||
"llm-rag-model": {
|
||||
"type": "llm-model",
|
||||
"description": "LLM model for RAG",
|
||||
"order": 2,
|
||||
"advanced": true,
|
||||
"controlled-by": "llm-model",
|
||||
},
|
||||
|
||||
// LLM model selection for normal LLM
|
||||
"llm-temperature": {
|
||||
"type": "llm-temperature",
|
||||
"description": "LLM temperature",
|
||||
"order": 3,
|
||||
"advanced": true,
|
||||
},
|
||||
|
||||
// LLM model selection for normal LLM
|
||||
"llm-rag-temperature": {
|
||||
"type": "llm-temperature",
|
||||
"description": "LLM temperature for RAG",
|
||||
"order": 4,
|
||||
"advanced": true,
|
||||
},
|
||||
|
||||
"embeddings-model": {
|
||||
"type": "embeddings-model",
|
||||
"description": "Embeddings model",
|
||||
"order": 5,
|
||||
"advanced": true,
|
||||
},
|
||||
|
||||
// LLM model selection for normal LLM
|
||||
"chunk-size": {
|
||||
"type": "chunk-size",
|
||||
"description": "Chunk size",
|
||||
"order": 6,
|
||||
"advanced": true,
|
||||
},
|
||||
|
||||
// LLM model selection for normal LLM
|
||||
"chunk-overlap": {
|
||||
"type": "chunk-overlap",
|
||||
"description": "Chunk overlap",
|
||||
"order": 7,
|
||||
"advanced": true,
|
||||
},
|
||||
|
||||
}
|
||||
50
trustgraph_configurator/templates/1.6/flows/load.jsonnet
Normal file
50
trustgraph_configurator/templates/1.6/flows/load.jsonnet
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
// Document loading and preprocessing module
|
||||
// Handles document ingestion, format conversion, and chunking
|
||||
// Converts PDFs to text and splits documents into processable chunks
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
|
||||
{
|
||||
|
||||
// External interfaces for document loading
|
||||
"interfaces" +: {
|
||||
"document-load": flow("document-load:{id}"), // Raw document input stream
|
||||
"text-load": flow("text-document-load:{id}"), // Text document stream
|
||||
"embeddings": request_response("embeddings:{id}"), // Embedding service for chunks
|
||||
},
|
||||
|
||||
// No configurable parameters for document loading
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for document preprocessing
|
||||
"flow" +: {
|
||||
// PDF decoder converts PDF documents to text
|
||||
"pdf-decoder:{id}": {
|
||||
input: flow("document-load:{id}"), // Raw PDF input
|
||||
output: flow("text-document-load:{id}"), // Extracted text output
|
||||
},
|
||||
|
||||
// Chunker splits documents into smaller, processable pieces
|
||||
"chunker:{id}": {
|
||||
input: flow("text-document-load:{id}"), // Full text documents
|
||||
output: flow("chunk-load:{id}"), // Document chunks for processing
|
||||
"chunk-size": "{chunk-size}", // Chunk size
|
||||
"chunk-overlap": "{chunk-overlap}", // Overlap between chunks
|
||||
},
|
||||
// Embedding service for converting text chunks to vectors
|
||||
"embeddings:{id}": {
|
||||
request: request("embeddings:{id}"), // Embedding requests
|
||||
response: response("embeddings:{id}"), // Embedding responses
|
||||
model: "{embeddings-model}",
|
||||
},
|
||||
},
|
||||
|
||||
// Class-level processors for document loading services
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
// Knowledge Graph Base extraction module
|
||||
// Provides basic knowledge extraction capabilities from text chunks
|
||||
// Extracts entity definitions and relationships using prompt-based processing
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
|
||||
{
|
||||
// No external interfaces - this module provides internal extraction services
|
||||
"interfaces" +: {
|
||||
},
|
||||
|
||||
// No configurable parameters for basic KG extraction
|
||||
"parameters" +: {
|
||||
},
|
||||
|
||||
// Flow-level processors for knowledge extraction
|
||||
"flow" +: {
|
||||
// Extracts using ontology definitions
|
||||
"kg-extract-ontology:{id}": {
|
||||
input: flow("chunk-load:{id}"), // Input text chunks
|
||||
triples: flow("triples-store:{id}"), // Output triples
|
||||
"entity-contexts": flow("entity-contexts-load:{id}"), // Entity context information
|
||||
"prompt-request": request("prompt:{id}"), // Definition
|
||||
// extraction prompts
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
// No class-level processors needed
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
|
||||
107
trustgraph_configurator/templates/1.6/flows/ontorag.jsonnet
Normal file
107
trustgraph_configurator/templates/1.6/flows/ontorag.jsonnet
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
// GraphRAG flow configuration module
|
||||
// Implements graph-based retrieval augmented generation (GraphRAG) functionality
|
||||
// Handles knowledge graph storage, embeddings, and graph-based question answering
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
local llm_parameters = import "llm-parameters.jsonnet";
|
||||
|
||||
{
|
||||
// External interfaces exposed by the GraphRAG flow
|
||||
"interfaces" +: {
|
||||
// Data ingestion interfaces for graph construction
|
||||
"entity-contexts-load": flow("entity-contexts-load:{id}"), // Entity context data stream
|
||||
"triples-store": flow("triples-store:{id}"), // RDF triples storage stream
|
||||
"graph-embeddings-store": flow("graph-embeddings-store:{id}"), // Graph embedding storage
|
||||
|
||||
// Query interfaces for graph-based operations
|
||||
"graph-rag": request_response("graph-rag:{id}"), // Main GraphRAG query interface
|
||||
"triples": request_response("triples:{id}"), // Triple store queries
|
||||
"graph-embeddings": request_response("graph-embeddings:{id}"), // Graph embedding queries
|
||||
|
||||
// Supporting services
|
||||
"embeddings": request_response("embeddings:{id}"), // General embedding service
|
||||
"prompt": request_response("prompt:{id}"), // Prompt processing service
|
||||
"text-completion": request_response("text-completion:{id}"), // LLM text completion
|
||||
},
|
||||
|
||||
|
||||
// Parameters that can be configured for this flow
|
||||
"parameters" +: llm_parameters,
|
||||
|
||||
// Flow-level processors - handle data streams for a specific flow instance
|
||||
"flow" +: {
|
||||
"graph-embeddings:{id}": {
|
||||
input: flow("entity-contexts-load:{id}"),
|
||||
output: flow("graph-embeddings-store:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
},
|
||||
"triples-write:{id}": {
|
||||
input: flow("triples-store:{id}"),
|
||||
},
|
||||
"ge-write:{id}": {
|
||||
input: flow("graph-embeddings-store:{id}"),
|
||||
},
|
||||
"text-completion:{id}": {
|
||||
request: request("text-completion:{id}"),
|
||||
response: response("text-completion:{id}"),
|
||||
model: "{llm-model}",
|
||||
},
|
||||
"text-completion-rag:{id}": {
|
||||
request: request("text-completion-rag:{id}"),
|
||||
response: response("text-completion-rag:{id}"),
|
||||
model: "{llm-rag-model}",
|
||||
},
|
||||
"embeddings:{id}": {
|
||||
request: request("embeddings:{id}"),
|
||||
response: response("embeddings:{id}"),
|
||||
model: "{embeddings-model}",
|
||||
},
|
||||
"graph-rag:{id}": {
|
||||
request: request("graph-rag:{id}"),
|
||||
response: response("graph-rag:{id}"),
|
||||
"embeddings-request": request("embeddings:{id}"),
|
||||
"embeddings-response": response("embeddings:{id}"),
|
||||
"prompt-request": request("prompt-rag:{id}"),
|
||||
"prompt-response": response("prompt-rag:{id}"),
|
||||
"graph-embeddings-request": request("graph-embeddings:{id}"),
|
||||
"graph-embeddings-response": response("graph-embeddings:{id}"),
|
||||
"triples-request": request("triples:{id}"),
|
||||
"triples-response": response("triples:{id}"),
|
||||
},
|
||||
"triples-query:{id}": {
|
||||
request: request("triples:{id}"),
|
||||
response: response("triples:{id}"),
|
||||
},
|
||||
"ge-query:{id}": {
|
||||
request: request("graph-embeddings:{id}"),
|
||||
response: response("graph-embeddings:{id}"),
|
||||
},
|
||||
"prompt:{id}": {
|
||||
request: request("prompt:{id}"),
|
||||
response: response("prompt:{id}"),
|
||||
"text-completion-request": request("text-completion:{id}"),
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
"prompt-rag:{id}": {
|
||||
request: request("prompt-rag:{id}"),
|
||||
response: response("prompt-rag:{id}"),
|
||||
"text-completion-request": request("text-completion-rag:{id}"),
|
||||
"text-completion-response": response("text-completion-rag:{id}"),
|
||||
},
|
||||
"metering:{id}": {
|
||||
input: response("text-completion:{id}"),
|
||||
},
|
||||
"metering-rag:{id}": {
|
||||
input: response("text-completion-rag:{id}"),
|
||||
},
|
||||
},
|
||||
|
||||
// Class-level processors - shared across all flow instances of this class
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
108
trustgraph_configurator/templates/1.6/flows/structured.jsonnet
Normal file
108
trustgraph_configurator/templates/1.6/flows/structured.jsonnet
Normal file
|
|
@ -0,0 +1,108 @@
|
|||
// Structured data processing module
|
||||
// Handles extraction and querying of structured data objects
|
||||
// Provides natural language to GraphQL query capabilities
|
||||
// Supports structured data storage and retrieval
|
||||
|
||||
local helpers = import "helpers.jsonnet";
|
||||
local flow = helpers.flow;
|
||||
local request = helpers.request;
|
||||
local response = helpers.response;
|
||||
local request_response = helpers.request_response;
|
||||
local llm_parameters = import "llm-parameters.jsonnet";
|
||||
|
||||
{
|
||||
// External interfaces for structured data operations
|
||||
"interfaces" +: {
|
||||
// Supporting services
|
||||
"embeddings": request_response("embeddings:{id}"), // Embedding service
|
||||
"prompt": request_response("prompt:{id}"), // Prompt processing
|
||||
"text-completion": request_response("text-completion:{id}"), // LLM completion
|
||||
|
||||
// Structured data storage and querying
|
||||
"objects-store": flow("objects-store:{id}"), // Object storage stream
|
||||
"objects": request_response("objects:{id}"), // Object query service
|
||||
|
||||
// Query interfaces
|
||||
"nlp-query": request_response("nlp-query:{id}"), // NLP to GraphQL translation
|
||||
"structured-query": request_response("structured-query:{id}"), // Structured query execution
|
||||
"structured-diag": request_response("structured-diag:{id}"), // Query diagnostics
|
||||
},
|
||||
|
||||
|
||||
// Parameters that can be configured for this flow
|
||||
"parameters" +: llm_parameters,
|
||||
|
||||
// Flow-level processors for structured data extraction
|
||||
"flow" +: {
|
||||
"kg-extract-objects:{id}": {
|
||||
input: flow("chunk-load:{id}"),
|
||||
output: flow("objects-store:{id}"),
|
||||
"entity-contexts": flow("entity-contexts-load:{id}"),
|
||||
"prompt-request": request("prompt:{id}"),
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
},
|
||||
"objects-write:{id}": {
|
||||
input: flow("objects-store:{id}"),
|
||||
},
|
||||
"text-completion:{id}": {
|
||||
request: request("text-completion:{id}"),
|
||||
response: response("text-completion:{id}"),
|
||||
model: "{llm-model}",
|
||||
},
|
||||
"text-completion-rag:{id}": {
|
||||
request: request("text-completion-rag:{id}"),
|
||||
response: response("text-completion-rag:{id}"),
|
||||
model: "{llm-rag-model}",
|
||||
},
|
||||
"objects-query:{id}": {
|
||||
request: request("objects:{id}"),
|
||||
response: response("objects:{id}"),
|
||||
},
|
||||
"nlp-query:{id}": {
|
||||
request: request("nlp-query:{id}"),
|
||||
response: response("nlp-query:{id}"),
|
||||
"prompt-request": request("prompt-rag:{id}"),
|
||||
"prompt-response": response("prompt-rag:{id}"),
|
||||
},
|
||||
"structured-query:{id}": {
|
||||
request: request("structured-query:{id}"),
|
||||
response: response("structured-query:{id}"),
|
||||
"nlp-query-request": request("nlp-query:{id}"),
|
||||
"nlp-query-response": response("nlp-query:{id}"),
|
||||
"objects-query-request": request("objects:{id}"),
|
||||
"objects-query-response": response("objects:{id}"),
|
||||
},
|
||||
"structured-diag:{id}": {
|
||||
request: request("structured-diag:{id}"),
|
||||
response: response("structured-diag:{id}"),
|
||||
"prompt-request": request("prompt:{id}"),
|
||||
"prompt-response": response("prompt:{id}"),
|
||||
},
|
||||
"embeddings:{id}": {
|
||||
request: request("embeddings:{id}"),
|
||||
response: response("embeddings:{id}"),
|
||||
model: "{embeddings-model}",
|
||||
},
|
||||
"prompt:{id}": {
|
||||
request: request("prompt:{id}"),
|
||||
response: response("prompt:{id}"),
|
||||
"text-completion-request": request("text-completion:{id}"),
|
||||
"text-completion-response": response("text-completion:{id}"),
|
||||
},
|
||||
"prompt-rag:{id}": {
|
||||
request: request("prompt-rag:{id}"),
|
||||
response: response("prompt-rag:{id}"),
|
||||
"text-completion-request": request("text-completion-rag:{id}"),
|
||||
"text-completion-response": response("text-completion-rag:{id}"),
|
||||
},
|
||||
"metering:{id}": {
|
||||
input: response("text-completion:{id}"),
|
||||
},
|
||||
"metering-rag:{id}": {
|
||||
input: response("text-completion-rag:{id}"),
|
||||
},
|
||||
},
|
||||
// Class-level processors for structured data operations
|
||||
"class" +: {
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
local base = import "base/base.jsonnet";
|
||||
local images = import "values/images.jsonnet";
|
||||
local url = import "values/url.jsonnet";
|
||||
|
||||
{
|
||||
|
||||
"ddg-mcp-server-port":: 9870,
|
||||
|
||||
"ddg-mcp-server" +: {
|
||||
|
||||
create:: function(engine)
|
||||
|
||||
local port = $["ddg-mcp-server-port"];
|
||||
|
||||
local container =
|
||||
engine.container("ddg-mcp-server")
|
||||
.with_image(images["ddg-mcp-server"])
|
||||
.with_limits("0.5", "256M")
|
||||
.with_reservations("0.1", "256M")
|
||||
.with_port(port, port, "mcp");
|
||||
|
||||
local containerSet = engine.containers(
|
||||
"ddg-mcp-server", [ container ]
|
||||
);
|
||||
|
||||
local service =
|
||||
engine.internalService(containerSet)
|
||||
.with_port(port, port, "mcp");
|
||||
|
||||
engine.resources([
|
||||
containerSet,
|
||||
service,
|
||||
])
|
||||
|
||||
},
|
||||
|
||||
mcp +:: {
|
||||
"duckduckgo": {
|
||||
"remote-name": "search",
|
||||
local port = $["ddg-mcp-server-port"],
|
||||
local url = "http://ddg-mcp-server:%s/mcp" % port,
|
||||
"url": url,
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Azure OpenAI LLM Model Definitions
|
||||
// Model input is just text
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "LLM model to use",
|
||||
"default": "gpt-4o",
|
||||
"required": true
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
// Azure LLM Model Definitions
|
||||
// Model input is just text
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "LLM model to use",
|
||||
"default": "phi4:14b",
|
||||
"required": true
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
// AWS Bedrock LLM Model Definitions
|
||||
// Defines available models and their configurations for AWS Bedrock
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "LLM model to use",
|
||||
"default": "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
||||
"enum": [
|
||||
{
|
||||
id: "global.anthropic.claude-sonnet-4-5-20250929-v1:0",
|
||||
description: "Claude Sonnet 4.5 (smartest for complex agents and coding)"
|
||||
},
|
||||
{
|
||||
id: "global.anthropic.claude-opus-4-5-20251101-v1:0",
|
||||
description: "Claude Opus 4.5 (maximum intelligence)"
|
||||
},
|
||||
{
|
||||
id: "global.anthropic.claude-haiku-4-5-20251001-v1:0",
|
||||
description: "Claude Haiku 4.5 (fastest with near-frontier intelligence)"
|
||||
},
|
||||
{
|
||||
id: "global.anthropic.claude-opus-4-1-20250805-v1:0",
|
||||
description: "Claude Opus 4.1 (specialized reasoning)"
|
||||
},
|
||||
{
|
||||
id: "global.anthropic.claude-sonnet-4-20250514-v1:0",
|
||||
description: "Claude Sonnet 4.0"
|
||||
},
|
||||
{
|
||||
id: "global.anthropic.claude-opus-4-20250514-v1:0",
|
||||
description: "Claude Opus 4.0"
|
||||
},
|
||||
{
|
||||
id: "anthropic.claude-3-5-haiku-20241022-v1:0",
|
||||
description: "Claude 3.5 Haiku"
|
||||
},
|
||||
{
|
||||
id: "anthropic.claude-3-haiku-20240307-v1:0",
|
||||
description: "Claude 3 Haiku"
|
||||
},
|
||||
{
|
||||
id: "meta.llama3-1-405b-instruct-v1:0",
|
||||
description: "Llama 3.1 405B Instruct"
|
||||
},
|
||||
{
|
||||
id: "meta.llama3-1-70b-instruct-v1:0",
|
||||
description: "Llama 3.1 70B Instruct"
|
||||
},
|
||||
{
|
||||
id: "meta.llama3-1-8b-instruct-v1:0",
|
||||
description: "Llama 3.1 8B Instruct"
|
||||
},
|
||||
{
|
||||
id: "mistral.mistral-large-2407-v1:0",
|
||||
description: "Mistral Large"
|
||||
},
|
||||
{
|
||||
id: "mistral.mixtral-8x7b-instruct-v0:1",
|
||||
description: "Mixtral 8x7B Instruct"
|
||||
},
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
// Chunk parameter type definitions
|
||||
|
||||
{
|
||||
"chunk-size": {
|
||||
"type": "integer",
|
||||
"description": "Chunk size",
|
||||
"placeholder": 2000,
|
||||
"helper": "An integer, usually 2000 .. 8000",
|
||||
"default": 2000,
|
||||
"min": 0,
|
||||
"max": 32768,
|
||||
"required": true
|
||||
},
|
||||
"chunk-overlap": {
|
||||
"type": "integer",
|
||||
"description": "Chunk overlap",
|
||||
"placeholder": 50,
|
||||
"helper": "An integer, usually 50 .. 100",
|
||||
"default": 50,
|
||||
"min": 0,
|
||||
"max": 8000,
|
||||
"required": true
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Claude LLM Model Definitions
|
||||
// Defines available models and their configurations for Anthropic's Claude
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "LLM model to use",
|
||||
"default": "claude-sonnet-4-5-20250929",
|
||||
"enum": [
|
||||
{
|
||||
id: "claude-sonnet-4-5-20250929",
|
||||
description: "Claude Sonnet 4.5 (complex agents + coding)"
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-5-20251101",
|
||||
description: "Claude Opus 4.5 (maximum intelligence)"
|
||||
},
|
||||
{
|
||||
id: "claude-haiku-4-5-20251001",
|
||||
description: "Claude Haiku 4.5 (fast)"
|
||||
},
|
||||
{
|
||||
id: "claude-opus-4-1-20250805",
|
||||
description: "Claude Opus 4.1 (specialized reasoning)"
|
||||
},
|
||||
{
|
||||
id: "claude-sonnet-4-20250514",
|
||||
description: "Claude Sonnet 4.0"
|
||||
},
|
||||
{
|
||||
id: "claude-3-5-haiku-20241022",
|
||||
description: "Claude 3.5 Haiku"
|
||||
},
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
// Cohere LLM Model Definitions
|
||||
// Defines available models and their configurations for Cohere
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "LLM model to use",
|
||||
"default": "command-r-plus-08-2024",
|
||||
"enum": [
|
||||
{
|
||||
id: "command-r-plus-08-2024",
|
||||
description: "Command R+ (August 2024)"
|
||||
},
|
||||
{
|
||||
id: "command-r-08-2024",
|
||||
description: "Command R (August 2024)"
|
||||
},
|
||||
{
|
||||
id: "command-r-plus",
|
||||
description: "Command R+ (legacy)"
|
||||
},
|
||||
{
|
||||
id: "command-r",
|
||||
description: "Command R (legacy)"
|
||||
},
|
||||
{
|
||||
id: "command",
|
||||
description: "Command"
|
||||
},
|
||||
{
|
||||
id: "command-light",
|
||||
description: "Command Light"
|
||||
},
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
|
|
@ -0,0 +1,127 @@
|
|||
// Embeddings model definitions for fastembed
|
||||
// Defines available models and their configurations for Fastembed
|
||||
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Embeddings model to use",
|
||||
"default": "sentence-transformers/all-MiniLM-L6-v2",
|
||||
"enum": [
|
||||
{
|
||||
"id": "sentence-transformers/all-MiniLM-L6-v2",
|
||||
"description": "all-MiniLM-L6-v2"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-small-en-v1.5",
|
||||
"description": "bge-small-en-v1.5"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-small-zh-v1.5",
|
||||
"description": "bge-small-zh-v1.5"
|
||||
},
|
||||
{
|
||||
"id": "snowflake/snowflake-arctic-embed-xs",
|
||||
"description": "snowflake-arctic-embed-xs"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-small-en",
|
||||
"description": "jina-embeddings-v2-small-en"
|
||||
},
|
||||
{
|
||||
"id": "nomic-ai/nomic-embed-text-v1.5-Q",
|
||||
"description": "nomic-embed-text-v1.5-Q"
|
||||
},
|
||||
{
|
||||
"id": "snowflake/snowflake-arctic-embed-s",
|
||||
"description": "snowflake-arctic-embed-s"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-small-en",
|
||||
"description": "bge-small-en"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-base-en-v1.5",
|
||||
"description": "bge-base-en-v1.5"
|
||||
},
|
||||
{
|
||||
"id": "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
|
||||
"description": "paraphrase-multilingual-MiniLM-L12-v2"
|
||||
},
|
||||
{
|
||||
"id": "Qdrant/clip-ViT-B-32-text",
|
||||
"description": "clip-ViT-B-32-text"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-base-de",
|
||||
"description": "jina-embeddings-v2-base-de"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-base-en",
|
||||
"description": "bge-base-en"
|
||||
},
|
||||
{
|
||||
"id": "snowflake/snowflake-arctic-embed-m",
|
||||
"description": "snowflake-arctic-embed-m"
|
||||
},
|
||||
{
|
||||
"id": "thenlper/gte-base",
|
||||
"description": "gte-base"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-base-en",
|
||||
"description": "jina-embeddings-v2-base-en"
|
||||
},
|
||||
{
|
||||
"id": "nomic-ai/nomic-embed-text-v1",
|
||||
"description": "nomic-embed-text-v1"
|
||||
},
|
||||
{
|
||||
"id": "nomic-ai/nomic-embed-text-v1.5",
|
||||
"description": "nomic-embed-text-v1.5"
|
||||
},
|
||||
{
|
||||
"id": "snowflake/snowflake-arctic-embed-m-long",
|
||||
"description": "snowflake-arctic-embed-m-long"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-clip-v1",
|
||||
"description": "jina-clip-v1"
|
||||
},
|
||||
{
|
||||
"id": "mixedbread-ai/mxbai-embed-large-v1",
|
||||
"description": "mxbai-embed-large-v1"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-base-es",
|
||||
"description": "jina-embeddings-v2-base-es"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-base-code",
|
||||
"description": "jina-embeddings-v2-base-code"
|
||||
},
|
||||
{
|
||||
"id": "jinaai/jina-embeddings-v2-base-zh",
|
||||
"description": "jina-embeddings-v2-base-zh"
|
||||
},
|
||||
{
|
||||
"id": "sentence-transformers/paraphrase-multilingual-mpnet-base-v2",
|
||||
"description": "paraphrase-multilingual-mpnet-base-v2"
|
||||
},
|
||||
{
|
||||
"id": "snowflake/snowflake-arctic-embed-l",
|
||||
"description": "snowflake-arctic-embed-l"
|
||||
},
|
||||
{
|
||||
"id": "BAAI/bge-large-en-v1.5",
|
||||
"description": "bge-large-en-v1.5"
|
||||
},
|
||||
{
|
||||
"id": "thenlper/gte-large",
|
||||
"description": "gte-large"
|
||||
},
|
||||
{
|
||||
"id": "intfloat/multilingual-e5-large",
|
||||
"description": "multilingual-e5-large"
|
||||
}
|
||||
],
|
||||
"required": true
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue