Skip to content

[Bug]: litellm.utils.supports_pdf_input returns False for gemini 2.5 models #11881

Closed
@bmanczak

Description

@bmanczak

What happened?

litellm.utils.supports_pdf_input("gemini/gemini-2.5-flash") returns False, but Gemini 2.5 Flash actually supports PDF input (at least locally).

Code to reproduce

#!/usr/bin/env python3
import base64
from pathlib import Path

from litellm import completion
from litellm.utils import supports_pdf_input

print(f"litellm.utils.supports_pdf_input('gemini/gemini-2.5-flash') = {supports_pdf_input('gemini/gemini-2.5-flash')}")

# Read and encode PDF
pdf_path = "/workspace/tests/multi_modal_test_assets/cover_book.pdf"
pdf_b64 = base64.b64encode(Path(pdf_path).read_bytes()).decode()

# API call
response = completion(
    model="gemini/gemini-2.5-flash",
    messages=[
        {
            "role": "user",
            "content": [
                {"type": "text", "text": "What is this book about? Give a very brief summary."},
                {"type": "file", "file": {"file_data": f"data:application/pdf;base64,{pdf_b64}"}},
            ],
        }
    ],
    temperature=0.0,
    max_tokens=150,
)

print(response.choices[0].message.content)

Output:

litellm.utils.supports_pdf_input('gemini/gemini-2.5-flash') = False
This book is **"The Little Prince" by Antoine de

Are you a ML Ops Team?

No

What LiteLLM version are you on ?

1.72.4

Twitter / LinkedIn details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions