[ Patch}: Add Z.ai provider with GLM-4.7 and GLM-4.5-Air models #17

Open
opened 2026-02-16 09:17:47 -05:00 by yindo · 0 comments
Owner

Originally created by @liveisgood on GitHub (Jan 22, 2026).

Summary
Add Z.ai as a new provider with Anthropic-compatible GLM models (GLM-4.7 and GLM-4.5-Air).
What This Does

  • Adds "zai" as a new ProviderId in type definitions
  • Adds ZAI_API_KEY environment variable mapping
  • Adds Z.ai provider to the model configuration
  • Adds two GLM models to AVAILABLE_MODELS:
    • GLM-4.7 (Sonnet equivalent) - Flagship model
    • GLM-4.5-Air (Haiku equivalent) - Fast, cost-effective
  • Updates runtime to handle Z.ai models with custom API endpoint
  • Adds Z.ai icon and fallback provider to UI

How to Test

  1. Add Z.ai API key in Settings
  2. Select GLM-4.7 or GLM-4.5-Air model
  3. Test with a simple prompt
    Technical Details
  • Uses @langchain/anthropic ChatAnthropic with custom anthropicApiUrl
  • Endpoint: https://api.z.ai/api/anthropic
  • Follows existing provider/model patterns in the codebase
  • No breaking changes to existing functionality
    **

zai-integration.patch

**

Originally created by @liveisgood on GitHub (Jan 22, 2026). **Summary** Add Z.ai as a new provider with Anthropic-compatible GLM models (GLM-4.7 and GLM-4.5-Air). What This Does - Adds "zai" as a new ProviderId in type definitions - Adds ZAI_API_KEY environment variable mapping - Adds Z.ai provider to the model configuration - Adds two GLM models to AVAILABLE_MODELS: - GLM-4.7 (Sonnet equivalent) - Flagship model - GLM-4.5-Air (Haiku equivalent) - Fast, cost-effective - Updates runtime to handle Z.ai models with custom API endpoint - Adds Z.ai icon and fallback provider to UI **How to Test** 1. Add Z.ai API key in Settings 2. Select GLM-4.7 or GLM-4.5-Air model 3. Test with a simple prompt Technical Details - Uses @langchain/anthropic ChatAnthropic with custom anthropicApiUrl - Endpoint: https://api.z.ai/api/anthropic - Follows existing provider/model patterns in the codebase - No breaking changes to existing functionality ** [zai-integration.patch](https://github.com/user-attachments/files/24805561/zai-integration.patch) ** - Z.ai docs: https://docs.z.ai/scenario-example/develop-tools/claude
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/openwork#17