Skip to content

feat(models): add Qwen3.7 Max#107

Closed
KillerQueen-Z wants to merge 1 commit into
mainfrom
codex/add-qwen37-max
Closed

feat(models): add Qwen3.7 Max#107
KillerQueen-Z wants to merge 1 commit into
mainfrom
codex/add-qwen37-max

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Collaborator

Summary

  • Add Qwen3.7 Max to Franklin's interactive model picker.
  • Add qwen, qwen3.7-max, and qwen-3.7-max shortcuts.
  • Track the gateway's raw $1.475/$4.425 per-million-token rates; BlockRun applies its standard margin during settlement.

Validation

  • npm run build

VickyXAI pushed a commit that referenced this pull request Jul 20, 2026
Adds the gateway's Qwen flagship — $1.475/$4.425 per 1M tokens, 1M context,
65K max output — to pricing, the /model picker, and the provider grouping.

Rebased onto main (the PR branch predated #105/#106 and would have reverted
Sonnet 5 → 4.6, GPT-5.6 Sol → 5.5, and deleted moonshot/kimi-k3), then
carried through every table keyed on a model id, each of which defaults
silently when an entry is missing:

- Shortcut is `qwen-max`, not bare `qwen`. `qwen` is a long-standing alias
  for the FREE nvidia/qwen3-next default and repointing it at a paid model
  both duplicated an object key (TS1117) and moved users onto paid inference
  without consent. test/local.mjs pins the free aliases at $0.
- MODEL_CONTEXT_WINDOWS: 1M. Without it the generic `qwen` fallback returns
  128k and compacts ~8x too early.
- MODEL_MAX_OUTPUT: 65_536. Without it getMaxOutputTokens() returns the 16K
  default, and the max_tokens recovery path in loop.ts escalates to 65_536
  only to be clamped straight back — truncating long answers and burning
  USDC on continuation calls that can never succeed. Same gap the kimi-k3
  entry above it documents.
- getModelGuidance(): the medium branch's bare `qwen` substring predates paid
  Qwen SKUs and shadowed the strong branch, giving a premium flagship
  guidance tuned for Haiku/Flash. Free nvidia qwen SKUs stay where they were.
- PROVIDER_ORDER / PROVIDER_LABELS: the expanded picker (#106) sorted Qwen
  last under a raw lowercase heading.

Three tests pin the rates, both token tables, the guidance bucket, the paid
aliases, and the free-alias-stays-free guardrail.

Pre-existing gaps found during review, left for follow-up: the proxy's
hardcoded modelCap ladder (src/proxy/server.ts:387) ignores MODEL_MAX_OUTPUT
for every model; 5 picker rows still fall through the 128k context default
and 11 through the 16K output default.
@VickyXAI

Copy link
Copy Markdown
Contributor

Landed on `main` as 33ee250, with your authorship preserved on the commit. Thanks!

The branch was based on a pre-#106 `main`, so it conflicted in both files — and resolving toward the PR side would have reverted `anthropic/claude-sonnet-5` → 4.6, `openai/gpt-5.6-sol` → 5.5, and deleted `moonshot/kimi-k3` from `MODEL_PRICING`. It also had a duplicate `qwen:` key (TS1117 — the build only passed against the stale base).

Changes made while rebasing:

  • Shortcut is qwen-max, not bare qwen. qwen is a long-standing alias for the free nvidia/qwen3-next-80b-a3b-instruct default, and test/local.mjs asserts every free alias estimates to $0. Repointing it at a $1.475/$4.425 model would move users onto paid inference without consent.
  • Added MODEL_CONTEXT_WINDOWS (1M) — the generic qwen fallback in tokens.ts returns 128k, which would compact ~8× too early.
  • Added MODEL_MAX_OUTPUT (65_536) — otherwise getMaxOutputTokens() returns the 16K default and the max_tokens recovery path in loop.ts escalates to 65_536 only to be clamped straight back. Same gap the kimi-k3 entry above it documents.
  • Fixed getModelGuidance() — the medium branch matched a bare qwen substring (written when every qwen id was a free NVIDIA SKU) and shadowed the strong branch, so a premium flagship got guidance tuned for Haiku/Flash.
  • Added the provider to PROVIDER_ORDER / PROVIDER_LABELS — the expanded picker from feat: expand model picker catalog #106 sorted Qwen last under a raw lowercase qwen heading.

Verified qwen/qwen3.7-max against the live gateway catalog: rates, 1M context, and 65536 max output all match. Three tests now pin them; suite is 628 green.

@VickyXAI VickyXAI closed this Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants