Repository navigation
Port Franklin's free-models module; drop hard-coded dead free ids - #27
Merged
Merged
Conversation
… ids
Franklin-Trading still hard-coded free ids that left the gateway catalog
in the 2026-08-30 pool rotation (nemotron-nano-9b-v2, nemotron-nano-12b-v2-vl,
mistral-nemotron) and earlier (qwen3-coder-480b, llama-4-maverick) across
~15 call sites. The gateway answered for them with a substitute, so the
fork never got the model it named.
- Add src/free-models.ts + free-models.constants.ts from Franklin
(FREE_DEFAULT_MODEL, FREE_PREFERENCE_ORDER, freeChain, isFreeModelId,
freeVisionModel, FREE_POOL_CONTEXT_FLOOR). isFreeModelId reads the live
gateway cache plus the static sets; the fork has no model-catalog dep.
- Replace the literals in subagent, moa, evaluator, verification,
turn-analyzer, compact, llm, media-router, brain/extract,
learnings/extractor, telegram, proxy fallback, plugin-sdk workflow and
the picker with the shared default / chain.
- router: free profile, getFallbackChain and pickFreeFallback use the
live free chain; quarantine list comes from free-models; the tier
classifier follows FREE_DEFAULT_MODEL with a budget a reasoning model can
answer inside, and reads the last tier word.
- vision: no free id is promised vision by default (nano-12b-v2-vl left
the catalog; nano-omni is refused images on /v1/messages). A free model
is never swapped to a paid vision sibling in the loop or the proxy, and
a free proxy request never falls back to a paid rung.
- isFreeModelId replaces the startsWith('nvidia/') heuristic in the
subagent spend gate, /model paid warning and compaction picker.
- The analyzer and media-router budgets are raised for reasoning models.
- nvidia/deepseek-v4-flash and nvidia/deepseek-v4-pro are not in any free
set or routing order (both 400 at the gateway).
- tests: free routing pins updated; new guards that no runtime default
names a retired free 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.
What changed
This ports Franklin's
src/free-models.tsandsrc/free-models.constants.tsand removes the free model ids this fork still had hard-coded across about 15 call sites. Those ids left the gateway catalog:nemotron-nano-9b-v2,nemotron-nano-12b-v2-vlandmistral-nemotronin the 2026-08-30 pool rotation, andqwen3-coder-480bandllama-4-maverickearlier. The gateway answered for them with a substitute, so these calls never got the model they named.FREE_DEFAULT_MODEL,FREE_PREFERENCE_ORDER,freeChain,isFreeModelId,freeVisionModelandFREE_POOL_CONTEXT_FLOOR, matching Franklin.isFreeModelIdreads the live gateway cache plus the static lists, because this fork has no@blockrun/model-catalogdependency.FREE_DEFAULT_MODELfor existing importers.getFallbackChain('free')andpickFreeFallbacknow use the live free chain, filtered by the runtime kill-switch. The chain no longer differs by category.FREE_DEFAULT_MODELwith a token budget a reasoning model can finish in, and parses the last tier word on the last line.nano-12b-v2-vlis gone, and the gateway refuses images fornano-omnion/v1/messages.isFreeModelIdreplaces thestartsWith('nvidia/')check in the subagent spend gate, the/modelpaid warning, compaction andisWeakModel.tokens.ts: live free ids are sized toFREE_POOL_CONTEXT_FLOOR, as in Franklin.nvidia/deepseek-v4-flashandnvidia/deepseek-v4-proare in no free set or routing order, and a test pins this.src/names a retired free id.Checks
npm test: 393/393 pass.npx tsc --noEmitclean,node dist/index.js --helpOK, brand-numbers check up to date.No version bump, no release.