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
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🧹 chore: Remove Deprecated Gemini 2.0 Models & Fix Mistral-Large-3 Context Window (#12453)
Danny Avilaf82d4300a471
diff --git a/api/utils/tokens.spec.js b/api/utils/tokens.spec.jsindex 6cecdb95c8..dfa6762ee5 100644--- a/api/utils/tokens.spec.js+++ b/api/utils/tokens.spec.js@@ -1813,3 +1813,57 @@ describe('GLM Model Tests (Zhipu AI)', () => {});});});++describe('Mistral Model Tests', () => {+ describe('getModelMaxTokens', () => {+ test('should return correct tokens for mistral-large-3 (256k context)', () => {+ expect(getModelMaxTokens('mistral-large-3', EModelEndpoint.custom)).toBe(+ maxTokensMap[EModelEndpoint.custom]['mistral-large-3'],+ );+ });++ test('should match mistral-large-3 for suffixed variants', () => {+ expect(getModelMaxTokens('mistral-large-3-instruct', EModelEndpoint.custom)).toBe(+ maxTokensMap[EModelEndpoint.custom]['mistral-large-3'],+ );+ });++ test('should not match mistral-large-3 for generic mistral-large', () => {+ expect(getModelMaxTokens('mistral-large', EModelEndpoint.custom)).toBe(+ maxTokensMap[EModelEndpoint.custom]['mistral-large'],+ );+ expect(getModelMaxTokens('mistral-large-latest', EModelEndpoint.custom)).toBe(+ maxTokensMap[EModelEndpoint.custom]['mistral-large'],+ );+ });+ });++ describe('matchModelName', () => {+ test('should match mistral-large-3 exactly', () => {+ expect(matchModelName('mistral-large-3', EModelEndpoint.custom)).toBe('mistral-large-3');+ });++ test('should match mistral-large-3 for prefixed/suffixed variants', () => {+ expect(matchModelName('mistral/mistral-large-3', EModelEndpoint.custom)).toBe(+ 'mistral-large-3',+ );+ expect(matchModelName('mistral-large-3-instruct', EModelEndpoint.custom)).toBe(+ 'mistral-large-3',+ );+ });++ test('should match generic mistral-large for non-3 variants', () => {+ expect(matchModelName('mistral-large-latest', EModelEndpoint.custom)).toBe('mistral-large');+ });+ });++ describe('findMatchingPattern', () => {+ test('should prefer mistral-large-3 over mistral-large for mistral-large-3 variants', () => {+ const result = findMatchingPattern(+ 'mistral-large-3-instruct',+ maxTokensMap[EModelEndpoint.custom],+ );+ expect(result).toBe('mistral-large-3');+ });+ });+});diff --git a/packages/api/src/utils/tokens.ts b/packages/api/src/utils/tokens.tsindex ae09da4f28..14215698a6 100644--- a/packages/api/src/utils/tokens.ts+++ b/packages/api/src/utils/tokens.ts@@ -72,6 +72,7 @@ const mistralModels = {'mistral-large-2402': 127500,'mistral-large-2407': 127500,'mistral-large': 131000,+ 'mistral-large-3': 255000,'mistral-saba': 32000,'ministral-3b': 131000,'ministral-8b': 131000,diff --git a/packages/data-provider/src/config.ts b/packages/data-provider/src/config.tsindex e641d7b63a..bb89c56f82 100644--- a/packages/data-provider/src/config.ts+++ b/packages/data-provider/src/config.ts@@ -1238,9 +1238,6 @@ export const defaultModels = {'gemini-2.5-pro','gemini-2.5-flash','gemini-2.5-flash-lite',- // Gemini 2.0 Models- 'gemini-2.0-flash-001',- 'gemini-2.0-flash-lite',],[EModelEndpoint.anthropic]: sharedAnthropicModels,[EModelEndpoint.openAI]: [