Skip to content

fix(azure): send the deployment's api_version on async audio transcriptions - #53400

Merged
mateo-berri merged 8 commits into
BerriAI:mainfrom
drewv19:litellm_azure_transcription_api_version
Nov 26, 2026
Merged

mateo-berri merged 8 commits into
BerriAI:mainfrom
drewv19:litellm_azure_transcription_api_version

Conversation

@drewv19

@drewv19 drewv19 commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Handwritten 1-3 sentence description

Azure transcription deployments now send the api_version you set in config.yaml. Before this, every proxy and router call quietly used litellm's default 2025-02-01-preview, so pinning a version did nothing

Details

TLDR

Problem this solves:

  • Async Azure transcriptions ignored the deployment's api_version
  • Proxy and router calls always sent 2025-02-01-preview instead

How it solves it:

  • The async path now gets the same api_version as sync
  • v1, latest and preview aliases, in any letter case, fall back to the proxy's --api_version (default 2025-02-01-preview), or AZURE_API_VERSION in the SDK
  • none falls back the same way

v1, latest, preview and none keep the deployments route, as sync has done since #35600. Chat sends none to Azure's /openai/v1 route, but that route answers DeploymentNotFound for transcription deployments. Before this, sync sent api-version=none, which Azure answers with 404

Async now picks the version like sync and chat. The request's api_version wins, then the deployment's, then litellm_settings.api_version, then AZURE_API_VERSION. Aliases skip litellm_settings.api_version

An existing router test expected the default version for a dated deployment, which pinned this bug. It now expects the configured version

This is one of a pair with the lts/1.108.x twin. Merge this one first, then the LTS one

User Flow

Before: an admin pins a dated api_version on an Azure transcription deployment, and Azure still gets litellm's default version

  1. The admin adds azure/whisper with api_version: "2024-06-01" to config.yaml and starts the proxy
  2. A developer sends POST http://localhost:4000/v1/audio/transcriptions with model=whisper-dated and a wav file
  3. The proxy answers 200 with the transcript
  4. The egress log in front of Azure shows api-version=2025-02-01-preview, not the pinned 2024-06-01

After: the same request reaches Azure with the pinned version

  1. The admin adds azure/whisper with api_version: "2024-06-01" to config.yaml and starts the proxy
  2. A developer sends POST http://localhost:4000/v1/audio/transcriptions with model=whisper-dated and a wav file
  3. The proxy answers 200 with the transcript
  4. The egress log shows api-version=2024-06-01, and gpt-transcribe pinned at 2025-03-01-preview gets its version too, streaming included

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have added meaningful tests
  • The handful of test files covering my change pass locally, e.g. uv run pytest tests/unit/<your_test_file>.py -v. Leave the suites (make test-unit-*, make test-unit) to CI: it finishes in ~15 minutes where a laptop takes an hour or more
  • My PR passes all required CI/CD checks (e.g., lint, schema.d.ts sync check, etc.)
  • My PR's scope is as isolated as possible; it only solves 1 specific problem
  • Every automated review on my PR's latest commit has finished, and I have addressed or replied to each of its findings before requesting a maintainer review

Delays in PR merge?

If you're seeing a delay in your PR being merged, ping the LiteLLM Team on Slack (#pr-review).

Screenshots / Proof of Fix

Last updated: be13b19. QA ran on d1ee386. Changes since QA: one local variable renamed in audio_transcriptions.py. Proof remains valid because the rename changes no value. Verification: affected unit tests and make check pass at be13b19

Before ran at the merge base cc497fd and After at d1ee386, each a no-DB proxy with 2 uvicorn workers, called with curl against real Azure. A logging forward proxy in front of Azure records each request's api-version and status. AZURE_API_VERSION is unset

