feat(llms): update model list and patches (#611)

* fix(llms): gpt patch

* feat(llms): patch `hunyuan` models

* feat(llms): update model list
This commit is contained in:
Simon
2026-07-10 02:08:14 -07:00
committed by GitHub
parent d5c994708c
commit 1cab66b898
3 changed files with 33 additions and 9 deletions
+7 -2
View File
@@ -51,6 +51,9 @@ const MODEL_GROUPS: Record<string, string[]> = {
'qwen3-max',
],
OpenAI: [
'gpt-5.6-sol',
'gpt-5.6-terra',
'gpt-5.6-luna',
'gpt-5.5',
'gpt-5.4',
'gpt-5.4-mini',
@@ -80,7 +83,8 @@ const MODEL_GROUPS: Record<string, string[]> = {
'claude-haiku-4-5',
],
MiniMax: ['MiniMax-M3', 'MiniMax-M2.7', 'MiniMax-M2.5'],
xAI: ['grok-4.3', 'grok-build-0.1'],
xAI: ['grok-4.5', 'grok-4.3', 'grok-build-0.1'],
Tencent: ['hy3'],
MoonshotAI: ['kimi-k2.7-code', 'kimi-k2.6', 'kimi-k2.5'],
'Z.AI': ['glm-5.2', 'glm-5.1', 'glm-5', 'glm-4.7'],
}
@@ -98,6 +102,7 @@ const OPENROUTER_VENDOR_SLUG: Record<string, string> = {
Anthropic: 'anthropic',
MiniMax: 'minimax',
xAI: 'x-ai',
Tencent: 'tencent',
MoonshotAI: 'moonshotai',
'Z.AI': 'z-ai',
}
@@ -107,7 +112,7 @@ const OPENROUTER_VENDOR_SLUG: Record<string, string> = {
* `<vendor-slug>/<lowercased-name>` heuristic — dated snapshots, "-preview"
* suffixes, "v"-prefixed versions, or dots instead of hyphens in the
* version number. Verified against `GET https://openrouter.ai/api/v1/models`
* on 2026-07-03; re-check when models are added to `MODEL_GROUPS`.
* on 2026-07-10; re-check when models are added to `MODEL_GROUPS`.
*/
const OPENROUTER_ID_OVERRIDES: Record<string, string> = {
'qwen3.6-max': 'qwen/qwen3.6-max-preview',
+21 -6
View File
@@ -62,17 +62,26 @@ export function modelPatch(body: Record<string, any>, baseURL?: string) {
if (modelName.startsWith('gpt')) {
if (modelName.startsWith('gpt-5')) {
body.verbosity = 'low'
// gpt-5 gpt-5-mini gpt-5-nano only supports "minimal";
// 5.1+ supports "none".
body.reasoning_effort = /^gpt-5(-|$)/.test(modelName) ? 'minimal' : 'none'
debug(`Patch GPT-5: verbosity=low, reasoning_effort=${body.reasoning_effort}`)
}
// Since gpt-5.4, /chat/completions rejects any explicit reasoning_effort
// when function tools are present. Newer models are expected to follow.
// - gpt-5.1 / gpt-5.2 can fully disable reasoning
// - gpt-5 / -mini / -nano bottom out at "minimal"
// - everything else (gpt-4.x, chat-latest, gpt-5.4+) must not receive it
if (modelName.includes('chat-latest')) {
debug('Omitting reasoning_effort and temperature for chat-latest')
debug('Patch chat-latest: omit reasoning_effort and temperature')
delete body.reasoning_effort
delete body.temperature
} else if (/^gpt-5[12](-|$)/.test(modelName)) {
debug('Patch GPT-5.1/5.2: reasoning_effort=none')
body.reasoning_effort = 'none'
} else if (/^gpt-5(-|$)/.test(modelName)) {
debug('Patch GPT-5: reasoning_effort=minimal')
body.reasoning_effort = 'minimal'
} else {
debug('Patch GPT: omit reasoning_effort')
delete body.reasoning_effort
}
}
@@ -125,6 +134,12 @@ export function modelPatch(body: Record<string, any>, baseURL?: string) {
body.thinking = { type: 'disabled' }
}
if (modelName.startsWith('hy')) {
debug('Patch Hunyuan: disable thinking, reasoning_effort=low')
body.thinking = { type: 'disabled' }
body.reasoning_effort = 'low'
}
if (modelName.startsWith('grok')) {
if (/^grok-4-?3/.test(modelName)) {
debug('Patch Grok 4.3: reasoning_effort=none')
@@ -29,6 +29,9 @@ const MODEL_GROUPS: Record<string, string[]> = {
// 'qwen3-coder-next', // low success rate
],
OpenAI: [
'gpt-5.6-sol',
'gpt-5.6-terra',
'gpt-5.6-luna',
'gpt-5.5',
'gpt-5.4',
'gpt-5.4-mini',
@@ -63,7 +66,8 @@ const MODEL_GROUPS: Record<string, string[]> = {
'MiniMax-M2.7',
'MiniMax-M2.5',
],
xAI: ['grok-4.3', 'grok-build-0.1'],
xAI: ['grok-4.5', 'grok-4.3', 'grok-build-0.1'],
Tencent: ['hy3'],
MoonshotAI: ['kimi-k2.7-code', 'kimi-k2.6', 'kimi-k2.5'],
'Z.AI': ['glm-5.2', 'glm-5.1', 'glm-5', 'glm-4.7'],
}