Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documented vs. Actual File Size Limit for Large Files (PDFs) in Gemini Flash 2.0 #353

Closed
rnckp opened this issue Feb 15, 2025 · 2 comments
Closed
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.

Comments

@rnckp
Copy link

rnckp commented Feb 15, 2025

I have several hundred large PDFs, each several hundred pages long, with file sizes ranging from ~100MB to 300MB. I want to OCR them using Gemini Flash 2.0.

To test the prompting, I used smaller samples by trimming the PDFs down to around 10 pages. Processing these smaller files works very well.

However, when attempting to process the full-sized PDFs, I ran into issues.

According to the Gemini documentation, files larger than 20MB should be uploaded using the File API (which I can successfully do). The documentation also states that the maximum file size per file is 2GB:

Note: The File API lets you store up to 20 GB of files per project, with a per-file maximum size of 2 GB.

Despite this, when I attempted to process my full-sized PDFs, I encountered file size limit errors. I opened an issue here, and through testing, we found that only PDFs up to 52,428,800 bytes (~52MB) seem to work.

This contradicts the documented 2GB limit and appears to be an arbitrary and very low restriction, especially given Gemini's extreme long-context capabilities. Unfortunately, a 52MB file size limit is not viable for my use case.

Before I abandon using Gemini for this, can you confirm: Is ~52MB really the maximum file size that can be processed?

Thanks in advance for any clarification on this matter.

@rnckp rnckp added priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue. labels Feb 15, 2025
@bensgoldstein
Copy link

I would also like a response to this inquiry. Is there any work around -- i.e. by sending as images?

@rnckp
Copy link
Author

rnckp commented Feb 20, 2025

As per this issue and the clarification of @pamorgan the max file size is 50MB and 300 pages at the moment.

The service currently only supports pdf file of size 50MB or less and 300 pages or less.
We will treat this issue as a missing documentation and will open an internal feature request to increase the supported pdf file size.

@rnckp rnckp closed this as completed Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p3 Desirable enhancement or fix. May not be included in next release. type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

2 participants