Skip to content

Fix Groq rate-limit handling: track TPD, fail fast on daily caps, replace deprecated llama-3.3-70b - #37

Merged
sadacca merged 1 commit into
mainfrom
claude/groq-rate-limits-llama3-syv0w3
Jun 25, 2026
Merged

Fix Groq rate-limit handling: track TPD, fail fast on daily caps, replace deprecated llama-3.3-70b#37
sadacca merged 1 commit into
mainfrom
claude/groq-rate-limits-llama3-syv0w3

Conversation

@sadacca

@sadacca sadacca commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Groq tightened its free tier and deprecated llama-3.3-70b-versatile /
llama-3.1-8b-instant for the free/dev tier on 2026-06-17. Per-model RPD
dropped from the 14,400 this codebase assumed to ~1,000, and Pass 2's
full-article prompts now trip Groq's tokens-per-day cap (100K for
llama-3.3-70b-versatile) after only a handful of articles — well before
RPD-based call counting would notice anything wrong.

  • Track actual token usage per model/day (parsed from each provider's
    usage field) alongside call counts, and add MODEL_TPD_LIMITS so
    select_from_chain() can route around a TPD-exhausted model, not just
    an RPD-exhausted one.
  • call_llm now reads the Retry-After header on 429s: a short wait gets
    a sleep-and-retry, but a long or missing Retry-After (the signature
    of a daily cap, not a per-minute throttle) fails fast instead of
    burning the whole retry budget on a model that won't recover today.
  • Pass 2 (evaluate_article) now fails over to the next EVAL_CHAIN model
    mid-article on a 429, matching the pattern Pass 4's judge chain
    already used, instead of failing the whole article.
  • EVAL_MODEL/EVAL_CHAIN default to groq/gpt-oss-120b (Groq's recommended
    replacement, 200K TPD) ahead of the deprecated llama-3.3-70b-versatile,
    which is kept only as a fallback.

Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01LBCHvm3HjoWbd1P7NuoZbN

…lace deprecated llama-3.3-70b

Groq tightened its free tier and deprecated llama-3.3-70b-versatile /
llama-3.1-8b-instant for the free/dev tier on 2026-06-17. Per-model RPD
dropped from the 14,400 this codebase assumed to ~1,000, and Pass 2's
full-article prompts now trip Groq's tokens-per-day cap (100K for
llama-3.3-70b-versatile) after only a handful of articles — well before
RPD-based call counting would notice anything wrong.

- Track actual token usage per model/day (parsed from each provider's
  usage field) alongside call counts, and add MODEL_TPD_LIMITS so
  select_from_chain() can route around a TPD-exhausted model, not just
  an RPD-exhausted one.
- call_llm now reads the Retry-After header on 429s: a short wait gets
  a sleep-and-retry, but a long or missing Retry-After (the signature
  of a daily cap, not a per-minute throttle) fails fast instead of
  burning the whole retry budget on a model that won't recover today.
- Pass 2 (evaluate_article) now fails over to the next EVAL_CHAIN model
  mid-article on a 429, matching the pattern Pass 4's judge chain
  already used, instead of failing the whole article.
- EVAL_MODEL/EVAL_CHAIN default to groq/gpt-oss-120b (Groq's recommended
  replacement, 200K TPD) ahead of the deprecated llama-3.3-70b-versatile,
  which is kept only as a fallback.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LBCHvm3HjoWbd1P7NuoZbN
@sadacca
sadacca merged commit 276e4a0 into main Jun 25, 2026
1 check 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