Skip to content

fix(deploy): survive Hugging Face 429 rate limits - #74

Merged
dapiced merged 1 commit into
mainfrom
dapiced-llm-prepare-retry
Sep 29, 2026
Merged

dapiced merged 1 commit into
mainfrom
dapiced-llm-prepare-retry

Conversation

@dapiced

@dapiced dapiced commented Sep 29, 2026

Copy link
Copy Markdown
Owner

The deploy failed with HTTP 429 while fetching the model from Hugging Face (shared runner IPs are rate-limited).

  • scripts/fetch-retry.mjs: retries 408/429/5xx and network errors with exponential backoff, honouring Retry-After (capped at 60 s). 404 and other 4xx fail immediately.
  • prepare-llm.mjs: uses the retry helper, sends HF_TOKEN when present, and pauses 0.5 s between files.
  • ci.yml: caches dist/llm keyed on the script's hash, so a normal deploy no longer touches Hugging Face.
  • llm-bench.yml: passes HF_TOKEN as well.
  • Tests: src/lib/fetchRetry.test.ts (6 cases).

HF_TOKEN is optional: add it as a repo secret (read-only HF token) to lift the anonymous limit.

… sharded model, optional HF_TOKEN

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings September 29, 2026 22:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The retry, authentication, caching, and test changes are coherent with no unresolved correctness issues found.

Review effort: Balanced
Findings: None

What changed in this PR

Adds resilient Hugging Face model downloads to reduce deployment failures from shared-runner rate limits.

Changes:

  • Adds retry/backoff handling with Retry-After support and tests.
  • Adds optional authenticated downloads and request throttling.
  • Caches model artifacts in deployment CI.
File Description
scripts/​fetch-retry.mjs Implements retry and backoff behavior.
scripts/​fetch-retry.d.mts Defines retry helper types.
scripts/​prepare-llm.mjs Uses retries, authentication, and throttling.
src/​lib/​fetchRetry.test.ts Tests retry behavior and delays.
.github/​workflows/​ci.yml Caches the sharded deployment model.
.github/​workflows/​llm-bench.yml Supplies optional Hugging Face authentication.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@dapiced
dapiced merged commit 7b95e09 into main Sep 29, 2026
6 checks passed
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.

2 participants