Case Configured Before sends After sends
whisper 2024-06-01 2025-02-01-preview 2024-06-01
gpt-transcribe 2025-03-01-preview 2025-02-01-preview 2025-03-01-preview
gpt-transcribe, stream=true 2025-03-01-preview 2025-02-01-preview 2025-03-01-preview
gpt-transcribe v1 2025-02-01-preview 2025-02-01-preview
gpt-transcribe V1 2025-02-01-preview 2025-02-01-preview
gpt-transcribe none 2025-02-01-preview 2025-02-01-preview
SDK sync none none, 404 2025-02-01-preview, 200
SDK sync Preview Preview, 404 2025-02-01-preview, 200

Every proxy call answered 200 with the Gettysburg transcript on both legs. The SDK calls with none and Preview got a 404 before and the transcript after

Shared setup (config.yaml, proxy launcher, egress logger, SDK script, case script)

Env var names: AZURE_LIT6549_AUDIO_QA_API_BASE, AZURE_LIT6549_AUDIO_QA_API_KEY (whisper resource), AZURE_FOUNDRY_API_BASE, AZURE_FOUNDRY_API_KEY (gpt-transcribe resource)

config.yaml for the Before leg (the After leg is the same with its own logger ports 21395 and 29800)

model_list:
  - model_name: whisper-dated
    litellm_params:
      model: azure/whisper
      api_base: "http://127.0.0.1:23634"
      api_key: os.environ/AZURE_LIT6549_AUDIO_QA_API_KEY
      api_version: "2024-06-01"
  - model_name: gpt-transcribe-dated
    litellm_params:
      model: azure/gpt-transcribe
      api_base: "http://127.0.0.1:26689"
      api_key: os.environ/AZURE_FOUNDRY_API_KEY
      api_version: "2025-03-01-preview"
  - model_name: gpt-transcribe-v1
    litellm_params:
      model: azure/gpt-transcribe
      api_base: "http://127.0.0.1:26689"
      api_key: os.environ/AZURE_FOUNDRY_API_KEY
      api_version: "v1"
  - model_name: gpt-transcribe-V1
    litellm_params:
      model: azure/gpt-transcribe
      api_base: "http://127.0.0.1:26689"
      api_key: os.environ/AZURE_FOUNDRY_API_KEY
      api_version: "V1"
  - model_name: gpt-transcribe-none
    litellm_params:
      model: azure/gpt-transcribe
      api_base: "http://127.0.0.1:26689"
      api_key: os.environ/AZURE_FOUNDRY_API_KEY
      api_version: "none"
general_settings:
  master_key: os.environ/QA_MASTER_KEY

Proxy launcher, run as launch.sh <tree> <venv> <port> <config>

#!/bin/zsh
set -eu
wt=$1 venv=$2 port=$3 config=$4
Q=${0:A:h}
envf=/Users/mateo/Development/litellm/.env
unset DATABASE_URL DIRECT_URL REDIS_HOST REDIS_URL AZURE_API_VERSION
export PYTHON_DOTENV_DISABLED=1 LITELLM_LOG=INFO QA_MASTER_KEY=sk-<any master key you pick>
export AZURE_LIT6549_AUDIO_QA_API_KEY=$(~/.claude/bin/dotenv-get AZURE_LIT6549_AUDIO_QA_API_KEY --file $envf)
export AZURE_FOUNDRY_API_KEY=$(~/.claude/bin/dotenv-get AZURE_FOUNDRY_API_KEY --file $envf)
export PYTHONPATH=$wt:$wt/litellm/enterprise:$wt/litellm/proxy-extras
cd $wt
test -z "$(git status --porcelain)" || { echo "BLOCKED: $wt is dirty"; exit 9; }
echo "booting $(git rev-parse HEAD) on $port with 2 workers"
exec $venv/bin/python -m litellm.proxy.proxy_cli --config $config --port $port --host 127.0.0.1 --num_workers 2 --timeout_worker_healthcheck 60

Egress logger, run as python recorder.py <port> $AZURE_..._API_BASE <leg>-<resource>.jsonl once per resource per leg

import json
import sys
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import parse_qs, urlsplit

import httpx

PORT, UPSTREAM, LOG = int(sys.argv[1]), sys.argv[2].rstrip("/"), sys.argv[3]
HOP = {"host", "content-length", "transfer-encoding", "connection", "accept-encoding"}


