Skip to content

feat(ai): a second Groq link, on its own meter - #1012

Merged
catomean merged 1 commit into
mainfrom
feat/second-groq-meter
Sep 13, 2026
Merged

feat(ai): a second Groq link, on its own meter#1012
catomean merged 1 commit into
mainfrom
feat/second-groq-meter

Conversation

@catomean

Copy link
Copy Markdown
Collaborator

The standing rule in this codebase is that a same-vendor fallback is not one — a second model at the same vendor draws on the same daily budget, so it's already dead when that budget is spent.

Groq measurably does not work that way. Read from response headers on one key, within the same minute:

model requests remaining
openai/gpt-oss-20b 591 / 1000 ← what production runs
openai/gpt-oss-120b 999 / 1000
qwen/qwen3.8-27b 999 / 1000

Separate counters, and separate 8000-token minutes. So a second Groq model draws on a budget the first one cannot spend. That's real headroom, not a longer queue for the same allowance.

It matters most exactly when it's reached: the vendor after Groq is OpenRouter's free tier, and that tier was answering every model with Rate limit exceeded: free-models-per-day the same afternoon — 50 requests/day without credits. Leaving Groq early is expensive right now.

Chosen by probe, not by spec sheet — and that changed the answer

groq/compound-mini advertises 70,000 TPM, nearly nine times the others, and was the obvious pick for Cat's prompt, which the 8000 TPM window squeezes. It answers:

`tool calling` is not supported with this model

Cat drives a tool loop, so all of that headroom is unreachable. qwen/qwen3.8-27b returned a native tool_call for a real function definition, which is the bar. It was already in GROQ_TPM_LIMIT_BY_MODEL at 8000, so the pre-flight sizes it correctly with no guess.

The pair is de-duplicated, so setting PLATFORM_GROQ_FALLBACK_MODEL to the primary's id disables the second link with an env var and no deploy.

Verified by mutation

Each reverted separately, control green:

Mutation Result
Only the primary pushed (feature removed) 1 test fails
Fallback points at the same model 2 tests fail
De-duplication dropped 1 test fails
(control) 7 pass

One of the seven tests was decoration on the first pass — it asserted an inline copy of the de-duplication rule and would have passed with the feature deleted. It now re-imports the module under a changed env and checks the chain it actually builds.

2962 unit tests pass (7 new), type-check, lint and file-size checks clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HJRuvHJEBd8t7iRA9Sb1iw

The standing rule in this codebase is that a same-vendor fallback is not one — a
second model at the same vendor draws on the same daily budget, so it is already
dead when that budget is spent. Groq measurably does NOT work that way. Read
from response headers on one key, within the same minute, 2026-09-13:

    openai/gpt-oss-20b    591 / 1000 requests remaining   (what production runs)
    openai/gpt-oss-120b   999 / 1000
    qwen/qwen3.8-27b      999 / 1000

Separate counters, and separate 8000-token minutes. So a second Groq model draws
on a budget the first one cannot spend. That is real headroom, not a longer
queue for the same allowance.

It matters most exactly when it is reached. The vendor after Groq is
OpenRouter's free tier, and that tier was answering every model with "Rate limit
exceeded: free-models-per-day" the same afternoon — the allowance is 50 requests
a day without credits. Leaving Groq early is expensive right now.

CHOSEN BY PROBE, NOT BY SPEC SHEET, and that changed the answer.
`groq/compound-mini` advertises 70000 TPM — nearly nine times the others, and
the obvious pick for Cat's prompt, which the 8000 TPM window squeezes. It
answers:

    `tool calling` is not supported with this model

Cat drives a tool loop, so all of that headroom is unreachable.
`qwen/qwen3.8-27b` returned a native tool_call for a real function definition,
which is the bar. It was already in GROQ_TPM_LIMIT_BY_MODEL at 8000, so the
pre-flight sizes it correctly with no guess.

The pair is de-duplicated, so setting PLATFORM_GROQ_FALLBACK_MODEL to the
primary's id disables the second link with an env var and no deploy.

Verified by mutation, each reverted separately with the control green:
  only the primary pushed (feature removed) -> 1 test fails
  fallback points at the same model         -> 2 tests fail
  de-duplication dropped                    -> 1 test fails

One of the seven tests was decoration on the first pass — it asserted an inline
copy of the de-duplication rule and would have passed with the feature deleted.
It now re-imports the module under a changed env and checks the chain it
actually builds.

2962 unit tests pass (7 new), type-check, lint and file sizes clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HJRuvHJEBd8t7iRA9Sb1iw
@catomean
catomean merged commit 7268f94 into main Sep 13, 2026
6 checks passed
@catomean
catomean deleted the feat/second-groq-meter branch September 13, 2026 14:10
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.

1 participant