From 466b1982f26f63e74a290b633433870b2cea4a63 Mon Sep 17 00:00:00 2001 From: Michael Overhorst Date: Mon, 3 Feb 2025 13:34:16 +0100 Subject: [PATCH 1/3] feat: Add support for all available Mistral API models - Add all available Mistral models with specific version numbers - Include Premier models (Mistral Large, Pixtral, Ministral, etc.) - Include Free models (Mistral Small, Pixtral 12B, etc.) - Set correct token limits and pricing for each model Fixes #1609 --- src/shared/api.ts | 86 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 83 insertions(+), 3 deletions(-) diff --git a/src/shared/api.ts b/src/shared/api.ts index de36d1fb46..8bda7877dd 100644 --- a/src/shared/api.ts +++ b/src/shared/api.ts @@ -408,10 +408,90 @@ export const deepSeekModels = { // Mistral // https://docs.mistral.ai/getting-started/models/models_overview/ export type MistralModelId = keyof typeof mistralModels -export const mistralDefaultModelId: MistralModelId = "codestral-latest" +export const mistralDefaultModelId: MistralModelId = "codestral-2501" export const mistralModels = { - "codestral-latest": { - maxTokens: 32_768, + "mistral-large-2411": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 2.0, + outputPrice: 6.0, + }, + "pixtral-large-2411": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: true, + supportsPromptCache: false, + inputPrice: 2.0, + outputPrice: 6.0, + }, + "ministral-3b-2410": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.04, + outputPrice: 0.04, + }, + "ministral-8b-2410": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.1, + outputPrice: 0.1, + }, + "mistral-embed": { + maxTokens: 8_000, + contextWindow: 8_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.1, + outputPrice: 0.1, + }, + "mistral-moderation-2411": { + maxTokens: 8_000, + contextWindow: 8_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.1, + outputPrice: 0.1, + }, + "mistral-small-2501": { + maxTokens: 32_000, + contextWindow: 32_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.1, + outputPrice: 0.3, + }, + "pixtral-12b-2409": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: true, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.15, + }, + "open-mistral-nemo-2407": { + maxTokens: 131_000, + contextWindow: 131_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.15, + }, + "open-codestral-mamba": { + maxTokens: 256_000, + contextWindow: 256_000, + supportsImages: false, + supportsPromptCache: false, + inputPrice: 0.15, + outputPrice: 0.15, + }, + "codestral-2501": { + maxTokens: 256_000, contextWindow: 256_000, supportsImages: false, supportsPromptCache: false, From 2cc0fa906c64329a0721295ee27e1596f13d7a10 Mon Sep 17 00:00:00 2001 From: Michael Overhorst Date: Wed, 5 Feb 2025 06:41:00 +0100 Subject: [PATCH 2/3] Updated the mistral url. --- src/api/providers/mistral.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/mistral.ts b/src/api/providers/mistral.ts index c4377f0003..408863ed6f 100644 --- a/src/api/providers/mistral.ts +++ b/src/api/providers/mistral.ts @@ -21,7 +21,7 @@ export class MistralHandler implements ApiHandler { constructor(options: ApiHandlerOptions) { this.options = options this.client = new Mistral({ - serverURL: "https://codestral.mistral.ai", + serverURL: "https://api.mistral.ai/v1", apiKey: this.options.mistralApiKey, }) } From fd676ef04740d5e500663c5b9b92675b10a81b79 Mon Sep 17 00:00:00 2001 From: Michael Overhorst Date: Wed, 5 Feb 2025 06:51:02 +0100 Subject: [PATCH 3/3] Removed /v1 from the url and tested several models. --- src/api/providers/mistral.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/providers/mistral.ts b/src/api/providers/mistral.ts index 408863ed6f..5be89b18f3 100644 --- a/src/api/providers/mistral.ts +++ b/src/api/providers/mistral.ts @@ -21,7 +21,7 @@ export class MistralHandler implements ApiHandler { constructor(options: ApiHandlerOptions) { this.options = options this.client = new Mistral({ - serverURL: "https://api.mistral.ai/v1", + serverURL: "https://api.mistral.ai", apiKey: this.options.mistralApiKey, }) }