litellm - 💡(How to fix) Fix [Bug]: /eu.assemblyai passthrough resolves to default US AssemblyAI endpoint [1 pull requests]

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…

Fix Action

Fixed

Code Example

assembly_region = AssemblyAIPassthroughLoggingHandler._get_assembly_region_from_url(
    url=str(request.url)
)

---

urlparse(url).hostname == "eu.assemblyai.com"

---

curl -X POST http://<proxy>/eu.assemblyai/v2/transcript \
  -H "Authorization: Bearer <virtual-key>" \
  -H "Content-Type: application/json" \
  -d '{"audio_url":"https://assembly.ai/wildfires.mp3","speech_model":"universal"}'

---

from urllib.parse import urlparse

url = "https://proxy.company.com/eu.assemblyai/v2/transcript"
assert urlparse(url).hostname == "proxy.company.com"
# current helper returns None here

---

request.url = https://proxy.company.com/eu.assemblyai/v2/transcript
urlparse(request.url).hostname = proxy.company.com
assembly_region = None
base_target_url = https://api.assemblyai.com
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?

/eu.assemblyai/* requests on the built-in AssemblyAI passthrough route resolve to the default US AssemblyAI base URL instead of the EU AssemblyAI base URL.

In assemblyai_proxy_route() (litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py), region detection currently does:

assembly_region = AssemblyAIPassthroughLoggingHandler._get_assembly_region_from_url(
    url=str(request.url)
)

and _get_assembly_region_from_url() (litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.py) only returns "eu" when:

urlparse(url).hostname == "eu.assemblyai.com"

For a normal LiteLLM proxy deployment, a request like:

https://proxy.company.com/eu.assemblyai/v2/transcript

has hostname proxy.company.com, not eu.assemblyai.com, so the helper returns None. That makes the route fall back to the default region:

  • _get_assembly_base_url_from_region(None) chooses https://api.assemblyai.com
  • passthrough_endpoint_router.get_credentials("assemblyai", None) uses the default-region credential lookup instead of the EU credential lookup

There is also an internal inconsistency here:

  • the credential router treats an AssemblyAI api_base containing eu as EU when storing credentials
  • _get_assembly_base_url_from_region("eu") returns https://api.eu.assemblyai.com
  • but _get_assembly_region_from_url() does not recognize either the proxy path /eu.assemblyai/... or the host api.eu.assemblyai.com

Expected behavior:

  • requests sent to /eu.assemblyai/{endpoint} should resolve assembly_region="eu"
  • upstream target selection should use https://api.eu.assemblyai.com
  • credential lookup should also stay on the EU region path

Historical note:

  • /eu.assemblyai/{endpoint:path} and _get_assembly_region_from_url() were added together in #8337
  • the current branch still has the mismatch on litellm_internal_staging at 4148667671
  • this looks like an old route/helper mismatch rather than the currently open AssemblyAI PRs

Steps to Reproduce

  1. Configure an AssemblyAI passthrough model with api_base=https://api.eu.assemblyai.com and a valid AssemblyAI API key.
  2. Start LiteLLM proxy.
  3. Send a request through the built-in EU route:
curl -X POST http://<proxy>/eu.assemblyai/v2/transcript \
  -H "Authorization: Bearer <virtual-key>" \
  -H "Content-Type: application/json" \
  -d '{"audio_url":"https://assembly.ai/wildfires.mp3","speech_model":"universal"}'
  1. Observe that request-side region detection uses the proxy URL/hostname, resolves assembly_region=None, and constructs the upstream request against https://api.assemblyai.com instead of https://api.eu.assemblyai.com.

A minimal reproduction of the helper behavior:

from urllib.parse import urlparse

url = "https://proxy.company.com/eu.assemblyai/v2/transcript"
assert urlparse(url).hostname == "proxy.company.com"
# current helper returns None here

Relevant log output

request.url = https://proxy.company.com/eu.assemblyai/v2/transcript
urlparse(request.url).hostname = proxy.company.com
assembly_region = None
base_target_url = https://api.assemblyai.com

What part of LiteLLM is this about?

Proxy

What LiteLLM version are you on ?

Current litellm_internal_staging at 4148667671 (and likely any version carrying the /eu.assemblyai route added in #8337)

Twitter / LinkedIn details

No response

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