Skip to content

fix: cache yolox model in docker build to prevent 429 cloud run errors#4405

Open
MansiDakhale wants to merge 1 commit into
Unstructured-IO:mainfrom
MansiDakhale:fix/cloud-run-429-yolo
Open

fix: cache yolox model in docker build to prevent 429 cloud run errors#4405
MansiDakhale wants to merge 1 commit into
Unstructured-IO:mainfrom
MansiDakhale:fix/cloud-run-429-yolo

Conversation

@MansiDakhale

@MansiDakhale MansiDakhale commented Jul 15, 2026

Copy link
Copy Markdown

Description
This PR resolves a deployment bottleneck where 429 Too Many Requests errors occur on Google Cloud Run when multiple container instances simultaneously attempt to download the yolox model weights at runtime.

The Fix:
I shifted the model download left into the build phase. By caching the yolox model during the Dockerfile build (alongside spaCy and TableTransformer), the model weights are now baked directly into the container image. This eliminates network dependencies at runtime and prevents rate-limiting crashes.

Related Issue
Closes #4110

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Shadow auto-approve: would auto-approve. Pre-caches the yolox model in the Docker build to prevent runtime 429 errors. Bounded, beneficial build optimization; no behavioral, contract, or operational tradeoff needing human judgment.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

429 “Too Many Requests” error when Unstructured downloads YOLO layout model on Google Cloud Run

1 participant