Skip to content

Commit de87bfa

Browse files
committed
add chatapi by akash network to model configs
1 parent 67f85fb commit de87bfa

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed

.env.example

+6
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,12 @@ SMALL_VENICE_MODEL= # Default: llama-3.3-70b
231231
MEDIUM_VENICE_MODEL= # Default: llama-3.3-70b
232232
LARGE_VENICE_MODEL= # Default: llama-3.1-405b
233233

234+
# Akash Chat API Configuration docs: https://chatapi.akash.network/documentation
235+
AKASH_CHAT_API_KEY= # Get from https://chatapi.akash.network/
236+
SMALL_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-2-3B-Instruct
237+
MEDIUM_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-3-70B-Instruct
238+
LARGE_AKASH_CHAT_API_MODEL= # Default: Meta-Llama-3-1-405B-Instruct-FP8
239+
234240
# fal.ai Configuration
235241
FAL_API_KEY=
236242
FAL_AI_LORA_PATH=

agent/src/index.ts

+5
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ export function getTokenForProvider(
291291
character.settings?.secrets?.VENICE_API_KEY ||
292292
settings.VENICE_API_KEY
293293
);
294+
case ModelProviderName.AKASH_CHAT_API:
295+
return (
296+
character.settings?.secrets?.AKASH_CHAT_API_KEY ||
297+
settings.AKASH_CHAT_API_KEY
298+
);
294299
}
295300
}
296301

packages/core/src/models.ts

+20
Original file line numberDiff line numberDiff line change
@@ -465,6 +465,26 @@ export const models: Models = {
465465
[ModelClass.LARGE]: settings.LARGE_VENICE_MODEL || "llama-3.1-405b",
466466
},
467467
},
468+
[ModelProviderName.AKASH_CHAT_API]: {
469+
endpoint: "https://chatapi.akash.network/api/v1",
470+
settings: {
471+
stop: [],
472+
maxInputTokens: 128000,
473+
maxOutputTokens: 8192,
474+
temperature: 0.6,
475+
},
476+
model: {
477+
[ModelClass.SMALL]:
478+
settings.SMALL_AKASH_CHAT_API_MODEL ||
479+
"Meta-Llama-3-2-3B-Instruct",
480+
[ModelClass.MEDIUM]:
481+
settings.MEDIUM_AKASH_CHAT_API_MODEL ||
482+
"Meta-Llama-3-3-70B-Instruct",
483+
[ModelClass.LARGE]:
484+
settings.LARGE_AKASH_CHAT_API_MODEL ||
485+
"Meta-Llama-3-1-405B-Instruct-FP8",
486+
},
487+
},
468488
};
469489

470490
export function getModel(provider: ModelProviderName, type: ModelClass) {

packages/core/src/types.ts

+2
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ export type Models = {
208208
[ModelProviderName.NANOGPT]: Model;
209209
[ModelProviderName.HYPERBOLIC]: Model;
210210
[ModelProviderName.VENICE]: Model;
211+
[ModelProviderName.AKASH_CHAT_API]: Model;
211212
};
212213

213214
/**
@@ -236,6 +237,7 @@ export enum ModelProviderName {
236237
NANOGPT = "nanogpt",
237238
HYPERBOLIC = "hyperbolic",
238239
VENICE = "venice",
240+
AKASH_CHAT_API = "akash_chat_api",
239241
}
240242

241243
/**

0 commit comments

Comments
 (0)