Hello everyone,
I am running a heavy data extraction pipeline in a production environment using a Paid API Key (Pay-As-You-Go).
My workflow processes scanned PDF documents page-by-page using a two-step system:
- Step 1 (OCR): Image $\rightarrow$ Text (Markdown format).
- Step 2 (QA Parsing): Markdown $\rightarrow$ Structured Question-Answer JSON output.
The Issue
This system was running perfectly with 99.9% accuracy using the gemini-3-flash-preview model. However, within the last 48 hours, the pipeline stopped working completely, throwing various API failures.
Additionally, fallback configurations targeting other models are immediately crashing with 404 NOT_FOUND errors.
Error Logs Excerpts
2026-06-18 18:07:54,909 | WARNING | Gemini [gemini-2.0-flash-lite] failed structured_ocr p1: 404 NOT_FOUND.
This model (models/gemini-2.0-flash-lite) is no longer available.
2026-06-18 18:07:56,548 | WARNING | Gemini [gemini-2.0-flash] failed structured_ocr p1: 404 NOT_FOUND.
This model (models/gemini-2.0-flash) is no longer available.
2026-06-19 10:59:10,121 | WARNING | [gemini-2.5-flash] truncated (MAX_TOKENS) — trying next model
Payload Statistics Per Page Request:
- Average Input Tokens: 17,785 to 21,205 tokens
- Average Output Tokens: 10,041 to 13,541 tokens
My Questions for the Community/Google Team:
- Model Recommendations: Since
gemini-3-flash-previewand the 2.0-flash stable variants appear entirely deprecated or modified, what is the officially recommended, stable production model for high-accuracy vision OCR $\rightarrow$ JSON processing? - Output Token Truncation: Why does
gemini-2.5-flashthrow aMAX_TOKENStruncation warning at only ~5,862 tokens when it is documented to support a much larger output capacity? - Migration and Cost Lifecycle: To keep processing costs low while managing a production budget, should I upgrade directly to
gemini-3.5-flash, or switch to a variant likegemini-2.5-flash-image? Are there upcoming deprecation timelines for the 2.5 series I should plan around?
Any insight, guidance, or recommended configuration changes from the engineering team or fellow developers would be greatly appreciated. Thank you!