Repository navigation
feat(ai-gateway): apply free-model rate limit to kilo-auto/free - #2945
Merged
Merged
Conversation
The 200/hour free-model rate limit is gated by isKiloExclusiveFreeModel, which only matches a curated allow-list of Kilo-exclusive models. When a request resolves through kilo-auto/free, the resolved model can be any OpenRouter :free model from the rotation pool (e.g. inclusionai/ling-2.6-1t:free, nvidia/nemotron-3-super-120b-a12b:free) — those bypass the gate today, so the limit applies non-uniformly across the auto/free pool. Treat any incoming kilo-auto/free request as rate-limit-eligible regardless of which underlying model the resolver picks, so usage of the auto/free virtual model is bounded the same way direct calls to Kilo-exclusive free models already are.
Contributor
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (1 files)
Reviewed by gpt-5.5-2026-04-23 · 227,903 tokens |
kilo-code-bot
Bot
force-pushed
the
feat/rate-limit-kilo-auto-free
branch
from
April 30, 2026 06:00
f9b41bc to
59f4165
Compare
chrarnoldus
reviewed
Apr 30, 2026
chrarnoldus
approved these changes
Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Auto Free is a mix of models, some Kilo Exclusive and others via OpenRouters. Since this is a mix of models, we should also apply the rate limit to ensure that there is sufficient quota to provide a good experience for all users.
Verification
kilo-auto/freeresolving toinclusionai/ling-2.6-1t:free— request logged tofree_model_usagekilo-auto/freeresolving tonvidia/nemotron-3-super-120b-a12b:free— request logged tofree_model_usagekilo-auto/freeresolving tostepfun/step-3.5-flash:free— request logged (existing behavior preserved)kilo-auto/freerequest returns HTTP 429inclusionai/ling-2.6-1t:free(not viakilo-auto/free) — NOT logged, NOT rate-limited (existing behavior preserved)stepfun/step-3.5-flash:freefrom saturated IP — HTTP 429 (existing behavior preserved)Visual Changes
N/A
Reviewer Notes
isRateLimitedFreeModelRequestchecks bothisKiloExclusiveFreeModel(resolvedModel)andautoModel === KILO_AUTO_FREE_MODEL.id, so the original virtual model ID is what triggers the broader gate.free_model_usagetable records the resolved model slug (notkilo-auto/free), consistent with existing logging behavior./admin/rate-limit-testing) can be used to trigger the 429 threshold manually.