Repository navigation
fix(router): free tier follows the gateway's free cascade - #44
Merged
Merged
Conversation
available:false in /v1/models is the gateway's per-instance free-health breaker (isFreeModelUsable), not a delisting, and the gateway already reroutes a breaker-open free model along its ladder (super-120b -> nano-omni -> llama-3.2-11b-vision). Free tiers now name the Python SDK's FREE_TIERS primaries instead of hard-pinning llama-3.2-11b-vision. Hidden ids (nemotron-3-super-120b, kimi-k2.x) stay out. The live catalog test logs, rather than fails, on a breaker-open routed id.
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.
Why
#43 pinned all four Free tiers to
nvidia/llama-3.2-11b-vision, because every other free id showedavailable: false. That flag is not a delisting./v1/modelssets it toisFreeModelUsable(model.id)(blockrunsrc/app/api/v1/models/route.ts:59), which is the gateway's per-instance free-health circuit breaker (src/lib/free-health.ts). It flips between instances and recovers by itself.The gateway already handles fallback
The Go router has no per-request fallback, and adding one would only stack waits on top of the gateway's own.
FREE_RESCUE_LADDER(chat/completions/route.ts~1811,pickFreeRescue).nemotron-3-super-120b→nemotron-3-nano-omni-30b-a3b-reasoning→llama-3.2-11b-visionwithin a 90s budget (route.ts:394/422/452/465, 3463+).nemotron-3.5-lightningcame backx-health-reroute: trueandx-served-model: nvidia/nemotron-3-super-120b. A request fornano-omnicame back served bynvidia/llama-3.2-11b-vision.Pinning a primary is therefore safe, and the gateway's ladder supplies the fallbacks, ending at llama-3.2-11b-vision.
Free table
router-core (ae6990f) has no free profile; its only free rungs are the eco SIMPLE head. This table mirrors the sibling SDK's free profile,
blockrun-llmrouter_adapter.pyFREE_TIERS(a5af583):nvidia/nemotron-3-nano-omni-30b-a3b-reasoningnvidia/nemotron-3.5-lightningnvidia/nemotron-3.5-lightningnvidia/nemotron-3.5-lightningThe fix from #43 for hidden ids stays:
nvidia/nemotron-3-super-120b(hidden:true in models.ts; it is a gateway-internal cascade rung) andmoonshot/kimi-k2.xremain in the retired-id test, and Eco/Auto Simple are unchanged.Other changes
TestRoutingTableAvoidsRetiredIDsno longer lists ids whose only problem isavailable: false.Checks
go build ./...: okgo vet ./...: okgo test ./...: okBLOCKRUN_LIVE_CATALOG=1 go test -run 'TestRoutingTable|TestReadme|TestFreeRouting' .: ok. It logged that all four free primaries are breaker-open right now, which the gateway reroutes.Known limitation
When the gateway reroutes,
SmartChatResponse.Modelstill names the requested primary rather than the model that served the call. The served model is reported in thex-served-modelheader and the responsemodelfield.