litellm - ✅(Solved) Fix [Bug]: Diarization not working with mistral/voxtral-mini-latest modell [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
BerriAI/litellm#23890Fetched 2026-04-08 00:54:00
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
labeled ×3closed ×1cross-referenced ×1referenced ×1

Fix Action

Fixed

PR fix notes

PR #23925: fix(mistral): preserve diarization segments in transcription response

Description (problem / solution / changelog)

Relevant issues

Fixes #23890

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • 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

🐛 Bug Fix

Changes

When using Mistral's Voxtral model with diarize=true, the API returns segments (with speaker_id, timestamps) and language fields. These were being dropped in transform_audio_transcription_response which only extracted text.

Now segments and language are preserved on the TranscriptionResponse object, matching the pattern used by other providers like Deepgram.

Changed files

  • litellm/llms/mistral/audio_transcription/transformation.py (modified, +7/-0)
  • tests/test_litellm/llms/mistral/audio_transcription/test_mistral_audio_transcription_transformation.py (modified, +44/-0)

Code Example

{
model:"mistral-voxtral-mini-latest",
diarize:"True",
timestamp_granularities:"segment"
}

---

{
text:"Text content (shortened)",
usage:null
}

---

{
    "model": "voxtral-mini-latest",
    "text": "Text content (shortened)",
    "language": null,
    "segments": [
        {
            "text": "Segment_Text",
            "start": 0.3,
            "end": 7.6,
            "speaker_id": "speaker_1",
            "type": "transcription_segment"
        },
        {
            "text": "Segment_Text",
            "start": 8.3,
            "end": 13.0,
            "speaker_id": "speaker_1",
            "type": "transcription_segment"
        },
        ...
    ],
    "usage": {
        "prompt_audio_seconds": 59,
        "prompt_tokens": 5,
        "total_tokens": 297,
        "completion_tokens": 292,
        "request_count": 1
    },
    "type": "transcription.done"
}
RAW_BUFFERClick to expand / collapse

Check for existing issues

  • I have searched the existing issues and checked that my issue is not a duplicate.

What happened?

Adding parameter "diarize": "True" to the litellm_params does notdeliver a response containing segments (from diarization).

Steps to Reproduce

  1. Deploy litellm with version 1.82.3
  2. Add mistral/voxtral-mini-latest as a model and add this json object as params: { "diarize": "True", "timestamp_granularities": "segment" }
  3. Create a request on your litellm api (for example using curl)

Relevant log output

Logging output request:

{
model:"mistral-voxtral-mini-latest",
diarize:"True",
timestamp_granularities:"segment"
}

Logged output response:

{
text:"Text content (shortened)",
usage:null
}

Expected output (from a cURL request directly to mistral API with the same file)

{
    "model": "voxtral-mini-latest",
    "text": "Text content (shortened)",
    "language": null,
    "segments": [
        {
            "text": "Segment_Text",
            "start": 0.3,
            "end": 7.6,
            "speaker_id": "speaker_1",
            "type": "transcription_segment"
        },
        {
            "text": "Segment_Text",
            "start": 8.3,
            "end": 13.0,
            "speaker_id": "speaker_1",
            "type": "transcription_segment"
        },
        ...
    ],
    "usage": {
        "prompt_audio_seconds": 59,
        "prompt_tokens": 5,
        "total_tokens": 297,
        "completion_tokens": 292,
        "request_count": 1
    },
    "type": "transcription.done"
}

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

v1.82.3

Twitter / LinkedIn details

No response

extent analysis

Fix Plan

To fix the issue with diarization not working when adding the "diarize": "True" parameter to the litellm_params, you need to modify the API request handling in the LiteLLM proxy.

Here are the steps:

  • Update the LiteLLM proxy to properly forward the diarize parameter to the Mistral API.
  • Ensure the Mistral API is configured to perform diarization when the diarize parameter is set to True.

Example code snippet to forward the diarize parameter:

# In the LiteLLM proxy API handler
def handle_request(request):
    # ...
    mistral_params = {
        "model": request["model"],
        "diarize": request.get("diarize", "False"),  # Forward the diarize parameter
        "timestamp_granularities": request.get("timestamp_granularities", "")
    }
    # ...
    response = mistral_api.request(mistral_params)
    # ...

Verification

To verify that the fix worked, send a request to the LiteLLM API with the diarize parameter set to True and check the response for the presence of segments.

Example curl command:

curl -X POST \
  http://lite-llm-api.com/transcribe \
  -H 'Content-Type: application/json' \
  -d '{"model": "mistral/voxtral-mini-latest", "diarize": "True", "timestamp_granularities": "segment"}'

The response should contain a segments array with diarization information.

Extra Tips

  • Make sure to update the LiteLLM proxy documentation to reflect the changes.
  • Test the fix with different models and audio files to ensure diarization works as expected.
  • Consider adding logging to track diarization requests and responses for debugging purposes.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING