Skip to content

Commit 4d6f474

Browse files
authored
fix(qoder): allow dynamic model cache validation
Closes #103 Validation: - go test ./internal/runtime/executor ./internal/auth/qoder ./internal/registry - go build -o /tmp/cli-proxy-api-plus-pr104-rebased ./cmd/server - go test ./...
1 parent f475684 commit 4d6f474

3 files changed

Lines changed: 115 additions & 45 deletions

File tree

internal/auth/qoder/api.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,13 @@ var ModelMap = map[string]string{
4040
"efficient": "efficient",
4141
"lite": "lite",
4242
// Frontier models — pin a specific backing model
43-
"qmodel": "qmodel", // Qwen 3.6 Plus
44-
"dmodel": "dmodel", // DeepSeek V4 Pro
45-
"dfmodel": "dfmodel", // DeepSeek V4 Flash
46-
"gm51model": "gm51model", // GLM 5.1
47-
"kmodel": "kmodel", // Kimi K2.6
48-
"mmodel": "mmodel", // MiniMax M2.7
43+
"qmodel": "qmodel", // Qwen3.7 Plus
44+
"qmodel_latest": "qmodel_latest", // Qwen3.7 Max (latest)
45+
"dmodel": "dmodel", // DeepSeek V4 Pro
46+
"dfmodel": "dfmodel", // DeepSeek V4 Flash
47+
"gm51model": "gm51model", // GLM 5.1
48+
"kmodel": "kmodel", // Kimi K2.6
49+
"mmodel": "mmodel", // MiniMax M3
4950
}
5051

5152
// doRefreshToken performs a token refresh and persists the result to authFilePath.

internal/registry/models/models.json

