feat(models): route normal to GLM 5.3 Flash, complex to gpt-5.4 - #268
Open
winlp4ever wants to merge 4 commits into
Open
feat(models): route normal to GLM 5.3 Flash, complex to gpt-5.4#268winlp4ever wants to merge 4 commits into
winlp4ever wants to merge 4 commits into
Conversation
Auto routing picks the first model of a tier in models.yml order whose provider
key is present, so the tier defaults had drifted to gpt-5.4-mini (normal) and
gpt-5.5 (complex). Restore the intended routing via catalog order:
- Add glm-5.3-flash (lite) as the first entry so normal complexity resolves to
GLM 5.3 Flash on OpenRouter (also backs the complexity classifier). It's
OpenRouter-only, so without an OpenRouter key lite falls through to gpt-5.4-mini.
- Make gpt-5.4 the first pro entry so complex resolves to it (native OpenAI, or
its OpenRouter route for OpenRouter-only keys).
- Replace glm-5.2 with glm-5.3 (pro, picker / pro fallback) and drop glm-5.1.
Config-only: the classifier and both auto paths already read
default_resolved("lite"|"pro"). Bump the glm-5.2 example refs in test_catalog to
glm-5.3.
Placing glm-5.3-flash as the first catalog entry made default_resolved(None) (the no-tier fallback for unreachable configured models) resolve to a lite model instead of a pro one. Make gpt-5.4 the first entry so the no-tier fallback stays strong, and move glm-5.3-flash to be the first lite entry (still the normal/base default). Also refresh the stale glm-5.2 examples in model_enum to glm-5.3.
The blank-field BYOK fallback for OpenRouter was openai/gpt-5.4; point it at z-ai/glm-5.3-flash:nitro so a signed-out OpenRouter BYOK user who doesn't pick a model lands on the same base model the managed path uses. OpenAI stays gpt-5.4. Update the matching model-field placeholder to match.
This was referenced Sep 2, 2026
winlp4ever
added a commit
that referenced
this pull request
Sep 4, 2026
…s-120b (#272) * feat(models): route normal to DeepSeek V4 Flash, classifier to gpt-oss-120b Alternative to the GLM base (#268), which regressed: GLM 5.3 Flash via OpenRouter did not emit real tool_calls and was too slow for the 2s classifier timeout. - Make deepseek-v4-flash the first lite entry so normal complexity resolves to it on OpenRouter (falls through to gpt-5.4-mini with no OpenRouter key). It tests clean for tool calling. - Pin the complexity classifier to gpt-oss-120b (cheap, fast, native structured output) via a new catalog.resolved_by_id, decoupled from the base model. Bump AUTO_MODEL_TIMEOUT_SECONDS 2 -> 5 for OpenRouter first-token latency headroom. - gpt-5.5 stays first overall, so the no-tier fallback and the complex/pro default are unchanged (5.5 > 5.4). * fix(models): give gpt-oss-120b the :nitro throughput route gpt-oss is OpenAI-branded but open-weight and multi-provider on OpenRouter, so :nitro routes the classifier to the fastest provider (it isn't single-provider like proprietary openai/* models). Refine the nitro-rule tests to treat gpt-oss as multi-provider so it requires :nitro rather than forbidding it. * fix(agent): tighten classifier timeout to 3s on the hot path
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
Auto model routing (
model: "auto"on/ai/*and the server agent) had drifted: it resolves to the first model of a tier inmodels.ymlorder with a present provider key, which today meant normal complexity usedgpt-5.4-miniand complex usedgpt-5.5. This restores the intended routing:How
Config-only, via catalog order (the resolver picks the first reachable model of a tier):
glm-5.3-flash(tierlite) as the first llm entry.gpt-5.4the firstproentry.glm-5.2withglm-5.3(pro; a high-value picker / pro fallback) and dropglm-5.1.No code change to the classifier or the two auto paths - they already read
default_resolved("lite" | "pro").BYOK fallback (free, from the resolver)
gpt-5.4-mini.gpt-5.4has both an OpenAI and an OpenRouter route, so complex resolves for either key.Test plan
ruff check topix test/unit: cleanpytest test/unit: 704 passed (bumped theglm-5.2example refs intest_catalogtoglm-5.3; integrity + tier-default tests already pass structurally)Follow-up (not in this PR)
The
auto_model.pyclassifier logs a full traceback when the message list doesn't end with a user turn (tool-loop continuations). It falls back tomediumsafely; the noise fix is a separate change.