Skip to content

Commit

Permalink
fix: Set the SMALL MEDIUM LARGE Gaianet model in the env.
Browse files Browse the repository at this point in the history
  • Loading branch information
L-jasmine committed Dec 8, 2024
1 parent 99d4a84 commit 9903db8
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
10 changes: 10 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,16 @@ HEURIST_IMAGE_MODEL=
# Gaianet Configuration
GAIANET_MODEL=
GAIANET_SERVER_URL=

SMALL_GAIANET_MODEL= # Default: llama3b
SMALL_GAIANET_SERVER_URL= # Default: https://llama3b.gaia.domains/v1

MEDIUM_GAIANET_MODEL= # Default: llama
MEDIUM_GAIANET_SERVER_URL= # Default: https://llama8b.gaia.domains/v1

LARGE_GAIANET_MODEL= # Default: qwen72b
LARGE_GAIANET_SERVER_URL= # Default: https://qwen72b.gaia.domains/v1

GAIANET_EMBEDDING_MODEL=
USE_GAIANET_EMBEDDING= # Set to TRUE for GAIANET/768, leave blank for local

Expand Down
4 changes: 3 additions & 1 deletion packages/core/src/embedding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,9 @@ export async function embed(runtime: IAgentRuntime, input: string) {
endpoint:
runtime.character.modelEndpointOverride ||
models[ModelProviderName.GAIANET].endpoint ||
"https://qwen72b.gaia.domains/v1",
settings.SMALL_GAIANET_SERVER_URL ||
settings.MEDIUM_GAIANET_SERVER_URL ||
settings.LARGE_GAIANET_SERVER_URL,
apiKey: settings.GAIANET_API_KEY || runtime.token,
dimensions: config.dimensions,
});
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,13 +391,13 @@ export async function generateText({
if(!baseURL){
switch(modelClass){
case ModelClass.SMALL:
baseURL = "https://llama3b.gaia.domains/v1";
baseURL = settings.SMALL_GAIANET_SERVER_URL || "https://llama3b.gaia.domains/v1";
break;
case ModelClass.MEDIUM:
baseURL = "https://llama8b.gaia.domains/v1";
baseURL = settings.MEDIUM_GAIANET_SERVER_URL || "https://llama8b.gaia.domains/v1";
break;
case ModelClass.LARGE:
baseURL = "https://qwen72b.gaia.domains/v1";
baseURL = settings.LARGE_GAIANET_SERVER_URL || "https://qwen72b.gaia.domains/v1";
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ export const models: Models = {
},
endpoint: settings.GAIANET_SERVER_URL,
model: {
[ModelClass.SMALL]: settings.GAIANET_MODEL || "llama3b",
[ModelClass.MEDIUM]: settings.GAIANET_MODEL || "llama",
[ModelClass.LARGE]: settings.GAIANET_MODEL || "qwen72b",
[ModelClass.SMALL]: settings.GAIANET_MODEL || settings.SMALL_GAIANET_MODEL || "llama3b",
[ModelClass.MEDIUM]: settings.GAIANET_MODEL || settings.MEDIUM_GAIANET_MODEL || "llama",
[ModelClass.LARGE]: settings.GAIANET_MODEL || settings.LARGE_GAIANET_MODEL || "qwen72b",
[ModelClass.EMBEDDING]:
settings.GAIANET_EMBEDDING_MODEL || "nomic-embed",
},
Expand Down

0 comments on commit 9903db8

Please sign in to comment.