Skip to content

fix: warn on silent MIME type fallback and propagate model in recursive calls#5207

Open
enjoykumawat wants to merge 3 commits intogoogle:mainfrom
enjoykumawat:fix/litellm-mime-type-warning
Open

fix: warn on silent MIME type fallback and propagate model in recursive calls#5207
enjoykumawat wants to merge 3 commits intogoogle:mainfrom
enjoykumawat:fix/litellm-mime-type-warning

Conversation

@enjoykumawat
Copy link
Copy Markdown

Summary

  • Upgrade logger.debug to logger.warning when falling back to application/octet-stream for file URIs without determinable MIME type
  • Fix _content_to_message_param() to propagate model parameter in recursive calls for mixed function_response + content parts

Root Cause

  1. Silent application/octet-stream fallback with only a debug log caused incorrect file handling on Vertex AI
  2. Missing model=model in recursive call lost provider-specific behavior (e.g., Anthropic thinking blocks)

Test Plan

  • Test verifying warning is logged on MIME fallback
  • Test verifying model propagation in recursive calls with mixed parts
  • Existing LiteLLM tests pass

Fixes #5184

@adk-bot adk-bot added the models [Component] Issues related to model support label Apr 8, 2026
@rohityan rohityan self-assigned this Apr 9, 2026
…ve calls

LiteLLM silently fell back to application/octet-stream when file_uri
MIME type could not be determined, using only a debug log that was easy
to miss. Upgrade to warning level so developers notice the fallback.

Also fix _content_to_message_param() to propagate the model parameter
in recursive calls for mixed function_response + content parts, which
caused incorrect provider detection on Vertex AI / Anthropic.

Fixes google#5184
@enjoykumawat enjoykumawat force-pushed the fix/litellm-mime-type-warning branch from d149537 to c03864d Compare April 9, 2026 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] Issues related to model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LiteLLM silently uses application/octet-stream when file_uri MIME type cannot be determined

3 participants