feat(M3-005): ZaiAdapter for Z.ai GLM-5 provider #314

Merged
jason.woltje merged 1 commits from feat/m3-zai-adapter into main 2026-03-23 00:09:17 +00:00
Owner

Summary

  • Implements for Z.ai (Zhipu AI / BigModel) GLM-5 provider
  • Z.ai exposes an OpenAI-compatible API at — uses the SDK with a custom
  • Removes the legacy direct-registry in (placeholder from M3-001) and replaces it with the proper adapter pattern
  • Graceful degradation: skips registration when is absent
  • Supports env var override for custom deployments

API Format

Z.ai is fully OpenAI-compatible. Confirmed base URL: . Implementation follows the same pattern as .

Test plan

  • Typecheck, lint, and format:check all pass (verified in pre-push hook)
  • With unset: adapter registers 0 models, health returns with descriptive error
  • With set: adapter registers GLM-5 (128K context, standard tier, tools support)
  • hits and reports latency

Closes M3-005

🤖 Generated with Claude Code

## Summary - Implements for Z.ai (Zhipu AI / BigModel) GLM-5 provider - Z.ai exposes an OpenAI-compatible API at — uses the SDK with a custom - Removes the legacy direct-registry in (placeholder from M3-001) and replaces it with the proper adapter pattern - Graceful degradation: skips registration when is absent - Supports env var override for custom deployments ## API Format Z.ai is fully OpenAI-compatible. Confirmed base URL: . Implementation follows the same pattern as . ## Test plan - [ ] Typecheck, lint, and format:check all pass (verified in pre-push hook) - [ ] With unset: adapter registers 0 models, health returns with descriptive error - [ ] With set: adapter registers GLM-5 (128K context, standard tier, tools support) - [ ] hits and reports latency Closes M3-005 🤖 Generated with [Claude Code](https://claude.com/claude-code)
jason.woltje added 1 commit 2026-03-23 00:04:22 +00:00
feat(M3-005): implement ZaiAdapter for Z.ai GLM-5 provider
Some checks failed
ci/woodpecker/push/ci Pipeline failed
ci/woodpecker/pr/ci Pipeline failed
2a0ff25794
Z.ai exposes an OpenAI-compatible API at https://open.bigmodel.cn/api/paas/v4.
The adapter uses the openai SDK with a custom baseURL and ZAI_API_KEY env var.

- Add ZaiAdapter implementing IProviderAdapter with register(), listModels(),
  healthCheck(), and createCompletion() (streaming via OpenAI-compat API)
- Register GLM-5 (128K context, standard tier, tools support) from model-capabilities
- Support ZAI_BASE_URL override for custom deployments
- Graceful degradation when ZAI_API_KEY is absent
- Remove legacy registerZaiProvider() direct-registry method from ProviderService
- Export ZaiAdapter from adapters/index.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason.woltje merged commit 6f2b3d4f8c into main 2026-03-23 00:09:17 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#314