fix(ai): expose OpenRouter GLM-5.2 xhigh effort

closes #5770
This commit is contained in:
Armin Ronacher
2026-06-20 18:47:42 +02:00
parent 416c673dfe
commit 8597ebafd9
3 changed files with 26 additions and 57 deletions

View File

@@ -8,6 +8,7 @@
### Fixed
- Fixed OpenRouter GLM-5.2 metadata to expose `xhigh` reasoning and send OpenRouter's native `xhigh` effort ([#5770](https://github.com/earendil-works/pi/issues/5770)).
- Fixed GitHub Copilot OAuth model availability to use the authenticated account's model picker catalog ([#5897](https://github.com/earendil-works/pi/issues/5897)).
## [0.79.8] - 2026-06-19

View File

@@ -374,6 +374,9 @@ function applyThinkingLevelMetadata(model: Model<any>): void {
// Pi's low/medium/high pass through verbatim; OpenRouter normalizes to Mercury's vocabulary.
mergeThinkingLevelMap(model, { off: null });
}
if (model.provider === "openrouter" && model.id === "z-ai/glm-5.2") {
mergeThinkingLevelMap(model, { xhigh: "xhigh" });
}
if (model.provider === "opencode-go" && model.id === "kimi-k2.6") {
// OpenCode Go exposes Kimi K2.6 thinking as on/off, not distinct effort tiers.
mergeThinkingLevelMap(model, { minimal: null, low: null, medium: null });

View File

@@ -4851,42 +4851,6 @@ export const MODELS = {
contextWindow: 262144,
maxTokens: 32768,
} satisfies Model<"google-generative-ai">,
"gemma-4-E2B-it": {
id: "gemma-4-E2B-it",
name: "Gemma 4 E2B IT",
api: "google-generative-ai",
provider: "google",
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
reasoning: true,
thinkingLevelMap: {"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"},
input: ["text", "image"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 131072,
maxTokens: 8192,
} satisfies Model<"google-generative-ai">,
"gemma-4-E4B-it": {
id: "gemma-4-E4B-it",
name: "Gemma 4 E4B IT",
api: "google-generative-ai",
provider: "google",
baseUrl: "https://generativelanguage.googleapis.com/v1beta",
reasoning: true,
thinkingLevelMap: {"off":null,"minimal":"MINIMAL","low":null,"medium":null,"high":"HIGH"},
input: ["text", "image"],
cost: {
input: 0,
output: 0,
cacheRead: 0,
cacheWrite: 0,
},
contextWindow: 131072,
maxTokens: 8192,
} satisfies Model<"google-generative-ai">,
},
"google-vertex": {
"gemini-2.5-flash": {
@@ -9190,13 +9154,13 @@ export const MODELS = {
reasoning: true,
input: ["text"],
cost: {
input: 0.22,
output: 0.85,
input: 0.25,
output: 0.8,
cacheRead: 0.06,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 262144,
maxTokens: 80000,
} satisfies Model<"openai-completions">,
"arcee-ai/trinity-mini": {
id: "arcee-ai/trinity-mini",
@@ -10573,13 +10537,13 @@ export const MODELS = {
reasoning: true,
input: ["text", "image"],
cost: {
input: 0.67,
input: 0.66,
output: 3.5,
cacheRead: 0.2,
cacheRead: 0.33,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 262144,
maxTokens: 262142,
} satisfies Model<"openai-completions">,
"moonshotai/kimi-k2.7-code": {
id: "moonshotai/kimi-k2.7-code",
@@ -10590,13 +10554,13 @@ export const MODELS = {
reasoning: true,
input: ["text", "image"],
cost: {
input: 0.74,
output: 3.5,
cacheRead: 0.15,
input: 0.612,
output: 3.069,
cacheRead: 0.1296,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 16384,
maxTokens: 262144,
} satisfies Model<"openai-completions">,
"nex-agi/nex-n2-pro:free": {
id: "nex-agi/nex-n2-pro:free",
@@ -12761,13 +12725,13 @@ export const MODELS = {
reasoning: true,
input: ["text"],
cost: {
input: 0.066,
output: 0.26,
cacheRead: 0.029,
input: 0.063,
output: 0.21,
cacheRead: 0.021,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 262144,
maxTokens: 4096,
} satisfies Model<"openai-completions">,
"thedrummer/rocinante-12b": {
id: "thedrummer/rocinante-12b",
@@ -13069,11 +13033,11 @@ export const MODELS = {
cost: {
input: 0.98,
output: 3.08,
cacheRead: 0.182,
cacheRead: 0.49,
cacheWrite: 0,
},
contextWindow: 202752,
maxTokens: 4096,
maxTokens: 65535,
} satisfies Model<"openai-completions">,
"z-ai/glm-5.2": {
id: "z-ai/glm-5.2",
@@ -13082,6 +13046,7 @@ export const MODELS = {
provider: "openrouter",
baseUrl: "https://openrouter.ai/api/v1",
reasoning: true,
thinkingLevelMap: {"xhigh":"xhigh"},
input: ["text"],
cost: {
input: 1.2,
@@ -13203,13 +13168,13 @@ export const MODELS = {
reasoning: true,
input: ["text", "image"],
cost: {
input: 0.67,
input: 0.66,
output: 3.5,
cacheRead: 0.2,
cacheRead: 0.33,
cacheWrite: 0,
},
contextWindow: 262144,
maxTokens: 262144,
maxTokens: 262142,
} satisfies Model<"openai-completions">,
"~openai/gpt-latest": {
id: "~openai/gpt-latest",
@@ -15981,8 +15946,8 @@ export const MODELS = {
cost: {
input: 0.09,
output: 0.3,
cacheRead: 0,
cacheWrite: 0.02,
cacheRead: 0.02,
cacheWrite: 0,
},
contextWindow: 262114,
maxTokens: 262114,