mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-18 17:51:02 +02:00
LLM migration to env secrets complete
This commit is contained in:
parent
aab6472e3c
commit
0eee19b540
3 changed files with 55 additions and 84 deletions
|
|
@ -9,13 +9,15 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
"chunk-size":: 150,
|
"chunk-size":: 150,
|
||||||
"chunk-overlap":: 10,
|
"chunk-overlap":: 10,
|
||||||
|
|
||||||
"cohere-key":: "${COHERE_KEY}",
|
|
||||||
"cohere-temperature":: 0.0,
|
"cohere-temperature":: 0.0,
|
||||||
|
|
||||||
"text-completion" +: {
|
"text-completion" +: {
|
||||||
|
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
|
local envSecrets = engine.envSecrets("cohere-credentials")
|
||||||
|
.with_env_var("COHERE_KEY", "cohere-key");
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("text-completion")
|
engine.container("text-completion")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
|
|
@ -23,42 +25,19 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
"text-completion-cohere",
|
"text-completion-cohere",
|
||||||
"-p",
|
"-p",
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-k",
|
|
||||||
$["cohere-key"],
|
|
||||||
"-t",
|
"-t",
|
||||||
std.toString($["cohere-temperature"]),
|
std.toString($["cohere-temperature"]),
|
||||||
])
|
])
|
||||||
.with_limits("0.5", "128M")
|
.with_limits("0.5", "128M")
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerRag =
|
||||||
"text-completion", [ container ]
|
|
||||||
);
|
|
||||||
|
|
||||||
local service =
|
|
||||||
engine.internalService(containerSet)
|
|
||||||
.with_port(8000, 8000, "metrics");
|
|
||||||
|
|
||||||
engine.resources([
|
|
||||||
containerSet,
|
|
||||||
service,
|
|
||||||
])
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
"text-completion-rag" +: {
|
|
||||||
|
|
||||||
create:: function(engine)
|
|
||||||
|
|
||||||
local container =
|
|
||||||
engine.container("text-completion-rag")
|
engine.container("text-completion-rag")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
.with_command([
|
.with_command([
|
||||||
"text-completion-cohere",
|
"text-completion-cohere",
|
||||||
"-p",
|
"-p",
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-k",
|
|
||||||
$["cohere-key"],
|
|
||||||
"-t",
|
"-t",
|
||||||
std.toString($["cohere-temperature"]),
|
std.toString($["cohere-temperature"]),
|
||||||
"-i",
|
"-i",
|
||||||
|
|
@ -70,20 +49,30 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerSet = engine.containers(
|
||||||
"text-completion-rag", [ container ]
|
"text-completion", [ container ]
|
||||||
|
);
|
||||||
|
|
||||||
|
local containerSetRag = engine.containers(
|
||||||
|
"text-completion-rag", [ containerRag ]
|
||||||
);
|
);
|
||||||
|
|
||||||
local service =
|
local service =
|
||||||
engine.internalService(containerSet)
|
engine.internalService(containerSet)
|
||||||
.with_port(8000, 8000, "metrics");
|
.with_port(8000, 8000, "metrics");
|
||||||
|
|
||||||
|
local serviceRag =
|
||||||
|
engine.internalService(containerSetRag)
|
||||||
|
.with_port(8000, 8000, "metrics");
|
||||||
|
|
||||||
engine.resources([
|
engine.resources([
|
||||||
|
envSecrets,
|
||||||
containerSet,
|
containerSet,
|
||||||
|
containerSetRag,
|
||||||
service,
|
service,
|
||||||
|
serviceRag,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
},
|
||||||
}
|
|
||||||
|
|
||||||
} + prompts
|
} + prompts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,14 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
{
|
{
|
||||||
|
|
||||||
"ollama-model":: "gemma2:9b",
|
"ollama-model":: "gemma2:9b",
|
||||||
"ollama-url":: "${OLLAMA_HOST}",
|
|
||||||
|
|
||||||
"text-completion" +: {
|
"text-completion" +: {
|
||||||
|
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
|
local envSecrets = engine.envSecrets("ollama-credentials")
|
||||||
|
.with_env_var("OLLAMA_HOST", "ollama-host");
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("text-completion")
|
engine.container("text-completion")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
|
|
@ -21,32 +23,12 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-m",
|
"-m",
|
||||||
$["ollama-model"],
|
$["ollama-model"],
|
||||||
"-r",
|
|
||||||
$["ollama-url"],
|
|
||||||
])
|
])
|
||||||
|
.with_env_var_secrets(envSecrets)
|
||||||
.with_limits("0.5", "128M")
|
.with_limits("0.5", "128M")
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerRag =
|
||||||
"text-completion", [ container ]
|
|
||||||
);
|
|
||||||
|
|
||||||
local service =
|
|
||||||
engine.internalService(containerSet)
|
|
||||||
.with_port(8080, 8080, "metrics");
|
|
||||||
|
|
||||||
engine.resources([
|
|
||||||
containerSet,
|
|
||||||
service,
|
|
||||||
])
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
"text-completion-rag" +: {
|
|
||||||
|
|
||||||
create:: function(engine)
|
|
||||||
|
|
||||||
local container =
|
|
||||||
engine.container("text-completion-rag")
|
engine.container("text-completion-rag")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
.with_command([
|
.with_command([
|
||||||
|
|
@ -55,31 +37,40 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-m",
|
"-m",
|
||||||
$["ollama-model"],
|
$["ollama-model"],
|
||||||
"-r",
|
|
||||||
$["ollama-url"],
|
|
||||||
"-i",
|
"-i",
|
||||||
"non-persistent://tg/request/text-completion-rag",
|
"non-persistent://tg/request/text-completion-rag",
|
||||||
"-o",
|
"-o",
|
||||||
"non-persistent://tg/response/text-completion-rag-response",
|
"non-persistent://tg/response/text-completion-rag-response",
|
||||||
])
|
])
|
||||||
|
.with_env_var_secrets(envSecrets)
|
||||||
.with_limits("0.5", "128M")
|
.with_limits("0.5", "128M")
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerSet = engine.containers(
|
||||||
"text-completion-rag", [ container ]
|
"text-completion", [ container ]
|
||||||
|
);
|
||||||
|
|
||||||
|
local containerSetRag = engine.containers(
|
||||||
|
"text-completion-rag", [ containerRag ]
|
||||||
);
|
);
|
||||||
|
|
||||||
local service =
|
local service =
|
||||||
engine.internalService(containerSet)
|
engine.internalService(containerSet)
|
||||||
.with_port(8080, 8080, "metrics");
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
|
local serviceRag =
|
||||||
|
engine.internalService(containerSetRag)
|
||||||
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
engine.resources([
|
engine.resources([
|
||||||
|
envSecrets,
|
||||||
containerSet,
|
containerSet,
|
||||||
|
containerSetRag,
|
||||||
service,
|
service,
|
||||||
|
serviceRag,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
},
|
||||||
}
|
|
||||||
|
|
||||||
} + prompts
|
} + prompts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
"openai-key":: "${OPENAI_KEY}",
|
|
||||||
"openai-max-output-tokens":: 4096,
|
"openai-max-output-tokens":: 4096,
|
||||||
"openai-temperature":: 0.0,
|
"openai-temperature":: 0.0,
|
||||||
"openai-model":: "GPT-3.5-Turbo",
|
"openai-model":: "GPT-3.5-Turbo",
|
||||||
|
|
@ -14,6 +13,9 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
|
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
|
local envSecrets = engine.envSecrets("openai-credentials")
|
||||||
|
.with_env_var("OPENAI_TOKEN", "openai-token");
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("text-completion")
|
engine.container("text-completion")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
|
|
@ -21,8 +23,6 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
"text-completion-openai",
|
"text-completion-openai",
|
||||||
"-p",
|
"-p",
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-k",
|
|
||||||
$["openai-key"],
|
|
||||||
"-x",
|
"-x",
|
||||||
std.toString($["openai-max-output-tokens"]),
|
std.toString($["openai-max-output-tokens"]),
|
||||||
"-t",
|
"-t",
|
||||||
|
|
@ -30,37 +30,17 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
"-m",
|
"-m",
|
||||||
$["openai-model"],
|
$["openai-model"],
|
||||||
])
|
])
|
||||||
|
.with_env_var_secrets(envSecrets)
|
||||||
.with_limits("0.5", "128M")
|
.with_limits("0.5", "128M")
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerRag =
|
||||||
"text-completion", [ container ]
|
|
||||||
);
|
|
||||||
|
|
||||||
local service =
|
|
||||||
engine.internalService(containerSet)
|
|
||||||
.with_port(8080, 8080, "metrics");
|
|
||||||
|
|
||||||
engine.resources([
|
|
||||||
containerSet,
|
|
||||||
service,
|
|
||||||
])
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
"text-completion-rag" +: {
|
|
||||||
|
|
||||||
create:: function(engine)
|
|
||||||
|
|
||||||
local container =
|
|
||||||
engine.container("text-completion-rag")
|
engine.container("text-completion-rag")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
.with_command([
|
.with_command([
|
||||||
"text-completion-openai",
|
"text-completion-openai",
|
||||||
"-p",
|
"-p",
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-k",
|
|
||||||
$["openai-key"],
|
|
||||||
"-x",
|
"-x",
|
||||||
std.toString($["openai-max-output-tokens"]),
|
std.toString($["openai-max-output-tokens"]),
|
||||||
"-t",
|
"-t",
|
||||||
|
|
@ -72,24 +52,35 @@ local prompts = import "prompts/mixtral.jsonnet";
|
||||||
"-o",
|
"-o",
|
||||||
"non-persistent://tg/response/text-completion-rag-response",
|
"non-persistent://tg/response/text-completion-rag-response",
|
||||||
])
|
])
|
||||||
|
.with_env_var_secrets(envSecrets)
|
||||||
.with_limits("0.5", "128M")
|
.with_limits("0.5", "128M")
|
||||||
.with_reservations("0.1", "128M");
|
.with_reservations("0.1", "128M");
|
||||||
|
|
||||||
local containerSet = engine.containers(
|
local containerSet = engine.containers(
|
||||||
"text-completion-rag", [ container ]
|
"text-completion", [ container ]
|
||||||
|
);
|
||||||
|
|
||||||
|
local containerSetRag = engine.containers(
|
||||||
|
"text-completion-rag", [ containerRag ]
|
||||||
);
|
);
|
||||||
|
|
||||||
local service =
|
local service =
|
||||||
engine.internalService(containerSet)
|
engine.internalService(containerSet)
|
||||||
.with_port(8080, 8080, "metrics");
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
|
local serviceRag =
|
||||||
|
engine.internalService(containerSetRag)
|
||||||
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
engine.resources([
|
engine.resources([
|
||||||
|
envSecrets,
|
||||||
containerSet,
|
containerSet,
|
||||||
|
containerSetRag,
|
||||||
service,
|
service,
|
||||||
|
serviceRag,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
},
|
||||||
}
|
|
||||||
|
|
||||||
} + prompts
|
} + prompts
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue