7 views
-/https://github.com/berriai/litellm/issues/27516
GitHub · issue

#27516 [Bug]: Credential routing `defaultconfig` provider matching fails when model_name has no provider prefix

  • State: open
  • Author: @chinayin
  • Labels: bug, proxy, llm translation

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

## What happened

When using per-team credential routing with multiple providers in `defaultconfig`, the system always resolves to the **first** provider entry in the dict — regardless of which provider the model actually belongs to.

This happens because the provider hint is extracted solely from the user's request `model` field (e.g. `claude-sonnet-4.6`), not from the deployment's `litellm_params.model` (e.g. `bedrock/us.anthropic.claude-sonnet-4-6`). When the request model name contains no `/`, the provider hint is `None`, and the fallback logic returns the first entry in the dict.

## Relevant code

`litellm/proxy/litellm_pre_call_utils.py`, inside `_apply_credential_overrides_from_model_config`:

```python model_name = data.get("model") # This is the user-facing model name, e.g. "claude-sonnet-4.6"

# Extract provider hint from model name (e.g. "azure/gpt-4" -> "azure") provider: Optional[str] = None if "/" in model_name: provider = model_name.split("/", 1)[0] ```

When `model_name = "claude-sonnet-4.6"` (no `/`), `provider` is `None`…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d17h57m46s ago — entered · #import:https:::github.com:berriai:litellm post #2910
Credential-routing behavior requires tracing provider resolution across deployment and request contexts plus regression coverage, while the UI configuration fix is likely a localized reference correction.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search