2024-08-30 17:47:35 +01:00
|
|
|
local base = import "base/base.jsonnet";
|
|
|
|
|
local images = import "values/images.jsonnet";
|
|
|
|
|
local url = import "values/url.jsonnet";
|
|
|
|
|
local prompts = import "prompts/openai.jsonnet";
|
2024-08-14 20:56:57 +01:00
|
|
|
{
|
2024-08-30 17:47:35 +01:00
|
|
|
|
|
|
|
|
"openai-key":: "${OPENAI_KEY}",
|
|
|
|
|
"openai-max-output-tokens":: 4096,
|
|
|
|
|
"openai-temperature":: 0.0,
|
2024-08-30 21:33:03 +01:00
|
|
|
"openai-model":: "GPT-3.5-Turbo",
|
2024-08-30 17:47:35 +01:00
|
|
|
|
2024-08-14 20:56:57 +01:00
|
|
|
services +: {
|
|
|
|
|
|
|
|
|
|
"text-completion": base + {
|
|
|
|
|
image: images.trustgraph,
|
|
|
|
|
command: [
|
|
|
|
|
"text-completion-openai",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"-k",
|
2024-08-30 17:47:35 +01:00
|
|
|
$["openai-key"],
|
2024-08-22 00:19:55 +01:00
|
|
|
"-x",
|
2024-08-30 17:47:35 +01:00
|
|
|
std.toString($["openai-max-output-tokens"]),
|
2024-08-22 00:19:55 +01:00
|
|
|
"-t",
|
2024-08-30 17:47:35 +01:00
|
|
|
std.toString($["openai-temperature"]),
|
2024-08-30 21:33:03 +01:00
|
|
|
"-m",
|
|
|
|
|
$["openai-model"],
|
2024-08-14 20:56:57 +01:00
|
|
|
],
|
2024-08-22 17:54:00 +01:00
|
|
|
deploy: {
|
|
|
|
|
resources: {
|
|
|
|
|
limits: {
|
2024-08-22 20:58:44 +01:00
|
|
|
cpus: '0.5',
|
2024-08-22 17:54:00 +01:00
|
|
|
memory: '128M'
|
|
|
|
|
},
|
|
|
|
|
reservations: {
|
|
|
|
|
cpus: '0.1',
|
|
|
|
|
memory: '128M'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-08-14 20:56:57 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
"text-completion-rag": base + {
|
|
|
|
|
image: images.trustgraph,
|
|
|
|
|
command: [
|
|
|
|
|
"text-completion-openai",
|
|
|
|
|
"-p",
|
|
|
|
|
url.pulsar,
|
|
|
|
|
"-k",
|
2024-08-30 17:47:35 +01:00
|
|
|
$["openai-key"],
|
2024-08-22 00:19:55 +01:00
|
|
|
"-x",
|
2024-08-30 17:47:35 +01:00
|
|
|
std.toString($["openai-max-output-tokens"]),
|
2024-08-22 00:19:55 +01:00
|
|
|
"-t",
|
2024-08-30 17:47:35 +01:00
|
|
|
std.toString($["openai-temperature"]),
|
2024-08-30 21:33:03 +01:00
|
|
|
"-m",
|
|
|
|
|
$["openai-model"],
|
2024-08-14 20:56:57 +01:00
|
|
|
"-i",
|
|
|
|
|
"non-persistent://tg/request/text-completion-rag",
|
|
|
|
|
"-o",
|
|
|
|
|
"non-persistent://tg/response/text-completion-rag-response",
|
|
|
|
|
],
|
2024-08-22 17:54:00 +01:00
|
|
|
deploy: {
|
|
|
|
|
resources: {
|
|
|
|
|
limits: {
|
2024-08-22 20:58:44 +01:00
|
|
|
cpus: '0.5',
|
2024-08-22 17:54:00 +01:00
|
|
|
memory: '128M'
|
|
|
|
|
},
|
|
|
|
|
reservations: {
|
|
|
|
|
cpus: '0.1',
|
|
|
|
|
memory: '128M'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-08-14 20:56:57 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
},
|
2024-08-23 23:34:16 +01:00
|
|
|
} + prompts
|