Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

🏷️ chore: Add Unofficial Naming Variation for Claude-3.5-Sonnet (#3800)

Danny Avilaf742b9972ec7
diff --git a/api/models/tx.js b/api/models/tx.js
index adbedd82c3..1b515cca2a 100644
--- a/api/models/tx.js
+++ b/api/models/tx.js
@@ -55,6 +55,7 @@ const tokenValues = Object.assign(
'claude-3-opus': { prompt: 15, completion: 75 },
'claude-3-sonnet': { prompt: 3, completion: 15 },
'claude-3-5-sonnet': { prompt: 3, completion: 15 },
+ 'claude-3.5-sonnet': { prompt: 3, completion: 15 },
'claude-3-haiku': { prompt: 0.25, completion: 1.25 },
'claude-2.1': { prompt: 8, completion: 24 },
'claude-2': { prompt: 8, completion: 24 },
@@ -77,6 +78,7 @@ const tokenValues = Object.assign(
* @type {Object.<string, {write: number, read: number }>}
*/
const cacheTokenValues = {
+ 'claude-3.5-sonnet': { write: 3.75, read: 0.3 },
'claude-3-5-sonnet': { write: 3.75, read: 0.3 },
'claude-3-haiku': { write: 0.3, read: 0.03 },
};
diff --git a/api/models/tx.spec.js b/api/models/tx.spec.js
index db0251dbb6..f0a118c012 100644
--- a/api/models/tx.spec.js
+++ b/api/models/tx.spec.js
@@ -82,6 +82,13 @@ describe('getValueKey', () => {
expect(getValueKey('claude-3-5-sonnet-turbo')).toBe('claude-3-5-sonnet');
expect(getValueKey('claude-3-5-sonnet-0125')).toBe('claude-3-5-sonnet');
});
+
+ it('should return "claude-3.5-sonnet" for model type of "claude-3.5-sonnet-"', () => {
+ expect(getValueKey('claude-3.5-sonnet-20240620')).toBe('claude-3.5-sonnet');
+ expect(getValueKey('anthropic/claude-3.5-sonnet')).toBe('claude-3.5-sonnet');
+ expect(getValueKey('claude-3.5-sonnet-turbo')).toBe('claude-3.5-sonnet');
+ expect(getValueKey('claude-3.5-sonnet-0125')).toBe('claude-3.5-sonnet');
+ });
});
describe('getMultiplier', () => {
diff --git a/api/utils/tokens.js b/api/utils/tokens.js
index 122c3c3f0a..f236fa8f4d 100644
--- a/api/utils/tokens.js
+++ b/api/utils/tokens.js
@@ -60,6 +60,7 @@ const anthropicModels = {
'claude-3-sonnet': 200000,
'claude-3-opus': 200000,
'claude-3-5-sonnet': 200000,
+ 'claude-3.5-sonnet': 200000,
};
const aggregateModels = { ...openAIModels, ...googleModels, ...anthropicModels, ...cohereModels };