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:
@@ -51,6 +51,9 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
|||||||
'qwen3-max',
|
'qwen3-max',
|
||||||
],
|
],
|
||||||
OpenAI: [
|
OpenAI: [
|
||||||
|
'gpt-5.6-sol',
|
||||||
|
'gpt-5.6-terra',
|
||||||
|
'gpt-5.6-luna',
|
||||||
'gpt-5.5',
|
'gpt-5.5',
|
||||||
'gpt-5.4',
|
'gpt-5.4',
|
||||||
'gpt-5.4-mini',
|
'gpt-5.4-mini',
|
||||||
@@ -80,7 +83,8 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
|||||||
'claude-haiku-4-5',
|
'claude-haiku-4-5',
|
||||||
],
|
],
|
||||||
MiniMax: ['MiniMax-M3', 'MiniMax-M2.7', 'MiniMax-M2.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'],
|
MoonshotAI: ['kimi-k2.7-code', 'kimi-k2.6', 'kimi-k2.5'],
|
||||||
'Z.AI': ['glm-5.2', 'glm-5.1', 'glm-5', 'glm-4.7'],
|
'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',
|
Anthropic: 'anthropic',
|
||||||
MiniMax: 'minimax',
|
MiniMax: 'minimax',
|
||||||
xAI: 'x-ai',
|
xAI: 'x-ai',
|
||||||
|
Tencent: 'tencent',
|
||||||
MoonshotAI: 'moonshotai',
|
MoonshotAI: 'moonshotai',
|
||||||
'Z.AI': 'z-ai',
|
'Z.AI': 'z-ai',
|
||||||
}
|
}
|
||||||
@@ -107,7 +112,7 @@ const OPENROUTER_VENDOR_SLUG: Record<string, string> = {
|
|||||||
* `<vendor-slug>/<lowercased-name>` heuristic — dated snapshots, "-preview"
|
* `<vendor-slug>/<lowercased-name>` heuristic — dated snapshots, "-preview"
|
||||||
* suffixes, "v"-prefixed versions, or dots instead of hyphens in the
|
* suffixes, "v"-prefixed versions, or dots instead of hyphens in the
|
||||||
* version number. Verified against `GET https://openrouter.ai/api/v1/models`
|
* 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> = {
|
const OPENROUTER_ID_OVERRIDES: Record<string, string> = {
|
||||||
'qwen3.6-max': 'qwen/qwen3.6-max-preview',
|
'qwen3.6-max': 'qwen/qwen3.6-max-preview',
|
||||||
|
|||||||
@@ -62,17 +62,26 @@ export function modelPatch(body: Record<string, any>, baseURL?: string) {
|
|||||||
if (modelName.startsWith('gpt')) {
|
if (modelName.startsWith('gpt')) {
|
||||||
if (modelName.startsWith('gpt-5')) {
|
if (modelName.startsWith('gpt-5')) {
|
||||||
body.verbosity = 'low'
|
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')) {
|
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.reasoning_effort
|
||||||
delete body.temperature
|
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' }
|
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 (modelName.startsWith('grok')) {
|
||||||
if (/^grok-4-?3/.test(modelName)) {
|
if (/^grok-4-?3/.test(modelName)) {
|
||||||
debug('Patch Grok 4.3: reasoning_effort=none')
|
debug('Patch Grok 4.3: reasoning_effort=none')
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
|||||||
// 'qwen3-coder-next', // low success rate
|
// 'qwen3-coder-next', // low success rate
|
||||||
],
|
],
|
||||||
OpenAI: [
|
OpenAI: [
|
||||||
|
'gpt-5.6-sol',
|
||||||
|
'gpt-5.6-terra',
|
||||||
|
'gpt-5.6-luna',
|
||||||
'gpt-5.5',
|
'gpt-5.5',
|
||||||
'gpt-5.4',
|
'gpt-5.4',
|
||||||
'gpt-5.4-mini',
|
'gpt-5.4-mini',
|
||||||
@@ -63,7 +66,8 @@ const MODEL_GROUPS: Record<string, string[]> = {
|
|||||||
'MiniMax-M2.7',
|
'MiniMax-M2.7',
|
||||||
'MiniMax-M2.5',
|
'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'],
|
MoonshotAI: ['kimi-k2.7-code', 'kimi-k2.6', 'kimi-k2.5'],
|
||||||
'Z.AI': ['glm-5.2', 'glm-5.1', 'glm-5', 'glm-4.7'],
|
'Z.AI': ['glm-5.2', 'glm-5.1', 'glm-5', 'glm-4.7'],
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user