litellm/litellm/router_utils
shivam e72eac9176
Fix add_model_file_id_mappings when router returns single deployment dict
When model_info.id equals model_name (common for batch models), the router
resolves via has_model_id and returns one deployment dict instead of a list.
The dict branch incorrectly iterated deployment keys (model_name,
litellm_params, model_info), producing non-string values that broke
LiteLLM_ManagedFileTable validation on managed file upload.

Normalize list vs dict by wrapping single deployments and extracting
model_info.id for each response pair.

Add regression tests including the batch model id == model_name case.

Made-with: Cursor
2026-04-30 18:04:47 -07:00
..
pre_call_checks fix(router): don't create litellm_metadata for non-Responses API calls in encrypted_content_affinity_check (#25347) 2026-04-08 21:11:19 -07:00
router_callbacks (code quality) run ruff rule to ban unused imports (#7313) 2024-12-19 12:33:42 -08:00
add_retry_fallback_headers.py Codestral - return litellm latency overhead on /v1/completions + Add '__contains__' support for ChatCompletionDeltaToolCall (#10879) 2025-05-27 16:13:44 -07:00
batch_utils.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
client_initalization_utils.py fix: fix linting errors 2025-03-11 18:49:55 -07:00
clientside_credential_handler.py chore(auth): tighten clientside api_base handling (#26518) 2026-04-29 17:27:22 -07:00
common_utils.py Fix add_model_file_id_mappings when router returns single deployment dict 2026-04-30 18:04:47 -07:00
cooldown_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
cooldown_callbacks.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
cooldown_handlers.py fix(router): add minimum request threshold for error rate cooldown (#17464) 2025-12-12 04:36:10 -08:00
fallback_event_handlers.py Revert "fix: prevent error when max_fallbacks exceeds available models (#20071)" 2026-02-03 15:15:30 +05:30
get_retry_from_policy.py inspect BadRequestError after all other policy types (#19878) 2026-01-27 18:15:04 -08:00
handle_error.py Litellm ishaan march30 (#24887) (#25151) 2026-04-04 14:44:07 -07:00
health_state_cache.py feat(router): add health-check-driven routing behind opt-in flag 2026-03-27 20:57:08 +05:30
pattern_match_deployments.py style: run black formatter on files from main merge 2026-04-17 13:02:59 -07:00
prompt_caching_cache.py style: run black formatter on entire codebase 2026-03-11 17:07:57 -03:00
response_headers.py LiteLLM Minor Fixes & Improvements (11/26/2024) (#6913) 2024-11-28 00:01:38 +05:30
search_api_router.py fix: address Cursor Bugbot findings on PR #26691 2026-04-29 21:08:19 +00:00