mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-17 01:01:03 +02:00
Updating templates
This commit is contained in:
parent
fc87c12118
commit
cc29e6a53c
3 changed files with 27 additions and 27 deletions
|
|
@ -6,12 +6,14 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
{
|
{
|
||||||
|
|
||||||
"llamafile-model":: "LLaMA_CPP",
|
"llamafile-model":: "LLaMA_CPP",
|
||||||
"llamafile-url":: "${LLAMAFILE_URL}",
|
|
||||||
|
|
||||||
"text-completion" +: {
|
"text-completion" +: {
|
||||||
|
|
||||||
create:: function(engine)
|
create:: function(engine)
|
||||||
|
|
||||||
|
local envSecrets = engine.envSecrets("llamafile-credentials")
|
||||||
|
.with_env_var("LLAMAFILE_URL", "llamafile-url");
|
||||||
|
|
||||||
local container =
|
local container =
|
||||||
engine.container("text-completion")
|
engine.container("text-completion")
|
||||||
.with_image(images.trustgraph)
|
.with_image(images.trustgraph)
|
||||||
|
|
@ -21,27 +23,12 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-m",
|
"-m",
|
||||||
$["llamafile-model"],
|
$["llamafile-model"],
|
||||||
"-r",
|
|
||||||
$["llamafile-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 ]
|
|
||||||
);
|
|
||||||
|
|
||||||
engine.resources([
|
|
||||||
containerSet,
|
|
||||||
])
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
"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([
|
||||||
|
|
@ -50,26 +37,40 @@ local prompts = import "prompts/slm.jsonnet";
|
||||||
url.pulsar,
|
url.pulsar,
|
||||||
"-m",
|
"-m",
|
||||||
$["llamafile-model"],
|
$["llamafile-model"],
|
||||||
"-r",
|
|
||||||
$["llamafile-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 =
|
||||||
|
engine.internalService(containerSet)
|
||||||
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
|
local serviceRag =
|
||||||
|
engine.internalService(containerSetRag)
|
||||||
|
.with_port(8080, 8080, "metrics");
|
||||||
|
|
||||||
engine.resources([
|
engine.resources([
|
||||||
|
envSecrets,
|
||||||
containerSet,
|
containerSet,
|
||||||
|
containerSetRag,
|
||||||
|
service,
|
||||||
|
serviceRag,
|
||||||
])
|
])
|
||||||
|
|
||||||
|
},
|
||||||
}
|
|
||||||
|
|
||||||
} + prompts
|
} + prompts
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ default_input_queue = text_completion_request_queue
|
||||||
default_output_queue = text_completion_response_queue
|
default_output_queue = text_completion_response_queue
|
||||||
default_subscriber = module
|
default_subscriber = module
|
||||||
default_model = 'mistral.mistral-large-2407-v1:0'
|
default_model = 'mistral.mistral-large-2407-v1:0'
|
||||||
default_region = 'us-west-2'
|
default_region = os.getenv("AWS_REGION", 'us-west-2')
|
||||||
default_temperature = 0.0
|
default_temperature = 0.0
|
||||||
default_max_output = 2048
|
default_max_output = 2048
|
||||||
default_aws_id = os.getenv("AWS_ID_KEY")
|
default_aws_id = os.getenv("AWS_ID_KEY")
|
||||||
|
|
@ -307,7 +307,7 @@ class Processor(ConsumerProducer):
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-r', '--aws-region',
|
'-r', '--aws-region',
|
||||||
help=f'AWS Region (default: us-west-2)'
|
help=f'AWS Region'
|
||||||
)
|
)
|
||||||
|
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
@ -328,4 +328,3 @@ def run():
|
||||||
|
|
||||||
Processor.start(module, __doc__)
|
Processor.start(module, __doc__)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ default_input_queue = text_completion_request_queue
|
||||||
default_output_queue = text_completion_response_queue
|
default_output_queue = text_completion_response_queue
|
||||||
default_subscriber = module
|
default_subscriber = module
|
||||||
default_model = 'LLaMA_CPP'
|
default_model = 'LLaMA_CPP'
|
||||||
default_llamafile = 'http://localhost:8080/v1'
|
default_llamafile = os.getenv("LLAMAFILE_URL", "http://localhost:8080/v1")
|
||||||
default_temperature = 0.0
|
default_temperature = 0.0
|
||||||
default_max_output = 4096
|
default_max_output = 4096
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue