Added basic Llamafile integration (#63)

* Added basic Llamafile integration
* Added llamafile template support
* New templates following llamafile addition
---------
Co-authored-by: Cyber MacGeddon <cybermaggedon@gmail.com>
This commit is contained in:
Jack Colquitt 2024-09-16 08:18:01 -07:00 committed by GitHub
parent 6af86fa09f
commit 9612a11581
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 1467 additions and 268 deletions

View file

@ -0,0 +1,75 @@
local base = import "base/base.jsonnet";
local images = import "values/images.jsonnet";
local url = import "values/url.jsonnet";
local prompts = import "prompts/slm.jsonnet";
{
"llamafile-model":: "LLaMA_CPP",
"llamafile-url":: "${LLAMAFILE_URL}",
"text-completion" +: {
create:: function(engine)
local container =
engine.container("text-completion")
.with_image(images.trustgraph)
.with_command([
"text-completion-llamafile",
"-p",
url.pulsar,
"-m",
$["llamafile-model"],
"-r",
$["llamafile-url"],
])
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"text-completion", [ container ]
);
engine.resources([
containerSet,
])
},
"text-completion-rag" +: {
create:: function(engine)
local container =
engine.container("text-completion-rag")
.with_image(images.trustgraph)
.with_command([
"text-completion-llamafile",
"-p",
url.pulsar,
"-m",
$["llamafile-model"],
"-r",
$["llamafile-url"],
"-i",
"non-persistent://tg/request/text-completion-rag",
"-o",
"non-persistent://tg/response/text-completion-rag-response",
])
.with_limits("0.5", "128M")
.with_reservations("0.1", "128M");
local containerSet = engine.containers(
"text-completion-rag", [ container ]
);
engine.resources([
containerSet,
])
}
} + prompts