diff --git a/.changeset/voxtral-small-page-gone.md b/.changeset/voxtral-small-page-gone.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/voxtral-small-page-gone.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/docs/source-silent/mistral.md b/docs/source-silent/mistral.md index bd308230..3d391f14 100644 --- a/docs/source-silent/mistral.md +++ b/docs/source-silent/mistral.md @@ -24,8 +24,8 @@ - mistral/mistral-vibe-cli-fast: maxOutput — Own model page (its `.md` twin too) states context length, modalities and features but no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/models/mistral-small-4-0-26-03, checked 2026-10-22 - mistral/mistral-vibe-cli-latest: maxOutput — Own model page (its `.md` twin too) states context length, modalities and features but no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/models/mistral-medium-3-5-26-04, checked 2026-10-22 - mistral/mistral-vibe-cli-with-tools: maxOutput — Own model page (its `.md` twin too) states context length, modalities and features but no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/models/mistral-medium-3-5-26-04, checked 2026-10-22 -- mistral/voxtral-small-2507: maxOutput — Own model page (its `.md` twin too) states context length, modalities and features but no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/models/voxtral-small-25-07, checked 2026-10-22 -- mistral/voxtral-small-latest: maxOutput — Own model page (its `.md` twin too) states context length, modalities and features but no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/models/voxtral-small-25-07, checked 2026-10-22 +- mistral/voxtral-small-2507: maxOutput — The model page 404s after the Voxtral 3 launch. The migration guide names a replacement and no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/llms/studio/audio/migrate-from-voxtral-2/llms.txt, checked 2026-11-27 +- mistral/voxtral-small-latest: maxOutput — The model page 404s after the Voxtral 3 launch. The migration guide names `voxtral-small-2507` (this id's listing alias) and no max output, and `GET /v1/models` gives `max_context_length` only, https://docs.mistral.ai/llms/studio/audio/migrate-from-voxtral-2/llms.txt, checked 2026-11-27 - `mistral/glm-5-2`: reasoning — Own native listing declares reasoning capability and exact alias identity, and its linked model page publishes no configurable control contract; own reasoning guide scopes published controls to other named models, so those controls are not transferred, https://docs.mistral.ai/models/zai-glm-5-2, checked 2026-10-09 diff --git a/src/server/providers/adapters/mistral.test.ts b/src/server/providers/adapters/mistral.test.ts index 08e581f4..ef1b0ed9 100644 --- a/src/server/providers/adapters/mistral.test.ts +++ b/src/server/providers/adapters/mistral.test.ts @@ -10,7 +10,10 @@ import { tip, } from '../fixtures/mistral-model-page.ts' import { mistralAliasFacts, provider } from './mistral.ts' -import { MISTRAL_DEPRECATIONS_URL } from '../deprecations.ts' +import { + MISTRAL_DEPRECATIONS_URL, + MISTRAL_VOXTRAL_MIGRATION_URL, +} from '../deprecations.ts' import { MISTRAL_WEBSEARCH_URL, mistralSummaryMaker, @@ -23,6 +26,10 @@ const MODELS_PAGE = readFileSync( new URL('../fixtures/mistral-models.md.txt', import.meta.url), 'utf8', ) +const VOXTRAL_MIGRATION = readFileSync( + new URL('../fixtures/mistral-voxtral-migration.md.txt', import.meta.url), + 'utf8', +) // https://docs.mistral.ai/models/mistral-small-4-0-26-03.md, 2026-11-21. const SMALL_4_MARKDOWN = readFileSync( new URL('../fixtures/mistral-small-4-0-26-03.md.txt', import.meta.url), @@ -79,6 +86,9 @@ describe('mistral listModels', () => { if (href === MISTRAL_DEPRECATIONS_URL) { return Promise.resolve(new Response(MODELS_PAGE)) } + if (href === MISTRAL_VOXTRAL_MIGRATION_URL) { + return Promise.resolve(new Response(VOXTRAL_MIGRATION)) + } // Docs stay off the network. A live pricing table plus one page // per slug blows the 5s test limit once missing ids pull markdown. if (!href.startsWith('https://api.mistral.ai/')) { @@ -568,6 +578,110 @@ describe('parseMistralMarkdownReleaseDate', () => { }) }) +describe('voxtral small after its page 404s (#787)', () => { + it('keeps both listing ids unread and records the guide replacement', async () => { + const overview = `| Model | API name | Status | Context | Summary | +| --- | --- | --- | --- | --- | +| [Voxtral Small Transcribe 3](/models/voxtral-small-transcribe-3-0) | \`voxtral-small-transcribe-3-0\` | Preview | 32k | text | +| [Small](/models/mistral-small-4-0-26-03) | \`mistral-small-2603\` | GA | 256k | text | + +## Deprecated and retired models + +| Model | API name | Status | Context | Summary | Deprecation | Retirement | Replacement | +| --- | --- | --- | --- | --- | --- | --- | --- | +| [Pixtral](/models/pixtral-large) | \`pixtral-12b-2409\` | Deprecated | 128k | x | 2025-12-02 | 2025-12-31 | [Small](/models/mistral-small-4-0-26-03) | +` + const pages: Record = { + 'https://api.mistral.ai/v1/models': JSON.stringify({ + data: [ + { + id: 'voxtral-small-2507', + aliases: ['voxtral-small-latest'], + capabilities: { audio_transcription: true }, + }, + { + id: 'voxtral-small-latest', + aliases: ['voxtral-small-2507'], + capabilities: { audio_transcription: true }, + }, + { + id: 'voxtral-small-transcribe-3-0', + capabilities: { audio_transcription: true }, + }, + ], + }), + 'https://docs.mistral.ai/inference/pricing': `

Flagship models

+

Prices /M Tokens

+ + +
Small$0.15—$0.6
+

Audio models

+

Prices as marked

+ + +
Voxtral 3$0.004 /Min——
`, + 'https://docs.mistral.ai/resources/changelogs': '', + [MISTRAL_DEPRECATIONS_URL]: overview, + [MISTRAL_VOXTRAL_MIGRATION_URL]: VOXTRAL_MIGRATION, + [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE, + 'https://docs.mistral.ai/models/voxtral-small-transcribe-3-0': + mistralModelPage( + ['voxtral-small-transcribe-3-0'], + [[tip('Audio input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/voxtral-small-transcribe-3-0.md': + '- Release date: 2026-11-18\n', + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03': + mistralModelPage( + ['mistral-small-2603'], + [[tip('Text input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03.md': + '- Release date: 2026-03-16\n', + } + const original = globalThis.fetch + globalThis.fetch = ((url: string) => { + const body = pages[String(url)] + return Promise.resolve( + body === undefined + ? new Response('missing', { status: 404 }) + : new Response(body), + ) + }) as typeof fetch + try { + const { models, deprecations } = await provider.listModels({ + MISTRAL_API_KEY: 'k', + }) + const byId = new Map(models.map((model) => [model.rawId, model])) + const successor = byId.get('voxtral-small-transcribe-3-0') + expect(successor?.pricing).toBeTruthy() + expect( + price(successor?.pricing as RateCard, {}, { audio_minutes: 1 }), + ).toBeCloseTo(0.004, 6) + for (const id of ['voxtral-small-2507', 'voxtral-small-latest']) { + expect(byId.get(id)?.pricing).toBeUndefined() + expect(byId.get(id)?.absent?.pricing).toBe('unavailable') + } + expect( + deprecations?.find((entry) => entry.rawId === 'voxtral-small-2507'), + ).toEqual({ + rawId: 'voxtral-small-2507', + deprecatedAt: null, + retiresAt: null, + replacedBy: ['voxtral-small-transcribe-latest'], + sourceUrl: MISTRAL_VOXTRAL_MIGRATION_URL, + }) + expect( + deprecations?.some( + (entry) => entry.rawId === 'voxtral-small-transcribe-3-0', + ), + ).toBe(false) + } finally { + globalThis.fetch = original + } + }) +}) + describe('mistral listModels docs failures', () => { it('keeps stored facts and reports the pages when the docs 404', async () => { const original = globalThis.fetch diff --git a/src/server/providers/adapters/mistral.ts b/src/server/providers/adapters/mistral.ts index 31290ab2..b1617bfa 100644 --- a/src/server/providers/adapters/mistral.ts +++ b/src/server/providers/adapters/mistral.ts @@ -6,8 +6,11 @@ import type { Activity } from '#/db/schema.ts' import { listOpenAiCompatibleModels } from '../openai-compat.ts' import { MISTRAL_DEPRECATIONS_URL, + MISTRAL_VOXTRAL_MIGRATION_URL, loadDeprecations, + mergeMistralDeprecations, parseMistralDeprecations, + parseMistralVoxtralMigration, } from '../deprecations.ts' import { docsReport, docsRun, tryDocs, unavailable } from '../model-facts.ts' import { @@ -97,6 +100,41 @@ function clearUnpriced( } } +/** + * A mutual alias of an id whose price could not be read keeps the stored + * card too. A member the source priced, or one it cleared, stays as it is. + */ +function shareUnreadPrice( + models: Array, + aliases: ReadonlyMap>, +): void { + const byId = new Map(models.map((model) => [model.rawId, model])) + for (const [id, names] of aliases) { + const clique = [id, ...names].filter( + (other) => + byId.has(other) && (other === id || aliases.get(other)?.includes(id)), + ) + if ( + !clique.some( + (other) => byId.get(other)?.absent?.pricing === 'unavailable', + ) + ) { + continue + } + if (clique.some((other) => byId.get(other)?.pricing != null)) continue + if ( + clique.some((other) => byId.get(other)?.absent?.pricing === 'cleared') + ) { + continue + } + for (const other of clique) { + const model = byId.get(other) + if (!model || model.pricing != null) continue + model.absent = { ...model.absent, pricing: 'unavailable' } + } + } +} + /** * Alias links a listing row states (issue #709). Every member of an alias * group lists the others in `aliases`: membership is stated. Which id the @@ -201,21 +239,38 @@ export const provider: ProviderConfig = { if (listed.models.length === 0) return listed const chat = listed.models.some((model) => model.activity === 'chat') const docs = docsRun() - const deprecations = await loadDeprecations( - docs, - kv, - MISTRAL_DEPRECATIONS_URL, - parseMistralDeprecations, - ) + // Either source failing keeps the stored deprecations. A merged list + // that omitted one of them would wipe the rows that source names. + const [catalogDeprecations, migration] = await Promise.all([ + loadDeprecations( + docs, + kv, + MISTRAL_DEPRECATIONS_URL, + parseMistralDeprecations, + ), + tryDocs(docs, MISTRAL_VOXTRAL_MIGRATION_URL, (cached) => + cached(kv, MISTRAL_VOXTRAL_MIGRATION_URL, async () => + parseMistralVoxtralMigration( + await fetchText(MISTRAL_VOXTRAL_MIGRATION_URL), + ), + ), + ), + ]) + const deprecations = + catalogDeprecations && migration + ? mergeMistralDeprecations(catalogDeprecations, migration) + : null // The pricing load reads the pricing table, changelog, models index, // model pages and web search guide; a failing docs page keeps the - // stored facts instead of failing the poll. + // stored facts instead of failing the poll. Ids the migration guide + // names are probed at their old slugs: a 404 keeps the stored card. const [pricing, reasoning, wire, makers] = await Promise.all([ tryDocs(docs, MISTRAL_PRICING_URL, (cached) => mistralModelPricing( kv, listed.models.map((model) => model.rawId), cached, + migration?.map((move) => move.from) ?? [], ), ), tryDocs(docs, MISTRAL_REASONING_URL, (cached) => @@ -276,7 +331,10 @@ export const provider: ProviderConfig = { } } } - if (pricing) clearUnpriced(models, pricing.seen, aliases) + if (pricing) { + clearUnpriced(models, pricing.seen, aliases) + shareUnreadPrice(models, aliases) + } return { ...listed, models, diff --git a/src/server/providers/deprecations.test.ts b/src/server/providers/deprecations.test.ts index 48599573..da0c9f7a 100644 --- a/src/server/providers/deprecations.test.ts +++ b/src/server/providers/deprecations.test.ts @@ -5,8 +5,11 @@ import { describe, expect, it } from 'vitest' import { GROQ_DEPRECATIONS_URL, MISTRAL_DEPRECATIONS_URL, + MISTRAL_VOXTRAL_MIGRATION_URL, + mergeMistralDeprecations, parseGroqDeprecations, parseMistralDeprecations, + parseMistralVoxtralMigration, } from './deprecations.ts' // Fetched 2026-10-22: https://console.groq.com/docs/deprecations.md and @@ -19,6 +22,10 @@ const MISTRAL = readFileSync( new URL('./fixtures/mistral-models.md.txt', import.meta.url), 'utf8', ) +const VOXTRAL_MIGRATION = readFileSync( + new URL('./fixtures/mistral-voxtral-migration.md.txt', import.meta.url), + 'utf8', +) const day = (iso: string) => Date.parse(`${iso}T00:00:00Z`) / 1000 @@ -309,3 +316,68 @@ describe('mistral deprecations catalog', () => { ).toThrow(/listed twice/) }) }) + +describe('voxtral migration guide', () => { + it('maps each Voxtral 2 id and states no dates', () => { + expect(parseMistralVoxtralMigration(VOXTRAL_MIGRATION)).toEqual([ + { from: 'voxtral-mini-2602', to: 'voxtral-mini-transcribe-3-0' }, + { + from: 'voxtral-mini-transcribe-realtime-2602', + to: 'voxtral-mini-transcribe-realtime-3-0', + }, + { from: 'voxtral-small-2507', to: 'voxtral-small-transcribe-latest' }, + { from: 'voxtral-mini-tts-2603', to: 'voxtral-mini-tts-3-0' }, + ]) + }) + + it('throws when the timeline gains text or the table moves', () => { + expect(() => + parseMistralVoxtralMigration( + VOXTRAL_MIGRATION.replace( + '### Deprecation timeline\n\n### Migration checklist', + '### Deprecation timeline\n\nRetired 2027-04-30.\n\n### Migration checklist', + ), + ), + ).toThrow(/deprecation timeline is unread/) + expect(() => + parseMistralVoxtralMigration('# Migrate\n\nNo table.\n'), + ).toThrow(/no Model mapping section/) + expect(() => + parseMistralVoxtralMigration( + VOXTRAL_MIGRATION.replace('Model ID', 'Successor'), + ), + ).toThrow(/table header/) + }) + + it('keeps a catalog row and adds an id the overview dropped', () => { + const catalog = parseMistralDeprecations(MISTRAL) + const merged = mergeMistralDeprecations( + catalog, + parseMistralVoxtralMigration(VOXTRAL_MIGRATION), + ) + expect( + merged.find((row) => row.rawId === 'pixtral-12b-2409')?.replacedBy, + ).toEqual(['ministral-14b-2512']) + expect(merged.find((row) => row.rawId === 'voxtral-small-2507')).toEqual({ + rawId: 'voxtral-small-2507', + deprecatedAt: null, + retiresAt: null, + replacedBy: ['voxtral-small-transcribe-latest'], + sourceUrl: MISTRAL_VOXTRAL_MIGRATION_URL, + }) + expect(() => + mergeMistralDeprecations( + [ + { + rawId: 'voxtral-small-2507', + deprecatedAt: null, + retiresAt: null, + replacedBy: ['voxtral-small-transcribe-3-0'], + sourceUrl: MISTRAL_DEPRECATIONS_URL, + }, + ], + [{ from: 'voxtral-small-2507', to: 'voxtral-small-transcribe-latest' }], + ), + ).toThrow(/disagrees with the catalog/) + }) +}) diff --git a/src/server/providers/deprecations.ts b/src/server/providers/deprecations.ts index 1b99e285..7f9da594 100644 --- a/src/server/providers/deprecations.ts +++ b/src/server/providers/deprecations.ts @@ -23,6 +23,14 @@ export const GROQ_DEPRECATIONS_URL = */ export const MISTRAL_DEPRECATIONS_URL = 'https://docs.mistral.ai/models' +/** + * Voxtral 2 → Voxtral 3 mapping. The models overview dropped Voxtral + * Small 25.07 when its page 404'd (#787). This guide still names the old + * id. The Deprecation timeline section is empty, so it states no dates. + */ +export const MISTRAL_VOXTRAL_MIGRATION_URL = + 'https://docs.mistral.ai/llms/studio/audio/migrate-from-voxtral-2/llms.txt' + const MONTHS = [ 'january', 'february', @@ -308,6 +316,107 @@ export function parseMistralDeprecations( return [...out.values()] } +const MIGRATION_HEADER = + 'Voxtral 2 model | Voxtral 3 model | Model ID | Aliases' +const ONE_ID = /^`([^`]+)`$/ + +/** One row of the Voxtral migration guide's Model mapping table. */ +export interface MistralVoxtralMove { + from: string + /** The Model ID cell, as written. Not the successor's other aliases. */ + to: string +} + +/** + * The guide's Model mapping table. The Deprecation timeline section + * states no dates today; any text there is unread and throws, so a + * published date is not dropped. A missing table or a changed header + * throws. Other sections are ignored. + */ +export function parseMistralVoxtralMigration( + markdown: string, +): Array { + const source = 'mistral voxtral migration' + const mapping = markdown.split(/^### Model mapping$/m)[1] + if (mapping === undefined) { + throw new Error(`${source}: no Model mapping section`) + } + const table = mapping.split(/^### /m)[0] ?? '' + const header = table + .split('\n') + .find((line) => line.startsWith('|')) + ?.split('|') + .map((cell) => cell.trim()) + .filter(Boolean) + .join(' | ') + if (header !== MIGRATION_HEADER) { + throw new Error(`${source}: table header ${JSON.stringify(header)}`) + } + const timeline = markdown.split(/^### Deprecation timeline$/m)[1] + if (timeline === undefined) { + throw new Error(`${source}: no Deprecation timeline section`) + } + const timelineBody = (timeline.split(/^### /m)[0] ?? '').trim() + if (timelineBody !== '') { + throw new Error(`${source}: deprecation timeline is unread`) + } + const out: Array = [] + for (const row of tableRows(table)) { + if (row.length !== 4) { + throw new Error(`${source}: row has ${String(row.length)} cells`) + } + const from = ONE_ID.exec(row[0] ?? '')?.[1] + const to = ONE_ID.exec(row[2] ?? '')?.[1] + if (!from || !to) { + throw new Error( + `${source}: row ${JSON.stringify(row[0])} / ${JSON.stringify(row[2])}`, + ) + } + requireId(from, source) + requireReplacement(to, source) + const prior = out.find((move) => move.from === from) + if (prior && prior.to !== to) { + throw new Error(`${source}: ${from} is listed twice`) + } + if (!prior) out.push({ from, to }) + } + if (out.length === 0) throw new Error(`${source}: parsed 0 model rows`) + return out +} + +/** + * Catalog entries win when they name the same id: they carry the dates + * the guide does not. A guide row the catalog does not list is added + * with null dates and the guide's Model ID. A different replacement + * throws. The caller skips the merge when either source failed, so a + * short list cannot wipe stored entries. + */ +export function mergeMistralDeprecations( + catalog: Array, + moves: Array, +): Array { + const out = new Map(catalog.map((entry) => [entry.rawId, entry])) + for (const move of moves) { + const prior = out.get(move.from) + if (prior) { + if (prior.replacedBy?.[0] !== move.to) { + throw new Error( + `mistral voxtral migration: ${move.from} replacement ${move.to} disagrees with the catalog ${JSON.stringify(prior.replacedBy)}`, + ) + } + continue + } + out.set(move.from, { + rawId: move.from, + deprecatedAt: null, + retiresAt: null, + replacedBy: [move.to], + sourceUrl: MISTRAL_VOXTRAL_MIGRATION_URL, + }) + } + return [...out.values()] +} + /** Load one deprecations page through `tryDocs`; null when it failed. */ export function loadDeprecations( run: DocsRun, diff --git a/src/server/providers/fixtures/mistral-voxtral-migration.md.txt b/src/server/providers/fixtures/mistral-voxtral-migration.md.txt new file mode 100644 index 00000000..78f479cf --- /dev/null +++ b/src/server/providers/fixtures/mistral-voxtral-migration.md.txt @@ -0,0 +1,67 @@ + + +# Migrate from Voxtral 2 + +Source: /studio/audio/migrate-from-voxtral-2 + +> Move from the Voxtral 2 audio models to Voxtral 3: model names, breaking changes, and a migration checklist. + +This page is for anyone who calls a Voxtral 2 audio model. It maps each model to its Voxtral 3 replacement, then lists what changes in speech to text and text to speech, and what to do about each change. + +### Model mapping + +Replace each Voxtral 2 model ID with the ID of its Voxtral 3 replacement. Each Voxtral 3 model also answers to the aliases in the last column. + +| Voxtral 2 model | Voxtral 3 model | Model ID | Aliases | +| --- | --- | --- | --- | +| `voxtral-mini-2602` | Voxtral Mini Transcribe 3 | `voxtral-mini-transcribe-3-0` | `voxtral-mini-transcribe-3`, `voxtral-mini-transcribe-latest` | +| `voxtral-mini-transcribe-realtime-2602` | Voxtral Mini Transcribe Realtime 3 | `voxtral-mini-transcribe-realtime-3-0` | `voxtral-mini-transcribe-realtime-3`, | +| `voxtral-small-2507` | Voxtral Small Transcribe 3 | `voxtral-small-transcribe-latest` | `voxtral-small-transcribe-3`, `voxtral-small-transcribe-latest` | +| `voxtral-mini-tts-2603` | Voxtral TTS 3 | `voxtral-mini-tts-3-0` | `voxtral-mini-tts-3`, `voxtral-mini-tts-latest` will point to Voxtral 3 within a month of GA. | + +### Speech to text changes + +The following table lists the changes that can affect a transcription integration, with breaking changes first. + +| Change | Breaks existing code? | What to do | +| --- | --- | --- | +| Word timestamps are gone. `timestamp_granularities` accepts `segment` only, and `word` returns a `400` error. | Yes, if you request word timestamps. | Request segment timestamps. See [Timestamps](/studio/audio/speech-to-text/transcribe-files#timestamps). | +| A realtime session locks its settings when the first audio chunk arrives. A later `session.update` gets an `error` event. | | Send every setting in the first `session.update`, before any audio. See [Realtime transcription](/studio/audio/speech-to-text/transcribe-in-realtime#configure-the-session). | +| | Yes, if your display assumes that segments never overlap. | Keep both segments when they overlap. See [Overlapping segments](/studio/audio/speech-to-text/diarize-speakers#overlapping-segments). | +| `context_bias` entries can be phrases with spaces, such as a full product name, and free-form text works offline. | No. | See [Context bias](/studio/audio/speech-to-text/bias-context-and-vocabulary). | +| `context_bias` has no fixed number of entries. | No. | Keep the list short: the entries share the context window with the audio, and a request over the limit returns a `400` error. See [Limits and errors](/studio/audio/speech-to-text/bias-context-and-vocabulary#limits-and-errors). | +| Transcription covers more languages. | No. | Omit `language` to detect the language automatically, or set it when you know it. See [Languages](/studio/audio/specs-and-limits/languages). | +| New: realtime diarization, speaker references, and turn detection in realtime sessions. | No. | Opt in when you need them. See [Diarize speakers](/studio/audio/speech-to-text/diarize-speakers) and [Turn detection](/studio/audio/speech-to-text/turn-detection). | + +### Text to speech changes + +The following table lists the changes that can affect a speech generation integration. + +| Change | Breaks existing code? | What to do | +| --- | --- | --- | +| Emotion moves from the voice to inline tags. With Voxtral 2, each preset speaker has one variant per emotion, such as `gb_jane_sad`. Voxtral 3 adds `[emotion=...]` tags in `input` for finer control. | No. The Voxtral 2 presets are still accepted. | To vary the emotion of one voice, use [emotion and pace tags](/studio/audio/text-to-speech/emotion-tags). | +| Voice cloning for a single request with `ref_audio`. | No. `ref_audio` is still accepted. | To reuse a cloned voice, save it once and pass its ID as `voice_id`. See [Voice cloning](/studio/audio/text-to-speech/voice-cloning). | +| New: Voxtral 3 voices, pace tags, custom pronunciation, ~~style instructions~~ (not available at launch), and A number >= 1.0 that controls how expressive the speech is. Higher values trade voice similarity for stronger delivery. The default value is set by the service.. | No. | Opt in when you need them. See [Voices](/studio/audio/text-to-speech/voices), [Custom pronunciation](/studio/audio/text-to-speech/custom-pronunciation), [Style instructions](/studio/audio/text-to-speech/style-instructions), and [Expressiveness](/studio/audio/text-to-speech/generate-speech#expressiveness). | + +Voxtral TTS 3 also changes how numbers, dates, prices, and email addresses are read, with no change to your request. The following inputs compare an earlier model with Voxtral TTS 3: + +| Input | Earlier model | Voxtral TTS 3 | +| --- | --- | --- | +| Thank you for calling Mistral! I understand you're having difficulty logging into AI Studio. Can I confirm your email address? I have here elena.vance82@yahoo.com, is that correct? | | | +| Gosh that was quick, I've found a flight for your upcoming travel. How about the Emirates flight at 21:00pm on 10/10 returning 10/25 at 22:00pm for £1881? Say the word, and I'll book a window seat now. | | | + +### Deprecation timeline + +### Migration checklist + +Follow these steps to move an integration to Voxtral 3: + +1. Replace each model ID with its Voxtral 3 ID. See [Model mapping](#model-mapping). +2. If you request word timestamps, switch to segment timestamps. +3. In realtime sessions, send every setting before the first audio chunk. +4. If you diarize, check that your display handles overlapping segments. +5. Review your `context_bias` entries: write multi-word terms with spaces. +6. Generate a few samples with your voices, and move emotion variants to emotion tags if you want one voice in several moods. See [Text to speech changes](#text-to-speech-changes). +7. Measure latency again from your application. See [Latency](/studio/audio/concepts/latency). + +### Going further diff --git a/src/server/providers/mistral-pricing.test.ts b/src/server/providers/mistral-pricing.test.ts index 190e13f9..4790d9b4 100644 --- a/src/server/providers/mistral-pricing.test.ts +++ b/src/server/providers/mistral-pricing.test.ts @@ -867,6 +867,136 @@ describe('mistral model page price and max output', () => { }) }) +describe('voxtral small page gone (#787)', () => { + const overview = `| [Small](/models/mistral-small-4-0-26-03) | \`mistral-small-2603\` | GA | 256k | text | +| [Voxtral Small Transcribe 3](/models/voxtral-small-transcribe-3-0) | \`voxtral-small-transcribe-3-0\` | Preview | 32k | text | + +## Deprecated and retired models + +| Model | API name | Status | Context | Summary | Deprecation | Retirement | Replacement | +| --- | --- | --- | --- | --- | --- | --- | --- | +| [Pixtral](/models/pixtral-large) | \`pixtral-12b-2409\` | Deprecated | 128k | x | 2025-12-02 | 2025-12-31 | [Small](/models/mistral-small-4-0-26-03) | +` + + it('keeps the id unread when every candidate page 404s and does not take the successor price', async () => { + const original = globalThis.fetch + const docs: Record = { + 'https://docs.mistral.ai/inference/pricing': `

Flagship models

+

Prices /M Tokens

+ + +
Small$0.15—$0.6
+

Audio models

+

Prices as marked

+ + +
Voxtral 3$0.004 /Min——
`, + 'https://docs.mistral.ai/resources/changelogs': '', + 'https://docs.mistral.ai/models': overview, + 'https://docs.mistral.ai/models/voxtral-small-transcribe-3-0': + mistralModelPage( + ['voxtral-small-transcribe-3-0', 'voxtral-small-transcribe-latest'], + [[tip('Audio input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/voxtral-small-transcribe-3-0.md': + '- Release date: 2026-11-18\n', + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03': + mistralModelPage( + ['mistral-small-2603'], + [[tip('Text input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03.md': + '- Release date: 2026-03-16\n', + [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE, + } + globalThis.fetch = ((url: string) => { + const body = docs[String(url)] + return Promise.resolve( + body === undefined + ? new Response('missing', { status: 404 }) + : new Response(body), + ) + }) as typeof fetch + try { + const lookup = await mistralModelPricing( + undefined, + ['voxtral-small-2507', 'voxtral-small-transcribe-3-0'], + undefined, + ['voxtral-small-2507'], + ) + const successor = lookup('voxtral-small-transcribe-3-0') + expect(successor.pricing).toBeTruthy() + expect( + price(successor.pricing as RateCard, {}, { audio_minutes: 1 }), + ).toBeCloseTo(0.004, 6) + const old = lookup('voxtral-small-2507') + expect(old.pricing).toBeUndefined() + expect(old.absent).toEqual({ pricing: 'unavailable' }) + expect(lookup.seen.has('voxtral-small-2507')).toBe(false) + expect(old.pricing).not.toEqual(successor.pricing) + } finally { + globalThis.fetch = original + } + }) + + it('reads a candidate page that is still published', async () => { + const original = globalThis.fetch + const docs: Record = { + 'https://docs.mistral.ai/inference/pricing': `

Flagship models

+

Prices /M Tokens

+ + +
Small$0.15—$0.6
`, + 'https://docs.mistral.ai/resources/changelogs': '', + 'https://docs.mistral.ai/models': overview, + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03': + mistralModelPage( + ['mistral-small-2603'], + [[tip('Text input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/mistral-small-4-0-26-03.md': + '- Release date: 2026-03-16\n', + 'https://docs.mistral.ai/models/voxtral-small-25-07': mistralModelPage( + ['voxtral-small-2507', 'voxtral-small-latest'], + [[tip('Audio input'), tip('Text output')]], + ), + 'https://docs.mistral.ai/models/voxtral-small-25-07.md': + '- Release date: 2025-07-16\n- Pricing: Input $0.001 /Min\n', + [MISTRAL_WEBSEARCH_URL]: MISTRAL_WEBSEARCH_GUIDE, + } + globalThis.fetch = ((url: string) => { + const body = docs[String(url)] + return Promise.resolve( + body === undefined + ? new Response('missing', { status: 404 }) + : new Response(body), + ) + }) as typeof fetch + try { + const lookup = await mistralModelPricing( + undefined, + ['voxtral-small-2507'], + undefined, + ['voxtral-small-2507'], + ) + expect( + price( + lookup('voxtral-small-2507').pricing as RateCard, + {}, + { + audio_minutes: 1, + }, + ), + ).toBeCloseTo(0.001, 6) + expect(lookup('voxtral-small-2507').absent?.pricing).toBeUndefined() + expect(lookup.seen.has('voxtral-small-2507')).toBe(true) + expect(lookup.seen.has('voxtral-small-latest')).toBe(true) + } finally { + globalThis.fetch = original + } + }) +}) + describe('mistral alias facts', () => { it('copies one agreed fact onto mutual aliases and skips a conflict', () => { const source = { diff --git a/src/server/providers/mistral-pricing.ts b/src/server/providers/mistral-pricing.ts index 37e462f6..57d50fce 100644 --- a/src/server/providers/mistral-pricing.ts +++ b/src/server/providers/mistral-pricing.ts @@ -28,6 +28,9 @@ * models overview pairs each API id with the page slug, including * deprecated rows the index-slug rules miss * (`mistral-medium-3-5` → `mistral-medium-3-5-26-04`). + * An id the Voxtral migration guide names, whose candidate pages all + * 404, keeps its stored card (`unavailable`). The successor's price is + * not copied onto it (#787). * A listing alias the page does not name takes that page's card when * the listing `name` is an id the page does name. A mutual alias with * its own different card keeps that card (`magistral-medium-latest`). @@ -1432,6 +1435,16 @@ export function parseMistralModelIndex(html: string): Array { return [...slugs] } +/** + * Slug spellings a listed id might have had: itself, a trailing `-MMDD` + * unfolded to `-MM-DD`, and the id with a `labs-` prefix removed. + */ +function mistralPageCandidates(id: string): Array { + const unfolded = id.replace(/-(\d{2})(\d{2})$/, '-$1-$2') + const stripped = id.startsWith('labs-') ? id.slice('labs-'.length) : id + return [...new Set([id, unfolded, stripped])] +} + /** * The one index slug a listed id is. Null when none or more than one of * the exact slug, the unfolded date, and the `labs-`-stripped id match. @@ -1440,11 +1453,7 @@ export function mistralIndexSlugFor( id: string, slugs: ReadonlySet, ): string | null { - const unfolded = id.replace(/-(\d{2})(\d{2})$/, '-$1-$2') - const stripped = id.startsWith('labs-') ? id.slice('labs-'.length) : id - const hits = [...new Set([id, unfolded, stripped])].filter((name) => - slugs.has(name), - ) + const hits = mistralPageCandidates(id).filter((name) => slugs.has(name)) return hits.length === 1 ? (hits[0] ?? null) : null } @@ -1540,11 +1549,20 @@ export function mistralConversationTools( return features?.includes('agents-conversations') ? [...webSearch] : [] } -/** Card lookup by API model id. */ +/** + * Card lookup by API model id. + * + * `retiredIds` are ids a migration guide still names after the overview + * dropped them. Each candidate page is fetched. A 404 is that page gone. + * When every candidate 404s, the id is not in `seen`: the source did not + * state that the price is gone, so the lookup marks it `unavailable`. + * Any other status still throws. + */ export async function mistralModelPricing( kv?: KVNamespace, listedIds: ReadonlyArray = [], cached: typeof cachedDocs = cachedDocs, + retiredIds: ReadonlyArray = [], ): Promise { const table = await cached(kv, MISTRAL_PRICING_URL, async () => { const [html, changelog] = await Promise.all([ @@ -1689,6 +1707,39 @@ export async function mistralModelPricing( } const extraPages = await mapConcurrent(extraSlugs, 6, loadPage) const pages = [...tablePages, ...extraPages] + const gone = new Set() + const knownSlugs = new Set([ + ...pages.map((page) => page.slug), + ...bySlug.keys(), + ]) + const named = new Set(pages.flatMap((page) => page.ids)) + const probes = [ + ...new Set( + retiredIds + .filter((id) => !named.has(id)) + .flatMap((id) => mistralPageCandidates(id)) + .filter((slug) => !knownSlugs.has(slug)), + ), + ] + const probed = await mapConcurrent(probes, 6, async (slug) => { + try { + return await loadPage(slug) + } catch (error) { + if (!isMissingDocsPage(error)) throw error + gone.add(slug) + return null + } + }) + for (const page of probed) { + if (page) pages.push(page) + } + const pageGone = new Set( + retiredIds.filter((id) => { + if (pages.some((page) => page.ids.includes(id))) return false + const candidates = mistralPageCandidates(id) + return candidates.length > 0 && candidates.every((slug) => gone.has(slug)) + }), + ) const byId = indexMistralApiIds(bySlug, pages) for (const [from, to] of Object.entries(table.samePrice)) { const rates = byId.get(to) @@ -1852,7 +1903,10 @@ export async function mistralModelPricing( ...maxFacts, ...releaseFacts, } - const pricingUnread = !pricing && priceUnread.has(rawId) && !seen.has(rawId) + const pricingUnread = + !pricing && + !seen.has(rawId) && + (priceUnread.has(rawId) || pageGone.has(rawId)) const releasedUnread = !release && releaseUnread.has(rawId) const absent = { ...(pricingUnread ? { pricing: 'unavailable' as const } : {}),