class Recorder(BaseHTTPRequestHandler):
    def _forward(self) -> None:
        body = self.rfile.read(int(self.headers.get("content-length") or 0))
        parts = urlsplit(self.path)
        headers = {k: v for k, v in self.headers.items() if k.lower() not in HOP}
        upstream = httpx.request(self.command, UPSTREAM + self.path, headers=headers, content=body, timeout=120)
        with open(LOG, "a") as log:
            row = {"method": self.command, "path": parts.path, "query": parse_qs(parts.query), "status": upstream.status_code}
            log.write(json.dumps(row) + "\n")
        self.send_response(upstream.status_code)
        for k, v in upstream.headers.items():
            if k.lower() not in HOP | {"content-encoding"}:
                self.send_header(k, v)
        self.send_header("content-length", str(len(upstream.content)))
        self.end_headers()
        self.wfile.write(upstream.content)

    do_GET = do_POST = _forward

    def log_message(self, *args: object) -> None:
        pass


ThreadingHTTPServer(("127.0.0.1", PORT), Recorder).serve_forever()

SDK script, run as sdk_version.py <api_base> <api_version>

import os
import sys

import litellm

with open("tests/gettysburg.wav", "rb") as audio:
    response = litellm.transcription(
        model="azure/gpt-transcribe",
        file=audio,
        api_base=sys.argv[1],
        api_key=os.environ["AZURE_FOUNDRY_API_KEY"],
        api_version=sys.argv[2],
    )
print(response.text)

Case script, run as cases.sh <leg> <tree> <venv> <proxy port> <logger port>

#!/bin/zsh
set -u
leg=$1 wt=$2 venv=$3 port=$4 suite_port=$5
Q=${0:A:h}
unset AZURE_API_VERSION
export PYTHON_DOTENV_DISABLED=1 PYTHONPATH=$wt
export QA_MASTER_KEY=sk-<any master key you pick>
export AZURE_FOUNDRY_API_KEY=$(~/.claude/bin/dotenv-get AZURE_FOUNDRY_API_KEY --file /Users/mateo/Development/litellm/.env)
cd $wt
print "leg $leg, proxy at $(git rev-parse --short=10 HEAD), 2 uvicorn workers, port $port"
run_case() {
  local title=$1 rec=$2 cmd=$3 n
  n=$(cat $Q/$leg-$rec.jsonl 2>/dev/null | wc -l | tr -d ' ')
  print "\n#### $title\n"
  printf '$ %s\n' "$cmd"; PATH=$venv/bin:$PATH eval "$cmd"; print
  sleep 1
  printf '$ %s\n' "tail -n +$((n + 1)) $leg-$rec.jsonl"
  tail -n +$((n + 1)) $Q/$leg-$rec.jsonl
}
run_case "whisper, api_version 2024-06-01" audio "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=whisper-dated -F file=@tests/gettysburg.wav | head -c 120"
run_case "gpt-transcribe, api_version 2025-03-01-preview" suite "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=gpt-transcribe-dated -F file=@tests/gettysburg.wav | head -c 120"
run_case "gpt-transcribe streaming, api_version 2025-03-01-preview" suite "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=gpt-transcribe-dated -F stream=true -F file=@tests/gettysburg.wav | head -c 240"
run_case "gpt-transcribe, api_version v1" suite "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=gpt-transcribe-v1 -F file=@tests/gettysburg.wav | head -c 120"
run_case "gpt-transcribe, api_version V1" suite "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=gpt-transcribe-V1 -F file=@tests/gettysburg.wav | head -c 120"
run_case "gpt-transcribe, api_version none" suite "curl -s http://127.0.0.1:$port/v1/audio/transcriptions -H \"Authorization: Bearer \$QA_MASTER_KEY\" -F model=gpt-transcribe-none -F file=@tests/gettysburg.wav | head -c 120"
run_case "Python SDK, litellm.transcription with api_version none" suite "python $Q/sdk_version.py http://127.0.0.1:$suite_port none 2>&1 | tail -n 1 | head -c 120"
run_case "Python SDK, litellm.transcription with api_version Preview" suite "python $Q/sdk_version.py http://127.0.0.1:$suite_port Preview 2>&1 | tail -n 1 | head -c 120"

