From b948eaaaa6c56e50f62797e9960b27050f704f40 Mon Sep 17 00:00:00 2001 From: Daniel Salazar Date: Tue, 12 May 2026 12:12:24 -0700 Subject: [PATCH] chore: update mistralAi providers (#3090) --- .../providers/mistral/MistralAiProvider.ts | 6 +- .../ai-chat/providers/mistral/models.ts | 504 ++++++++---------- 2 files changed, 239 insertions(+), 271 deletions(-) diff --git a/src/backend/drivers/ai-chat/providers/mistral/MistralAiProvider.ts b/src/backend/drivers/ai-chat/providers/mistral/MistralAiProvider.ts index 1061854af..82961c46a 100644 --- a/src/backend/drivers/ai-chat/providers/mistral/MistralAiProvider.ts +++ b/src/backend/drivers/ai-chat/providers/mistral/MistralAiProvider.ts @@ -21,12 +21,12 @@ import { Mistral } from '@mistralai/mistralai'; import { ChatCompletionResponse } from '@mistralai/mistralai/models/components/chatcompletionresponse.js'; import { Context } from '../../../../core/context.js'; import type { MeteringService } from '../../../../services/metering/MeteringService.js'; -import * as OpenAIUtil from '../../utils/OpenAIUtil.js'; import type { + IChatCompleteResult, IChatProvider, ICompleteArguments, - IChatCompleteResult, } from '../../types.js'; +import * as OpenAIUtil from '../../utils/OpenAIUtil.js'; import { MISTRAL_MODELS } from './models.js'; export class MistralAIProvider implements IChatProvider { @@ -42,7 +42,7 @@ export class MistralAIProvider implements IChatProvider { } getDefaultModel() { - return 'mistral-small-2506'; + return 'mistral-small-2603'; } async models() { diff --git a/src/backend/drivers/ai-chat/providers/mistral/models.ts b/src/backend/drivers/ai-chat/providers/mistral/models.ts index 2d16cb091..ed7023d31 100644 --- a/src/backend/drivers/ai-chat/providers/mistral/models.ts +++ b/src/backend/drivers/ai-chat/providers/mistral/models.ts @@ -19,8 +19,37 @@ import type { IChatModel } from '../../types.js'; -// Hardcoded from https://models.dev/api.json +// Hardcoded from https://models.dev/api.json and https://docs.mistral.ai/models/overview export const MISTRAL_MODELS: IChatModel[] = [ + { + puterId: 'mistralai:mistralai/mistral-medium-3-5', + id: 'mistral-medium-3-5', + modalities: { input: ['text', 'image'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2026-04', + release_date: '2026-04-29', + name: 'Mistral Medium 3.5', + aliases: [ + 'mistral-medium-3', + 'mistral-medium-2604', + 'mistralai/mistral-medium-3-5', + 'mistralai/mistral-medium-2604', + ], + context: 262_144, + max_tokens: 262_144, + description: + 'State-of-the-art multimodal model optimized for agentic and coding tasks.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 150, + completion_tokens: 750, + }, + }, { puterId: 'mistralai:mistralai/mistral-medium-2508', id: 'mistral-medium-2508', @@ -29,106 +58,82 @@ export const MISTRAL_MODELS: IChatModel[] = [ tool_call: true, knowledge: '2025-05', release_date: '2025-08-12', - name: 'mistral-medium-2508', + name: 'Mistral Medium 3.1', aliases: [ - 'mistral-medium-latest', - 'mistral-medium', 'mistralai/mistral-medium-2508', + 'mistral-medium-2508', + 'mistral-medium-latest', + 'mistralai/mistral-medium-latest', ], - context: 131072, - max_tokens: 131072, - description: 'Update on Mistral Medium 3 with improved capabilities.', + context: 262_144, + max_tokens: 262_144, + description: 'Frontier-class multimodal model.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 40, completion_tokens: 200, }, }, { - puterId: 'mistralai:mistralai/open-mistral-7b', - id: 'open-mistral-7b', - modalities: { input: ['text'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2023-12', - release_date: '2023-09-27', - name: 'open-mistral-7b', - aliases: [ - 'mistral-tiny', - 'mistral-tiny-2312', - 'mistralai/open-mistral-7b', - ], - context: 32768, - max_tokens: 32768, - description: 'Our first dense model released September 2023.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 25, - completion_tokens: 25, - }, - }, - { - puterId: 'mistralai:mistralai/open-mistral-nemo', - id: 'open-mistral-nemo', - modalities: { input: ['text'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2024-07', - release_date: '2024-07-01', - name: 'open-mistral-nemo', - aliases: [ - 'open-mistral-nemo-2407', - 'mistral-tiny-2407', - 'mistral-tiny-latest', - 'mistralai/open-mistral-nemo', - ], - context: 131072, - max_tokens: 131072, - description: - 'Our best multilingual open source model released July 2024.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 15, - completion_tokens: 15, - }, - }, - { - puterId: 'mistralai:mistralai/pixtral-large-2411', - id: 'pixtral-large-2411', + puterId: 'mistralai:mistralai/mistral-large-2512', + id: 'mistral-large-2512', modalities: { input: ['text', 'image'], output: ['text'] }, open_weights: true, tool_call: true, - knowledge: '2024-11', - release_date: '2024-11-01', - name: 'pixtral-large-2411', + knowledge: '2025-12', + release_date: '2025-12-02', + name: 'Mistral Large 3', aliases: [ - 'pixtral-large-latest', - 'mistral-large-pixtral-2411', - 'mistralai/pixtral-large-2411', + 'mistral-large-latest', + 'mistral-large', + 'mistralai/mistral-large-latest', + 'mistralai/mistral-large-2512', ], - context: 131072, - max_tokens: 131072, - description: 'Official pixtral-large-2411 Mistral AI model', + context: 262_144, + max_tokens: 262_144, + description: + 'State-of-the-art, open-weight, general-purpose multimodal model.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, - prompt_tokens: 200, - completion_tokens: 600, + tokens: 1_000_000, + prompt_tokens: 50, + completion_tokens: 150, + }, + }, + { + puterId: 'mistralai:mistralai/mistral-small-2603', + id: 'mistral-small-2603', + modalities: { input: ['text', 'image'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2025-06', + release_date: '2026-03-16', + name: 'Mistral Small 4', + aliases: [ + 'mistral-small-latest', + 'mistral-small', + 'mistralai/mistral-small-latest', + 'mistralai/mistral-small-2603', + ], + context: 256_000, + max_tokens: 256_000, + description: + 'Hybrid open-weight model for instruct, reasoning, and coding tasks.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 15, + completion_tokens: 60, }, }, { @@ -137,116 +142,73 @@ export const MISTRAL_MODELS: IChatModel[] = [ modalities: { input: ['text'], output: ['text'] }, open_weights: true, tool_call: true, - knowledge: '2024-10', - release_date: '2024-05-29', - name: 'codestral-2508', + knowledge: '2025-08', + release_date: '2025-08-29', + name: 'Codestral', aliases: ['codestral-latest', 'mistralai/codestral-2508'], - context: 256000, - max_tokens: 256000, + context: 256_000, + max_tokens: 256_000, description: - 'Our cutting-edge language model for coding released August 2025.', + 'Cutting-edge language model for code completion, proficient in over 80 programming languages.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 30, completion_tokens: 90, }, }, { - puterId: 'mistralai:mistralai/devstral-small-2507', - id: 'devstral-small-2507', + puterId: 'mistralai:mistralai/devstral-2512', + id: 'devstral-2512', modalities: { input: ['text'], output: ['text'] }, open_weights: true, tool_call: true, - knowledge: '2025-05', - release_date: '2025-07-10', - name: 'devstral-small-2507', - aliases: ['devstral-small-latest', 'mistralai/devstral-small-2507'], - context: 131072, - max_tokens: 131072, - description: 'Our small open-source code-agentic model.', + knowledge: '2025-12', + release_date: '2025-12-09', + name: 'Devstral 2', + aliases: [ + 'devstral-latest', + 'mistralai/devstral-latest', + 'mistralai/devstral-2512', + 'devstral-medium-latest', + 'mistralai/devstral-medium-latest', + ], + context: 262_144, + max_tokens: 262_144, + description: + 'Frontier open-source code agents model for software engineering.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, - prompt_tokens: 10, - completion_tokens: 30, - cached_tokens: 0, - }, - }, - { - puterId: 'mistralai:mistralai/devstral-medium-2507', - id: 'devstral-medium-2507', - modalities: { input: ['text'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2025-05', - release_date: '2025-07-10', - name: 'devstral-medium-2507', - aliases: ['devstral-medium-latest', 'mistralai/devstral-medium-2507'], - context: 131072, - max_tokens: 131072, - description: 'Our medium code-agentic model.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 40, completion_tokens: 200, - cached_tokens: 0, - }, - }, - { - puterId: 'mistralai:mistralai/mistral-small-2506', - id: 'mistral-small-2506', - modalities: { input: ['text', 'image'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2025-03', - release_date: '2025-06-20', - name: 'mistral-small-2506', - aliases: ['mistral-small-latest', 'mistralai/mistral-small-2506'], - context: 131072, - max_tokens: 131072, - description: - 'Our latest enterprise-grade small model with the latest version released June 2025.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 10, - completion_tokens: 30, }, }, { puterId: 'mistralai:mistralai/magistral-medium-2509', id: 'magistral-medium-2509', modalities: { input: ['text'], output: ['text'] }, - open_weights: true, + open_weights: false, tool_call: true, knowledge: '2025-06', - release_date: '2025-03-17', - name: 'magistral-medium-2509', + release_date: '2025-09-01', + name: 'Magistral Medium 1.2', aliases: ['magistral-medium-latest', 'mistralai/magistral-medium-2509'], - context: 131072, - max_tokens: 131072, - description: - 'Our frontier-class reasoning model release candidate September 2025.', + context: 131_072, + max_tokens: 131_072, + description: 'Frontier-class multimodal reasoning model.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 200, completion_tokens: 500, }, @@ -258,143 +220,149 @@ export const MISTRAL_MODELS: IChatModel[] = [ open_weights: true, tool_call: true, knowledge: '2025-06', - release_date: '2025-03-17', - name: 'magistral-small-2509', + release_date: '2025-09-01', + name: 'Magistral Small 1.2', aliases: ['magistral-small-latest', 'mistralai/magistral-small-2509'], - context: 131072, - max_tokens: 131072, - description: 'Our efficient reasoning model released September 2025.', + context: 131_072, + max_tokens: 131_072, + description: 'Efficient open-weight reasoning model.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 50, completion_tokens: 150, }, }, - { - puterId: 'mistralai:mistralai/voxtral-mini-2507', - id: 'voxtral-mini-2507', - name: 'voxtral-mini-2507', - aliases: ['voxtral-mini-latest', 'mistralai/voxtral-mini-2507'], - context: 32768, - max_tokens: 32768, - description: 'A mini audio understanding model released in July 2025', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 4, - completion_tokens: 4, - }, - }, - { - puterId: 'mistralai:mistralai/voxtral-small-2507', - id: 'voxtral-small-2507', - name: 'voxtral-small-2507', - aliases: ['voxtral-small-latest', 'mistralai/voxtral-small-2507'], - context: 32768, - max_tokens: 32768, - description: 'A small audio understanding model released in July 2025', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 10, - completion_tokens: 30, - }, - }, - { - puterId: 'mistralai:mistralai/mistral-large-2512', - id: 'mistral-large-latest', - modalities: { input: ['text', 'image'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2024-11', - release_date: '2024-11-01', - name: 'mistral-large-2512', - aliases: ['mistral-large-2512', 'mistralai/mistral-large-2512'], - context: 262144, - max_tokens: 262144, - description: 'Official mistral-large-2512 Mistral AI model', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 50, - completion_tokens: 150, - }, - }, - { - puterId: 'mistralai:mistralai/ministral-3b-2512', - id: 'ministral-3b-2512', - modalities: { input: ['text'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2024-10', - release_date: '2024-10-01', - name: 'ministral-3b-2512', - aliases: ['ministral-3b-latest', 'mistralai/ministral-3b-2512'], - context: 131072, - max_tokens: 131072, - description: 'Ministral 3 (a.k.a. Tinystral) 3B Instruct.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 10, - completion_tokens: 10, - }, - }, - { - puterId: 'mistralai:mistralai/ministral-8b-2512', - id: 'ministral-8b-2512', - modalities: { input: ['text'], output: ['text'] }, - open_weights: true, - tool_call: true, - knowledge: '2024-10', - release_date: '2024-10-01', - name: 'ministral-8b-2512', - aliases: ['ministral-8b-latest', 'mistralai/ministral-8b-2512'], - context: 262144, - max_tokens: 262144, - description: 'Ministral 3 (a.k.a. Tinystral) 8B Instruct.', - provider: 'mistral', - costs_currency: 'usd-cents', - input_cost_key: 'prompt_tokens', - output_cost_key: 'completion_tokens', - costs: { - tokens: 1000000, - prompt_tokens: 15, - completion_tokens: 15, - }, - }, { puterId: 'mistralai:mistralai/ministral-14b-2512', id: 'ministral-14b-2512', - name: 'ministral-14b-2512', + modalities: { input: ['text', 'image'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2025-12', + release_date: '2025-12-16', + name: 'Ministral 3 14B', aliases: ['ministral-14b-latest', 'mistralai/ministral-14b-2512'], - context: 262144, - max_tokens: 262144, - description: 'Ministral 3 (a.k.a. Tinystral) 14B Instruct.', + context: 262_144, + max_tokens: 262_144, + description: + 'Best-in-class compact model with text and vision capabilities.', provider: 'mistral', costs_currency: 'usd-cents', input_cost_key: 'prompt_tokens', output_cost_key: 'completion_tokens', costs: { - tokens: 1000000, + tokens: 1_000_000, prompt_tokens: 20, completion_tokens: 20, }, }, + { + puterId: 'mistralai:mistralai/ministral-8b-2512', + id: 'ministral-8b-2512', + modalities: { input: ['text', 'image'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2025-12', + release_date: '2025-12-16', + name: 'Ministral 3 8B', + aliases: ['ministral-8b-latest', 'mistralai/ministral-8b-2512'], + context: 262_144, + max_tokens: 262_144, + description: + 'Efficient compact model with text and vision capabilities.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 10, + completion_tokens: 10, + }, + }, + { + puterId: 'mistralai:mistralai/ministral-3b-2512', + id: 'ministral-3b-2512', + modalities: { input: ['text', 'image'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2025-12', + release_date: '2025-12-16', + name: 'Ministral 3 3B', + aliases: ['ministral-3b-latest', 'mistralai/ministral-3b-2512'], + context: 131_072, + max_tokens: 131_072, + description: 'Tiny, efficient model with multimodal support.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 4, + completion_tokens: 4, + }, + }, + { + puterId: 'mistralai:mistralai/open-mistral-nemo-2407', + id: 'open-mistral-nemo-2407', + modalities: { input: ['text'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2024-07', + release_date: '2024-07-25', + name: 'Mistral Nemo 12B', + aliases: [ + 'open-mistral-nemo', + 'mistral-nemo', + 'mistral-nemo-latest', + 'mistralai/open-mistral-nemo', + 'mistralai/open-mistral-nemo-2407', + 'mistralai/mistral-nemo', + ], + context: 128_000, + max_tokens: 128_000, + description: 'Best multilingual open source model.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 15, + completion_tokens: 15, + }, + }, + { + puterId: 'mistralai:mistralai/voxtral-small-2507', + id: 'voxtral-small-2507', + modalities: { input: ['text', 'audio'], output: ['text'] }, + open_weights: true, + tool_call: true, + knowledge: '2025-07', + release_date: '2025-07-15', + name: 'Voxtral Small', + aliases: [ + 'voxtral-small-latest', + 'mistralai/voxtral-small-2507', + 'mistralai/voxtral-small-latest', + 'voxtral-small-latest', + ], + context: 32_768, + max_tokens: 32_768, + description: 'Audio-input model for instruct tasks.', + provider: 'mistral', + costs_currency: 'usd-cents', + input_cost_key: 'prompt_tokens', + output_cost_key: 'completion_tokens', + costs: { + tokens: 1_000_000, + prompt_tokens: 10, + completion_tokens: 30, + }, + }, ];