Repository navigation
[AISAGE-729] fix(ai-gateway): apply free model rate limit to all free models - #8312
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change at Verification Notes
Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit afc9896)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit afc9896)Status: No Issues Found | Recommendation: Merge Executive SummaryThe incremental change at Verification Notes
Files Reviewed (2 files)
Previous review (commit 3bd8e58)Status: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe gate switch to Overview
Issue Details (click to expand)SUGGESTION
Files Reviewed (6 files)
Notes: no remaining references to the removed Reviewed by deepseek-v4.1-flash-1017 · Input: 35.9K · Output: 3.4K · Cached: 353.8K Review guidance: REVIEW.md from base branch |
Summary
The
free-model-inferenceVercel Firewall rate limit applied only to Kilo-exclusive models flaggedrate-limited(just free Gemma 4 26B). It now applies to every free model.llm-proxygates the check onisFreeModelExcludingCustomLlmsinstead ofisKiloExclusiveRateLimitedModel. This covers:freemodels,openrouter/free, free stealth alpha models, unpriced Kilo-exclusive models, and models thatkilo-auto/freeresolves to.rate-limitedflag andisKiloExclusiveRateLimitedModel.Background
The limit used to be broader. Until #4994 (
fix(ai-gateway): scope model rate limits by flag, Aug 4) it covered every enabled Kilo-exclusive free model, pluskilo-auto/free(#2945) and experimented models. #4994 narrowed it to models flaggedrate-limited, which was only free Gemma. This PR goes further than the pre-#4994 scope: it also covers OpenRouter:freemodels, which were never rate limited.Behavior changes to note
ip:<ip>, oruser:<id>for server-side products on Cloudflare IPs). Check that the firewall rule's window and limit fit the higher combined free-model traffic before merging.Verification
jestforllm-proxy.test.ts,models.test.ts,free-model-rate-limit.test.ts: 171 passedpnpm --filter @kilocode/web-shared typecheck: passedoxlintandoxfmton changed files: clean