Lines changed: 106 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2010,7 +2010,6 @@
20102010
]
20112011
}
20122012
}
2013-
20142013
],
20152014
"xai": [
20162015
{
@@ -2165,8 +2164,11 @@
21652164
"type": "qoder",
21662165
"display_name": "Qoder Auto",
21672166
"description": "Qoder Auto — automatically selects the best model for your prompt",
2168-
"context_length": 131072,
2169-
"max_completion_tokens": 65536
2167+
"context_length": 180000,
2168+
"supported_input_modalities": [
2169+
"TEXT",
2170+
"IMAGE"
2171+
]
21702172
},
21712173
{
21722174
"id": "qoder/ultimate",
@@ -2176,13 +2178,23 @@
21762178
"type": "qoder",
21772179
"display_name": "Qoder Ultimate",
21782180
"description": "Qoder Ultimate — highest quality tier",
2179-
"context_length": 131072,
2180-
"max_completion_tokens": 65536,
2181+
"context_length": 180000,
2182+
"supported_input_modalities": [
2183+
"TEXT",
2184+
"IMAGE"
2185+
],
21812186
"thinking": {
21822187
"min": 1024,
21832188
"max": 32000,
21842189
"zero_allowed": true,
2185-
"dynamic_allowed": true
2190+
"dynamic_allowed": true,
2191+
"levels": [
2192+
"low",
2193+
"medium",
2194+
"high",
2195+
"max",
2196+
"xhigh"
2197+
]
21862198
}
21872199
},
21882200
{
@@ -2193,13 +2205,23 @@
21932205
"type": "qoder",
21942206
"display_name": "Qoder Performance",
21952207
"description": "Qoder Performance — balanced quality and speed",
2196-
"context_length": 131072,
2197-
"max_completion_tokens": 32768,
2208+
"context_length": 272000,
2209+
"supported_input_modalities": [
2210+
"TEXT",
2211+
"IMAGE"
2212+
],
21982213
"thinking": {
21992214
"min": 1024,
22002215
"max": 32000,
22012216
"zero_allowed": true,
2202-
"dynamic_allowed": true
2217+
"dynamic_allowed": true,
2218+
"levels": [
2219+
"low",
2220+
"medium",
2221+
"high",
2222+
"max",
2223+
"xhigh"
2224+
]
22032225
}
22042226
},
22052227
{
@@ -2210,8 +2232,11 @@
22102232
"type": "qoder",
22112233
"display_name": "Qoder Efficient",
22122234
"description": "Qoder Efficient — cost-efficient tier",
2213-
"context_length": 131072,
2214-
"max_completion_tokens": 16384
2235+
"context_length": 180000,
2236+
"supported_input_modalities": [
2237+
"TEXT",
2238+
"IMAGE"
2239+
]
22152240
},
22162241
{
22172242
"id": "qoder/lite",
@@ -2221,19 +2246,35 @@
22212246
"type": "qoder",
22222247
"display_name": "Qoder Lite",
22232248
"description": "Qoder Lite — fastest and most affordable tier",
2224-
"context_length": 131072,
2225-
"max_completion_tokens": 16384
2249+
"context_length": 180000
22262250
},
22272251
{
22282252
"id": "qoder/qmodel",
22292253
"object": "model",
22302254
"created": 1767196800,
22312255
"owned_by": "qoder",
22322256
"type": "qoder",
2233-
"display_name": "Qwen 3.6 Plus (Qoder)",
2234-
"description": "Qoder frontier — Qwen 3.6 Plus",
2235-
"context_length": 131072,
2236-
"max_completion_tokens": 32768
2257+
"display_name": "Qwen3.7 Plus (Qoder)",
2258+
"description": "Qoder frontier — Qwen3.7 Plus",
2259+
"context_length": 180000,
2260+
"supported_input_modalities": [
2261+
"TEXT",
2262+
"IMAGE"
2263+
]
2264+
},
2265+
{
2266+
"id": "qoder/qmodel_latest",
2267+
"object": "model",
2268+
"created": 1767196800,
2269+
"owned_by": "qoder",
2270+
"type": "qoder",
2271+
"display_name": "Qwen3.7 Max (Qoder)",
2272+
"description": "Qoder frontier — Qwen3.7 Max (latest Qwen)",
2273+
"context_length": 180000,
2274+
"supported_input_modalities": [
2275+
"TEXT",
2276+
"IMAGE"
2277+
]
22372278
},
22382279
{
22392280
"id": "qoder/dmodel",
@@ -2243,13 +2284,20 @@
22432284
"type": "qoder",
22442285
"display_name": "DeepSeek V4 Pro (Qoder)",
22452286
"description": "Qoder frontier — DeepSeek V4 Pro",
2246-
"context_length": 131072,
2247-
"max_completion_tokens": 65536,
2287+
"context_length": 180000,
2288+
"supported_input_modalities": [
2289+
"TEXT",
2290+
"IMAGE"
2291+
],
22482292
"thinking": {
22492293
"min": 1024,
22502294
"max": 32000,
22512295
"zero_allowed": true,
2252-
"dynamic_allowed": true
2296+
"dynamic_allowed": true,
2297+
"levels": [
2298+
"high",
2299+
"max"
2300+
]
22532301
}
22542302
},
22552303
{
@@ -2260,8 +2308,21 @@
22602308
"type": "qoder",
22612309
"display_name": "DeepSeek V4 Flash (Qoder)",
22622310
"description": "Qoder frontier — DeepSeek V4 Flash",
2263-
"context_length": 131072,
2264-
"max_completion_tokens": 16384
2311+
"context_length": 180000,
2312+
"supported_input_modalities": [
2313+
"TEXT",
2314+
"IMAGE"
2315+
],
2316+
"thinking": {
2317+
"min": 1024,
2318+
"max": 32000,
2319+
"zero_allowed": true,
2320+
"dynamic_allowed": true,
2321+
"levels": [
2322+
"high",
2323+
"max"
2324+
]
2325+
}
22652326
},
22662327
{
22672328
"id": "qoder/gm51model",
@@ -2271,13 +2332,20 @@
22712332
"type": "qoder",
22722333
"display_name": "GLM 5.1 (Qoder)",
22732334
"description": "Qoder frontier — GLM 5.1",
2274-
"context_length": 131072,
2275-
"max_completion_tokens": 32768,
2335+
"context_length": 180000,
2336+
"supported_input_modalities": [
2337+
"TEXT",
2338+
"IMAGE"
2339+
],
22762340
"thinking": {
22772341
"min": 1024,
22782342
"max": 32000,
22792343
"zero_allowed": true,
2280-
"dynamic_allowed": true
2344+
"dynamic_allowed": true,
2345+
"levels": [
2346+
"high",
2347+
"max"
2348+
]
22812349
}
22822350
},
22832351
{
@@ -2288,25 +2356,25 @@
22882356
"type": "qoder",
22892357
"display_name": "Kimi K2.6 (Qoder)",
22902358
"description": "Qoder frontier — Kimi K2.6",
2291-
"context_length": 131072,
2292-
"max_completion_tokens": 32768,
2293-
"thinking": {
2294-
"min": 1024,
2295-
"max": 32000,
2296-
"zero_allowed": true,
2297-
"dynamic_allowed": true
2298-
}
2359+
"context_length": 256000,
2360+
"supported_input_modalities": [
2361+
"TEXT",
2362+
"IMAGE"
2363+
]
22992364
},
23002365
{
23012366
"id": "qoder/mmodel",
23022367
"object": "model",
23032368
"created": 1767196800,
23042369
"owned_by": "qoder",
23052370
"type": "qoder",
2306-
"display_name": "MiniMax M2.7 (Qoder)",
2307-
"description": "Qoder frontier — MiniMax M2.7",
2308-
"context_length": 131072,
2309-
"max_completion_tokens": 65536
2371+
"display_name": "MiniMax M3 (Qoder)",
2372+
"description": "Qoder frontier — MiniMax M3",
2373+
"context_length": 180000,
2374+
"supported_input_modalities": [
2375+
"TEXT",
2376+
"IMAGE"
2377+
]
23102378
}
23112379
]
2312-
}
2380+
}

internal/runtime/executor/qoder_executor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ func (e *QoderExecutor) ExecuteStream(ctx context.Context, authRecord *cliproxya
7676
qoderModel := strings.TrimPrefix(model, "qoder/")
7777
if mapped, ok := qoderauth.ModelMap[qoderModel]; ok {
7878
qoderModel = mapped
79-
} else {
79+
} else if _, cached := storage.GetModelConfig(qoderModel); !cached {
80+
// Not in static map and not in dynamic model cache — reject early.
8081
return nil, fmt.Errorf("unsupported qoder model: %q (received %q)", qoderModel, model)
8182
}
8283

0 commit comments

Comments
 (0)