Skip to content

feat(mistral): add Voxtral audio transcription support - #22801

Merged
Chesars merged 3 commits into
BerriAI:litellm_oss_staging_03_04_2026from
Chesars:feat/mistral-audio-transcription
Mar 4, 2026
Merged

feat(mistral): add Voxtral audio transcription support#22801
Chesars merged 3 commits into
BerriAI:litellm_oss_staging_03_04_2026from
Chesars:feat/mistral-audio-transcription

Conversation

@Chesars

@Chesars Chesars commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Relevant issues

Addresses discussion #12952
Closes #23272

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Type

🆕 New Feature

Changes

Adds Mistral Voxtral audio transcription support via litellm.transcription().

  • New: litellm/llms/mistral/audio_transcription/transformation.pyMistralAudioTranscriptionConfig implementing multipart form-data requests to POST https://api.mistral.ai/v1/audio/transcriptions
  • Modified: litellm/utils.py — Register Mistral in ProviderConfigManager.get_provider_audio_transcription_config()
  • Modified: litellm/litellm_core_utils/get_supported_openai_params.py — Add transcription request_type for mistral provider
  • New: 9 unit tests covering URL construction, auth headers, request/response transformation, param mapping, and provider-specific param passthrough (e.g. diarize)
  • Docs: Added Mistral to supported providers in audio_transcription.md and added Audio Transcription section to providers/mistral.md

Usage

response = litellm.transcription(
    model="mistral/voxtral-mini-latest",
    file=open("audio.wav", "rb"),
)
print(response.text)

Supports OpenAI-compatible params (language, temperature, response_format, timestamp_granularities) plus Mistral-specific params like diarize.

Chesars added 2 commits March 4, 2026 16:20
Add MistralAudioTranscriptionConfig for Mistral's /v1/audio/transcriptions
endpoint, enabling litellm.transcription() with mistral/voxtral-mini-latest
and other Voxtral models. Supports multipart form-data with OpenAI-compatible
params (language, temperature, response_format, timestamp_granularities)
plus Mistral-specific params like diarize.
Add Mistral to the supported providers list in audio_transcription.md
and add Audio Transcription section to the Mistral provider page with
SDK usage, optional params, diarize support, and proxy configuration.
@vercel

vercel Bot commented Mar 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Error Error Mar 4, 2026 7:57pm

Request Review

@greptile-apps

greptile-apps Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Mistral Voxtral audio transcription support via litellm.transcription(), following the established provider pattern (matching OVHCloud's implementation). The new MistralAudioTranscriptionConfig handles multipart form-data requests to Mistral's /v1/audio/transcriptions endpoint with support for OpenAI-compatible params (language, temperature, response_format, timestamp_granularities) and Mistral-specific params like diarize.

  • New MistralAudioTranscriptionConfig in litellm/llms/mistral/audio_transcription/transformation.py implementing request/response transformation, URL construction, auth headers, and error handling
  • Provider registered in ProviderConfigManager.get_provider_audio_transcription_config() and get_supported_openai_params() for the transcription request type
  • Boolean provider-specific params correctly serialized as lowercase strings ("true"/"false") for multipart form data
  • 9 unit tests covering URL construction, auth, param mapping, request/response transformation, and diarize passthrough
  • Documentation added to both the audio transcription overview and Mistral provider pages

Confidence Score: 4/5

  • This PR is safe to merge — it's a well-structured additive feature following established patterns with good test coverage.
  • Score of 4 reflects a clean, well-implemented new feature that follows existing provider patterns (mirrors OVHCloud implementation). All provider-specific code is correctly isolated in the llms/ directory. The boolean serialization issue from the initial review has been addressed. The only minor concern is that the BaseLLMAudioTranscriptionTest class in test_litellm/ makes real API calls (guarded by skipif), but this matches the existing OVHCloud convention.
  • No files require special attention — the implementation is consistent with existing patterns.

Important Files Changed

Filename Overview
litellm/llms/mistral/audio_transcription/transformation.py New MistralAudioTranscriptionConfig implementing multipart form-data transcription. Clean implementation following the existing OVHCloud pattern. Boolean serialization handled correctly (lowercase). Provider-specific params properly extracted via base class helper.
litellm/utils.py Adds Mistral provider branch to get_provider_audio_transcription_config, following the established pattern for other providers (OVHCloud, WatsonX, etc.). Minimal and correct change.
litellm/litellm_core_utils/get_supported_openai_params.py Adds transcription request_type handling for mistral provider, consistent with existing chat_completion and embeddings branches.
tests/test_litellm/llms/mistral/audio_transcription/test_mistral_audio_transcription_transformation.py Good unit test coverage (9 tests) for URL construction, auth headers, param mapping, request/response transformation, and diarize passthrough. The BaseLLMAudioTranscriptionTest class uses skipif for real API calls, matching OVHCloud convention.
docs/my-website/docs/providers/mistral.md Comprehensive documentation for Mistral audio transcription including SDK usage, optional params, Mistral-specific params (diarize), and proxy config example.

Sequence Diagram

sequenceDiagram
    participant User
    participant LiteLLM as litellm.transcription()
    participant PCM as ProviderConfigManager
    participant Config as MistralAudioTranscriptionConfig
    participant Handler as LLM HTTP Handler
    participant Mistral as Mistral API

    User->>LiteLLM: transcription(model="mistral/voxtral-mini-latest", file=audio)
    LiteLLM->>PCM: get_provider_audio_transcription_config(provider=MISTRAL)
    PCM-->>LiteLLM: MistralAudioTranscriptionConfig
    LiteLLM->>Config: validate_environment(api_key)
    Config-->>LiteLLM: Headers (Bearer token)
    LiteLLM->>Config: get_complete_url()
    Config-->>LiteLLM: https://api.mistral.ai/v1/audio/transcriptions
    LiteLLM->>Config: transform_audio_transcription_request(model, file, params)
    Config-->>LiteLLM: AudioTranscriptionRequestData(data, files)
    LiteLLM->>Handler: POST multipart/form-data
    Handler->>Mistral: POST /v1/audio/transcriptions
    Mistral-->>Handler: {"text": "..."}
    Handler->>Config: transform_audio_transcription_response(raw_response)
    Config-->>Handler: TranscriptionResponse(text="...")
    Handler-->>User: TranscriptionResponse
Loading

Last reviewed commit: 354f44c

Comment thread litellm/llms/mistral/audio_transcription/transformation.py Outdated
str(True) produces "True" but Mistral API expects lowercase "true".
Use str(value).lower() for bool params in provider-specific fields.
@CLAassistant

CLAassistant commented Mar 4, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@Chesars
Chesars changed the base branch from main to litellm_oss_staging_03_04_2026 March 4, 2026 20:55
@Chesars
Chesars merged commit 424c433 into BerriAI:litellm_oss_staging_03_04_2026 Mar 4, 2026
31 of 38 checks passed
@Chesars
Chesars deleted the feat/mistral-audio-transcription branch March 4, 2026 20:55
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…scription

feat(mistral): add Voxtral audio transcription support
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants