Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Config eternalai model from env #927

Merged
merged 3 commits into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ DISCORD_VOICE_CHANNEL_ID= # The ID of the voice channel the bot should join (opt
# AI Model API Keys
OPENAI_API_KEY= # OpenAI API key, starting with sk-

# Eternal AI's Decentralized Inference API
ETERNALAI_URL=
ETERNALAI_MODEL= #Default: "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16"
ETERNALAI_API_KEY=

GROK_API_KEY= # GROK API Key
Expand Down
83 changes: 40 additions & 43 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,9 @@ export const models: Models = {
temperature: 0.6,
},
model: {
[ModelClass.SMALL]:
"neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.MEDIUM]:
"neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.LARGE]:
"neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.SMALL]: settings.ETERNALAI_MODEL || "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.MEDIUM]: settings.ETERNALAI_MODEL || "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.LARGE]: settings.ETERNALAI_MODEL || "neuralmagic/Meta-Llama-3.1-405B-Instruct-quantized.w4a16",
[ModelClass.EMBEDDING]: "",
[ModelClass.IMAGE]: "",
},
Expand Down Expand Up @@ -180,17 +177,17 @@ export const models: Models = {
},
model: {
[ModelClass.SMALL]: settings.SMALL_GOOGLE_MODEL ||
settings.GOOGLE_MODEL ||
"gemini-1.5-flash-latest",
settings.GOOGLE_MODEL ||
"gemini-1.5-flash-latest",
[ModelClass.MEDIUM]: settings.MEDIUM_GOOGLE_MODEL ||
settings.GOOGLE_MODEL ||
"gemini-1.5-flash-latest",
settings.GOOGLE_MODEL ||
"gemini-1.5-flash-latest",
[ModelClass.LARGE]: settings.LARGE_GOOGLE_MODEL ||
settings.GOOGLE_MODEL ||
"gemini-1.5-pro-latest",
settings.GOOGLE_MODEL ||
"gemini-1.5-pro-latest",
[ModelClass.EMBEDDING]: settings.EMBEDDING_GOOGLE_MODEL ||
settings.GOOGLE_MODEL ||
"text-embedding-004",
settings.GOOGLE_MODEL ||
"text-embedding-004",
},
},
[ModelProviderName.REDPILL]: {
Expand All @@ -207,17 +204,17 @@ export const models: Models = {
// To test other models, change the models below
model: {
[ModelClass.SMALL]:
settings.SMALL_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o-mini",
settings.SMALL_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o-mini",
[ModelClass.MEDIUM]:
settings.MEDIUM_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o",
settings.MEDIUM_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o",
[ModelClass.LARGE]:
settings.LARGE_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o",
settings.LARGE_REDPILL_MODEL ||
settings.REDPILL_MODEL ||
"gpt-4o",
[ModelClass.EMBEDDING]: "text-embedding-3-small",
},
},
Expand All @@ -235,17 +232,17 @@ export const models: Models = {
// To test other models, change the models below
model: {
[ModelClass.SMALL]:
settings.SMALL_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
settings.SMALL_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
[ModelClass.MEDIUM]:
settings.MEDIUM_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
settings.MEDIUM_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
[ModelClass.LARGE]:
settings.LARGE_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
settings.LARGE_OPENROUTER_MODEL ||
settings.OPENROUTER_MODEL ||
"nousresearch/hermes-3-llama-3.1-405b",
[ModelClass.EMBEDDING]: "text-embedding-3-small",
},
},
Expand All @@ -261,19 +258,19 @@ export const models: Models = {
endpoint: settings.OLLAMA_SERVER_URL || "http://localhost:11434",
model: {
[ModelClass.SMALL]:
settings.SMALL_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"llama3.2",
settings.SMALL_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"llama3.2",
[ModelClass.MEDIUM]:
settings.MEDIUM_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"hermes3",
settings.MEDIUM_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"hermes3",
[ModelClass.LARGE]:
settings.LARGE_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"hermes3:70b",
settings.LARGE_OLLAMA_MODEL ||
settings.OLLAMA_MODEL ||
"hermes3:70b",
[ModelClass.EMBEDDING]:
settings.OLLAMA_EMBEDDING_MODEL || "mxbai-embed-large",
settings.OLLAMA_EMBEDDING_MODEL || "mxbai-embed-large",
},
},
[ModelProviderName.HEURIST]: {
Expand Down Expand Up @@ -347,7 +344,7 @@ export const models: Models = {
[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",
settings.GAIANET_EMBEDDING_MODEL || "nomic-embed",
},
},
[ModelProviderName.ALI_BAILIAN]: {
Expand Down
Loading