Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ file is the human-readable summary of what changed and why.

### Gateway

- **GLM-5.3-Flash gets its served window** — the model is served with the same
262,144-token window as MiniMax-M3, so it now has its own entry in the
built-in table instead of falling back to the safe 200K default. Signing in
(or re-running a configure flow) writes it the same context gauge and
compaction trigger the other large model gets; already-written configs are
not rewritten.
- **The SSO provider is now AIGW** — signing in with SSO writes the gateway
provider as `aigw`, shown as "AIGW" in the model picker, replacing the
previous identity. Existing installs keep working: the old provider id stays
Expand Down
11 changes: 6 additions & 5 deletions packages/codev-gateway/src/model-limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ export const COMPACT_RESERVED = 40000
export const COMPACT_PCT = 90

// Known gateway models' context windows, keyed by the exact id `/v1/models`
// reports. M3's window is capped at 262144 on the current deployment (the
// model supports more, the gateway's resources don't). The 200K sibling is
// deliberately absent: DEFAULT_WINDOW already describes it, and an entry
// restating the default is one more thing to keep in sync.
// reports. M3's and GLM-5.3-Flash's windows are capped at 262144 on the current
// deployment (the models support more, the gateway's resources don't). Models
// served at the 200K default are deliberately absent: DEFAULT_WINDOW already
// describes them, and an entry restating the default is one more thing to keep
// in sync.
const TABLE: Record<string, number> = {
"MiniMax/MiniMax-M3": 262144,
"zai-org/GLM-4.7-cc": 200000,
"zai-org/GLM-5.3-Flash": 262144,
}

// Unrecognized models are treated as 200K-class: it matches the smaller of the
Expand Down
18 changes: 10 additions & 8 deletions packages/codev-gateway/test/config-block.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,18 @@ describe("buildGatewayConfig", () => {
})
})

// The per-model table: M3's 262144-token window (capped by the deployment,
// The per-model table: the 262144-token window (capped by the deployment,
// not the model). Its 90% trigger + the 40000 reserve exceeds the window,
// so declaredInput's clamp pins input at the window itself.
test("writes the table window for the known model", () => {
const config = buildGatewayConfig({ baseUrl: "https://gw.test", model: "MiniMax/MiniMax-M3" })
expect(config.provider.aigw.models["MiniMax/MiniMax-M3"].limit).toEqual({
context: 262144,
input: 262144,
output: 65536,
})
test("writes the table window for the known models", () => {
for (const id of ["MiniMax/MiniMax-M3", "zai-org/GLM-5.3-Flash"]) {
const config = buildGatewayConfig({ baseUrl: "https://gw.test", model: id })
expect(config.provider.aigw.models[id].limit).toEqual({
context: 262144,
input: 262144,
output: 65536,
})
}
})

// Without the declaration a custom-provider model resolves to text-only and
Expand Down
2 changes: 1 addition & 1 deletion packages/codev-gateway/test/model-limits.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ describe("limitsFor", () => {
test("resolves the table's known models and defaults the rest", () => {
// Triggers are always 90% of the window, whatever its source.
expect(limitsFor("MiniMax/MiniMax-M3")).toEqual({ context: 262144, trigger: 235930 })
expect(limitsFor("zai-org/GLM-4.7-cc")).toEqual({ context: 200000, trigger: 180000 })
expect(limitsFor("zai-org/GLM-5.3-Flash")).toEqual({ context: 262144, trigger: 235930 })
expect(limitsFor("anything/else")).toEqual(DEFAULT_LIMITS)
expect(DEFAULT_LIMITS).toEqual({ context: 200000, trigger: 180000 })
})
Expand Down
Loading