Before (cc497fd)

whisper, api_version 2024-06-01

  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=whisper-dated -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +1 before-audio.jsonl
    {"method": "POST", "path": "/openai/deployments/whisper/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version 2025-03-01-preview

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-dated -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +1 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe streaming, api_version 2025-03-01-preview

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-dated -F stream=true -F file=@tests/gettysburg.wav | head -c 240
    data: {"delta":"Four","type":"transcript.text.delta"}
    data: {"delta":" score","type":"transcript.text.delta"}
    data: {"delta":" and","type":"transcript.text.delta"}
    data: {"delta":" seven","type":"transcript.text.delta"}
    data: {"delta":"
    
  2. Read the egress log rows that call wrote

    $ tail -n +2 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version v1

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-v1 -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +3 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version V1

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-V1 -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +4 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version none

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:22099/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-none -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +5 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

Python SDK, litellm.transcription with api_version none

Commands and output
  1. Send the request

    $ python /private/tmp/claude-501/-Users-mateo-Development-litellm/1a9301a4-530b-47f3-bea7-0fb81375b13c/scratchpad/work-244e6944/qa/sdk_version.py http://127.0.0.1:26689 none 2>&1 | tail -n 1 | head -c 120
    openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
    
  2. Read the egress log rows that call wrote

    $ tail -n +6 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["none"]}, "status": 404}
    

Python SDK, litellm.transcription with api_version Preview

Commands and output
  1. Send the request

    $ python /private/tmp/claude-501/-Users-mateo-Development-litellm/1a9301a4-530b-47f3-bea7-0fb81375b13c/scratchpad/work-244e6944/qa/sdk_version.py http://127.0.0.1:26689 Preview 2>&1 | tail -n 1 | head -c 120
    openai.NotFoundError: Error code: 404 - {'error': {'code': '404', 'message': 'Resource not found'}}
    
  2. Read the egress log rows that call wrote

    $ tail -n +7 before-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["Preview"]}, "status": 404}
    

After (d1ee386)

whisper, api_version 2024-06-01

  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=whisper-dated -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +1 after-audio.jsonl
    {"method": "POST", "path": "/openai/deployments/whisper/audio/transcriptions", "query": {"api-version": ["2024-06-01"]}, "status": 200}
    

gpt-transcribe, api_version 2025-03-01-preview

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-dated -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +1 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-03-01-preview"]}, "status": 200}
    

gpt-transcribe streaming, api_version 2025-03-01-preview

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-dated -F stream=true -F file=@tests/gettysburg.wav | head -c 240
    data: {"delta":"Four","type":"transcript.text.delta"}
    data: {"delta":" score","type":"transcript.text.delta"}
    data: {"delta":" and","type":"transcript.text.delta"}
    data: {"delta":" seven","type":"transcript.text.delta"}
    data: {"delta":"
    
  2. Read the egress log rows that call wrote

    $ tail -n +2 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-03-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version v1

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-v1 -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +3 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version V1

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-V1 -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +4 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

gpt-transcribe, api_version none

Commands and output
  1. Send the request

    $ curl -s http://127.0.0.1:25975/v1/audio/transcriptions -H "Authorization: Bearer $QA_MASTER_KEY" -F model=gpt-transcribe-none -F file=@tests/gettysburg.wav | head -c 120
    {"text":"Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty 
    
  2. Read the egress log rows that call wrote

    $ tail -n +5 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

Python SDK, litellm.transcription with api_version none

Commands and output
  1. Send the request

    $ python /private/tmp/claude-501/-Users-mateo-Development-litellm/1a9301a4-530b-47f3-bea7-0fb81375b13c/scratchpad/work-244e6944/qa/sdk_version.py http://127.0.0.1:29800 none 2>&1 | tail -n 1 | head -c 120
    Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedic
    
  2. Read the egress log rows that call wrote

    $ tail -n +6 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

Python SDK, litellm.transcription with api_version Preview

Commands and output
  1. Send the request

    $ python /private/tmp/claude-501/-Users-mateo-Development-litellm/1a9301a4-530b-47f3-bea7-0fb81375b13c/scratchpad/work-244e6944/qa/sdk_version.py http://127.0.0.1:29800 Preview 2>&1 | tail -n 1 | head -c 120
    Four score and seven years ago, our fathers brought forth on this continent a new nation, conceived in liberty and dedic
    
  2. Read the egress log rows that call wrote

    $ tail -n +7 after-suite.jsonl
    {"method": "POST", "path": "/openai/deployments/gpt-transcribe/audio/transcriptions", "query": {"api-version": ["2025-02-01-preview"]}, "status": 200}
    

/live-pr-risk

No breaking path at d1ee386. The two contract changes below are the ones the ticket asks for

Ran on d1ee386 against the merge base cc497fd. Each side ran two proxy processes with 2 workers each on one Postgres and one Redis, and requests alternated between the two processes. A logging forward proxy in front of each Azure resource recorded every request's path, api-version and status. AZURE_API_VERSION was unset and litellm_settings.api_version was 2025-04-01-preview. The rename in be13b19 changes no value, so these results stand for it. Main has changed none of the files on this walk since cc497fd apart from an OTEL settings change in proxy_server.py, so they also stand for the merge into main

Breaking

None. Every dependent answered the same on both sides apart from the version this PR means to send

Backward incompatible

A caller's api_version form field or ?api-version= now wins over the deployment's pin on async transcription, where the merge base ignored it. A 5 KB value answered 200 at the merge base and an Azure 404 at the tip. An empty api_version form field now drops the pin, so litellm_settings.api_version is sent. Chat does the same for an empty api_version on both sides. Mateo asked for chat's order in the ticket behind this PR ("as chat completions does"), so no separate sign-off is needed

An unpinned transcription deployment now gets litellm_settings.api_version instead of the proxy's default. A pin or global value Azure does not support for audio now gets a 404 (see Caveats). Mateo's ticket asks for this too

Regression risk

The Entra ID token path builds its client through the same helper with the same version argument and was not driven live. The version argument is the only input this PR changes there, and the API key cells exercise it

Dependency graph

Dependent Entry point State
Pinned whisper, gpt-transcribe proxy route verified-live
Two pins, one resource proxy route verified-live
Unpinned deployment proxy route verified-live
azure_ai/ transcription proxy route verified-live
stream=true proxy route verified-live
Fallback after a 401 router verified-live
Health check /health?model= verified-live
Caller version, empty, NONE, 5 KB proxy route verified-live
Virtual keys /key/* verified-live, same
Chat, /v1/messages proxy route verified-live, same
Spend rows /spend/logs verified-live, same
Unquoted YAML date proxy boot both refuse the config
Version order router async unit tests
Entra ID token SDK, proxy untested
Azure v1 streaming e2e tests/e2e not run here

Not verified

The Entra ID token path, since no Entra app credential for the QA Azure resources is in the .env. The Azure v1 streaming e2e test, which sends v1, an input this PR leaves as it was. The unit shards, which CI runs at the tip

Type

🐛 Bug Fix

Caveats (if any)

Medium

  • A caller's api_version and litellm_settings.api_version now reach Azure on async transcription
    • The caller's form field, ?api-version= or router default_litellm_params beats the pin, and an unpinned deployment gets the global value
    • 2023-05-15 sent either way answered 200 at the merge base and 404 here. Sync and chat already work this way
  • Deployments pinned to a version without audio support start failing on upgrade
    • A 2023-05-15 pin answered 200 at the merge base, which ignored it, and 404 here. Azure also rejects 2023-07-01-preview for audio
    • Before upgrading, pin transcription deployments to 2023-09-01-preview or newer

Low

  • v1, latest, preview and none deployments skip litellm_settings.api_version, as sync did at the merge base (see Decisions)
  • Entra ID token auth was not run live. Only the version argument changes on that path
  • SDK code setting litellm.api_version to a datetime.date now raises on async transcription, as chat already does. The proxy refuses an unquoted date at boot on both sides
Decisions
  • Async follows the same version order as sync and chat, which is the request, the deployment, litellm_settings.api_version, AZURE_API_VERSION, then the default. The rejected option was reading only the deployment's version on async, which would make async and sync disagree. Request kwargs, router default_litellm_params included, override deployment params for every router call type, and stopping callers from sending api_version would be a proxy-wide auth change for chat too, so it stays outside this fix
  • v1, latest, preview and none keep the deployments route and fall back to AZURE_API_VERSION or the default, skipping litellm_settings.api_version. That is what sync did for lowercase v1, latest and preview at the merge base. One rejected option was sending litellm_settings.api_version for them, which would also change sync for alias deployments and treat an alias like no version at all. The other was chat's /openai/v1 route with no api-version, since that route answers DeploymentNotFound for transcription deployments
  • Transcription matches the v1, latest and preview aliases in any letter case, so V1 keeps the default as async always did. The shared helper stays exact-case, since changing it would also change chat routing

Final Attestation

  • The tests check the right things, including the edge cases, and regressions in the respective real-world customer use-cases are not possible after this PR
Bugbot summary

[!NOTE]
Medium Risk
Changes which api-version Azure receives on async transcription (including caller override and global settings), which can surface 404s for pins or versions without audio support.

Overview
Async Azure audio transcriptions now honor the same api_version as the sync path instead of always falling back to LiteLLM’s default on proxy/router calls.

AzureAudioTranscription computes a shared client_api_version: dated deployment pins are forwarded on the wire, while opt-out aliases (v1, latest, preview, none, any case) clear the client version so fallbacks match sync/chat behavior. That value is passed into both async_audio_transcriptions and get_azure_openai_client for sync.

Tests are updated so router/sync expectations use the configured deployment version where appropriate, aliases map to AZURE_DEFAULT_API_VERSION, and a new case covers request vs deployment vs global api_version precedence on async router transcription.

Reviewed by Cursor Bugbot for commit be13b19. Bugbot is set up for automated code reviews on this repo. Configure here.

…dio transcriptions

Azure's v1 route answers DeploymentNotFound for transcription deployments, so preview, latest and v1 fall back to the dated default on the per-deployment route, which also stops the sync path from raising on a v1 client
…iption_api_version

# Conflicts:
#	litellm/llms/azure/audio_transcriptions.py
#	tests/unit/llms/azure/test_audio_transcriptions.py
@veria-ai

veria-ai Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

PR overview

No security issues were found in this pull request.

Reviews

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5 · The PR appears safe to merge, with no new actionable issues found.RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge, with no new actionable issues found.

Summary

Azure async transcriptions now send the configured api_version. Sync and async calls share the same alias handling, and the tests check deployment versions and which setting wins.

Since the previous review, only a local variable name changed. Both uses were updated, with no change to behavior. No new actionable issues or rule violations were found.

  • Azure transcriptions pass the selected API version to async calls.

Reviews (5) · Last reviewed commit: "refactor(azure): name the transcription ..." · Reviewed by Greptile

@mateo-berri mateo-berri added the autoapprove This PR may be autoapproved by greptile. The author thinks that it does not need human review. label Nov 21, 2026
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

…iption_api_version

# Conflicts:
#	tests/unit/llms/azure/test_audio_transcriptions.py
@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

@greptileai

@mateo-berri

Copy link
Copy Markdown
Contributor

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit be13b19. Configure here.

@mateo-berri mateo-berri left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mateo-berri
mateo-berri merged commit 8a88813 into BerriAI:main Nov 26, 2026
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autoapprove This PR may be autoapproved by greptile. The author thinks that it does not need human review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants