From 83e790eef02b7552a164c5a8a875b4e1b554703f Mon Sep 17 00:00:00 2001 From: Guillaume Gay Date: Tue, 21 Jul 2026 04:35:29 +0000 Subject: [PATCH] feat: add alibaba/glm-5.2 --- models/alibaba/glm-5.2.yaml | 54 +++++++++++++ packages/modelparams/src/generated/data.ts | 75 +++++++++++++++++++ .../modelparams/src/generated/defaults.ts | 4 + .../modelparams/src/generated/model-ids.ts | 1 + .../modelparams/src/generated/params-by-id.ts | 8 ++ 5 files changed, 142 insertions(+) create mode 100644 models/alibaba/glm-5.2.yaml diff --git a/models/alibaba/glm-5.2.yaml b/models/alibaba/glm-5.2.yaml new file mode 100644 index 0000000..908f493 --- /dev/null +++ b/models/alibaba/glm-5.2.yaml @@ -0,0 +1,54 @@ +# yaml-language-server: $schema=https://modelparams.dev/api/v1/schema.json +provider: alibaba +authType: api_key +model: glm-5.2 +params: + - path: max_completion_tokens + type: integer + label: Max tokens + description: Maximum number of tokens to generate, including both reasoning and the final answer. + range: + min: 1 + group: generation_length + - path: temperature + type: number + label: Temperature + description: Controls randomness. Lower values make outputs more focused; higher values make them more varied. + range: + min: 0 + max: 2 + step: 0.1 + group: sampling + - path: top_p + type: number + label: Top P + description: Controls nucleus sampling by limiting generation to tokens within the selected cumulative probability. + range: + min: 0 + max: 1 + step: 0.01 + group: sampling + - path: extra_body.top_k + type: integer + label: Top K + description: Limits generation to the selected number of highest-probability tokens. Values above 100 disable top-k sampling. + default: 20 + range: + min: 0 + group: sampling + - path: extra_body.enable_thinking + type: boolean + label: Enable thinking + description: Toggles the model's hybrid thinking mode, sent as a provider-specific extra body field on OpenAI-compatible clients. + default: true + group: reasoning + - path: extra_body.thinking_budget + type: integer + label: Thinking budget + description: Maximum number of tokens the model may spend on reasoning before it starts the final answer; defaults to the model's maximum reasoning length. + range: + min: 1 + group: reasoning + applicability: + only: + extra_body.enable_thinking: true diff --git a/packages/modelparams/src/generated/data.ts b/packages/modelparams/src/generated/data.ts index 21b9c99..d6755cc 100644 --- a/packages/modelparams/src/generated/data.ts +++ b/packages/modelparams/src/generated/data.ts @@ -4,6 +4,81 @@ import type { ModelId } from "./model-ids.js"; export const CATALOG = [ + { + "provider": "alibaba", + "authType": "api_key", + "model": "glm-5.2", + "params": [ + { + "path": "max_completion_tokens", + "label": "Max tokens", + "description": "Maximum number of tokens to generate, including both reasoning and the final answer.", + "group": "generation_length", + "type": "integer", + "range": { + "min": 1 + } + }, + { + "path": "temperature", + "label": "Temperature", + "description": "Controls randomness. Lower values make outputs more focused; higher values make them more varied.", + "group": "sampling", + "type": "number", + "range": { + "min": 0, + "max": 2, + "step": 0.1 + } + }, + { + "path": "top_p", + "label": "Top P", + "description": "Controls nucleus sampling by limiting generation to tokens within the selected cumulative probability.", + "group": "sampling", + "type": "number", + "range": { + "min": 0, + "max": 1, + "step": 0.01 + } + }, + { + "path": "extra_body.top_k", + "label": "Top K", + "description": "Limits generation to the selected number of highest-probability tokens. Values above 100 disable top-k sampling.", + "group": "sampling", + "type": "integer", + "default": 20, + "range": { + "min": 0 + } + }, + { + "path": "extra_body.enable_thinking", + "label": "Enable thinking", + "description": "Toggles the model's hybrid thinking mode, sent as a provider-specific extra body field on OpenAI-compatible clients.", + "group": "reasoning", + "type": "boolean", + "default": true + }, + { + "path": "extra_body.thinking_budget", + "label": "Thinking budget", + "description": "Maximum number of tokens the model may spend on reasoning before it starts the final answer; defaults to the model's maximum reasoning length.", + "group": "reasoning", + "applicability": { + "only": { + "extra_body.enable_thinking": true + } + }, + "type": "integer", + "range": { + "min": 1 + } + } + ] + }, { "provider": "alibaba", "authType": "api_key", diff --git a/packages/modelparams/src/generated/defaults.ts b/packages/modelparams/src/generated/defaults.ts index cbd36bb..fe5d8d5 100644 --- a/packages/modelparams/src/generated/defaults.ts +++ b/packages/modelparams/src/generated/defaults.ts @@ -5,6 +5,10 @@ import type { ModelId } from "./model-ids.js"; import type { ParamsById } from "./params-by-id.js"; export const DEFAULTS = { + "alibaba/glm-5.2": { + "extra_body.top_k": 20, + "extra_body.enable_thinking": true, + }, "alibaba/qwen-flash": { "extra_body.top_k": 20, "extra_body.chat_template_kwargs.enable_thinking": true, diff --git a/packages/modelparams/src/generated/model-ids.ts b/packages/modelparams/src/generated/model-ids.ts index 91b724d..f8bd479 100644 --- a/packages/modelparams/src/generated/model-ids.ts +++ b/packages/modelparams/src/generated/model-ids.ts @@ -2,6 +2,7 @@ // Source of truth: the YAML catalog under /models in modelparams.dev. export const MODEL_IDS = [ + "alibaba/glm-5.2", "alibaba/qwen-flash", "alibaba/qwen-plus", "alibaba/qwen3-coder-flash", diff --git a/packages/modelparams/src/generated/params-by-id.ts b/packages/modelparams/src/generated/params-by-id.ts index d941b55..5348db6 100644 --- a/packages/modelparams/src/generated/params-by-id.ts +++ b/packages/modelparams/src/generated/params-by-id.ts @@ -7,6 +7,14 @@ * parameters they want to override. */ export type ParamsById = { + "alibaba/glm-5.2": { + max_completion_tokens: number; + temperature: number; + top_p: number; + "extra_body.top_k": number; + "extra_body.enable_thinking": boolean; + "extra_body.thinking_budget": number; + }; "alibaba/qwen-flash": { max_tokens: number; temperature: number;