diff --git a/crates/goose/src/providers/canonical/name_builder.rs b/crates/goose/src/providers/canonical/name_builder.rs index 4fa89f4d19..f7fb000f56 100644 --- a/crates/goose/src/providers/canonical/name_builder.rs +++ b/crates/goose/src/providers/canonical/name_builder.rs @@ -47,6 +47,7 @@ fn map_provider_name(provider: &str) -> &str { "aws_bedrock" => "amazon-bedrock", "gcp_vertex_ai" => "google-vertex", "gemini_oauth" => "google", + "zhipu" => "zhipuai", _ => provider, } } @@ -490,6 +491,16 @@ mod tests { Some("x-ai/grok-3".to_string()) ); + // === Zhipu AI === + assert_eq!( + map_to_canonical_model("zhipu", "glm-4.7", r), + Some("zhipuai/glm-4.7".to_string()) + ); + assert_eq!( + map_to_canonical_model("zhipu", "glm-5", r), + Some("zhipuai/glm-5".to_string()) + ); + // === GCP Vertex AI === assert_eq!( map_to_canonical_model("gcp_vertex_ai", "gemini-2.5-flash", r), diff --git a/crates/goose/src/providers/declarative/zhipu.json b/crates/goose/src/providers/declarative/zhipu.json new file mode 100644 index 0000000000..bc22bc76ee --- /dev/null +++ b/crates/goose/src/providers/declarative/zhipu.json @@ -0,0 +1,28 @@ +{ + "name": "zhipu", + "engine": "openai", + "display_name": "Zhipu AI", + "description": "Zhipu AI GLM models. Set ZHIPU_BASE_URL to override the default endpoint (e.g. https://open.bigmodel.cn/api/coding/paas/v4 for Coding Plan models).", + "api_key_env": "ZHIPU_API_KEY", + "base_url": "${ZHIPU_BASE_URL}", + "env_vars": [ + { + "name": "ZHIPU_BASE_URL", + "required": false, + "secret": false, + "default": "https://open.bigmodel.cn/api/paas/v4", + "description": "Zhipu API base URL. Change to https://open.bigmodel.cn/api/coding/paas/v4 for Coding Plan models like GLM-5.1." + } + ], + "catalog_provider_id": "zhipuai", + "dynamic_models": true, + "models": [ + {"name": "glm-4.5", "context_limit": 131072}, + {"name": "glm-4.5-flash", "context_limit": 131072}, + {"name": "glm-4.6", "context_limit": 204800}, + {"name": "glm-4.7", "context_limit": 204800}, + {"name": "glm-4.7-flash", "context_limit": 200000}, + {"name": "glm-5", "context_limit": 204800} + ], + "supports_streaming": true +}