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: allow users to configure models for openai and anthropic #999

Merged
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
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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-
SMALL_OPENAI_MODEL= # Default: gpt-4o-mini
MEDIUM_OPENAI_MODEL= # Default: gpt-4o
LARGE_OPENAI_MODEL= # Default: gpt-4o
EMBEDDING_OPENAI_MODEL= # Default: text-embedding-3-small
IMAGE_OPENAI_MODEL= # Default: dall-e-3
shakkernerd marked this conversation as resolved.
Show resolved Hide resolved

# Eternal AI's Decentralized Inference API
ETERNALAI_URL=
Expand Down Expand Up @@ -107,6 +112,10 @@ LLAMALOCAL_PATH= # Default: "" which is the current directory in plugin-node/dis

# API Keys
ANTHROPIC_API_KEY= # For Claude
SMALL_ANTHROPIC_MODEL= # Default: claude-3-haiku-20240307
MEDIUM_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022
LARGE_ANTHROPIC_MODEL= # Default: claude-3-5-sonnet-20241022

HEURIST_API_KEY= # Get from https://heurist.ai/dev-access

# Heurist Models
Expand Down
16 changes: 8 additions & 8 deletions packages/core/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ export const models: Models = {
temperature: 0.6,
},
model: {
[ModelClass.SMALL]: "gpt-4o-mini",
[ModelClass.MEDIUM]: "gpt-4o",
[ModelClass.LARGE]: "gpt-4o",
[ModelClass.EMBEDDING]: "text-embedding-3-small",
[ModelClass.IMAGE]: "dall-e-3",
[ModelClass.SMALL]: settings.SMALL_OPENAI_MODEL || "gpt-4o-mini",
[ModelClass.MEDIUM]: settings.MEDIUM_OPENAI_MODEL || "gpt-4o",
[ModelClass.LARGE]: settings.LARGE_OPENAI_MODEL || "gpt-4o",
[ModelClass.EMBEDDING]: settings.EMBEDDING_OPENAI_MODEL || "text-embedding-3-small",
[ModelClass.IMAGE]: settings.IMAGE_OPENAI_MODEL || "dall-e-3",
},
},
[ModelProviderName.ETERNALAI]: {
Expand Down Expand Up @@ -55,9 +55,9 @@ export const models: Models = {
},
endpoint: "https://api.anthropic.com/v1",
model: {
[ModelClass.SMALL]: "claude-3-haiku-20240307",
[ModelClass.MEDIUM]: "claude-3-5-sonnet-20241022",
[ModelClass.LARGE]: "claude-3-5-sonnet-20241022",
[ModelClass.SMALL]: settings.SMALL_ANTHROPIC_MODEL || "claude-3-haiku-20240307",
[ModelClass.MEDIUM]: settings.MEDIUM_ANTHROPIC_MODEL || "claude-3-5-sonnet-20241022",
[ModelClass.LARGE]: settings.LARGE_ANTHROPIC_MODEL || "claude-3-5-sonnet-20241022",
},
},
[ModelProviderName.CLAUDE_VERTEX]: {
Expand Down
Loading