-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added jsonnet for GoogleAIStudio * Port the template to 0.13, env secrets for k8s --------- Co-authored-by: JackColquitt <[email protected]>
- Loading branch information
1 parent
ec444d1
commit af0c854
Showing
4 changed files
with
115 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
local base = import "base/base.jsonnet"; | ||
local images = import "values/images.jsonnet"; | ||
local url = import "values/url.jsonnet"; | ||
local prompts = import "prompts/mixtral.jsonnet"; | ||
|
||
{ | ||
|
||
"googleaistudio-max-output-tokens":: 4096, | ||
"googleaistudio-temperature":: 0.0, | ||
|
||
"text-completion" +: { | ||
|
||
create:: function(engine) | ||
|
||
local envSecrets = engine.envSecrets("bedrock-credentials") | ||
.with_env_var("GOOGLEAISTUDIO_KEY", "googleaistudio-key"); | ||
|
||
local container = | ||
engine.container("text-completion") | ||
.with_image(images.trustgraph) | ||
.with_command([ | ||
"text-completion-googleaistudio", | ||
"-p", | ||
url.pulsar, | ||
"-x", | ||
std.toString($["googleaistudio-max-output-tokens"]), | ||
"-t", | ||
std.toString($["googleaistudio-temperature"]), | ||
]) | ||
.with_env_var_secrets(envSecrets) | ||
.with_limits("0.5", "128M") | ||
.with_reservations("0.1", "128M"); | ||
|
||
local containerRag = | ||
engine.container("text-completion-rag") | ||
.with_image(images.trustgraph) | ||
.with_command([ | ||
"text-completion-googleaistudio", | ||
"-p", | ||
url.pulsar, | ||
"-x", | ||
std.toString($["googleaistudio-max-output-tokens"]), | ||
"-t", | ||
std.toString($["googleaistudio-temperature"]), | ||
"-i", | ||
"non-persistent://tg/request/text-completion-rag", | ||
"-o", | ||
"non-persistent://tg/response/text-completion-rag-response", | ||
]) | ||
.with_env_var_secrets(envSecrets) | ||
.with_limits("0.5", "128M") | ||
.with_reservations("0.1", "128M"); | ||
|
||
local containerSet = engine.containers( | ||
"text-completion", [ container ] | ||
); | ||
|
||
local containerSetRag = engine.containers( | ||
"text-completion-rag", [ containerRag ] | ||
); | ||
|
||
local service = | ||
engine.internalService(containerSet) | ||
.with_port(8000, 8000, "metrics"); | ||
|
||
local serviceRag = | ||
engine.internalService(containerSetRag) | ||
.with_port(8000, 8000, "metrics"); | ||
|
||
engine.resources([ | ||
envSecrets, | ||
containerSet, | ||
containerSetRag, | ||
service, | ||
serviceRag, | ||
]) | ||
|
||
}, | ||
|
||
} + prompts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
pattern: { | ||
name: "googleaistudio", | ||
icon: "🤖💬", | ||
title: "Add GoogleAIStudio for text completion", | ||
description: "This pattern integrates a GoogleAIStudio LLM service for text completion operations. You need a GoogleAISTudio API key to be able to use this service.", | ||
requires: ["pulsar", "trustgraph"], | ||
features: ["llm"], | ||
args: [ | ||
{ | ||
name: "googleaistudio-max-output-tokens", | ||
label: "Maximum output tokens", | ||
type: "integer", | ||
description: "Limit on number tokens to generate", | ||
default: 4096, | ||
required: true, | ||
}, | ||
{ | ||
name: "googleaistudio-temperature", | ||
label: "Temperature", | ||
type: "slider", | ||
description: "Controlling predictability / creativity balance", | ||
min: 0, | ||
max: 1, | ||
step: 0.05, | ||
default: 0.5, | ||
}, | ||
], | ||
category: [ "llm" ], | ||
}, | ||
module: "components/googleaistudio.jsonnet", | ||
} |