Add z.ai/GLM provider via per-process Claude CLI env injection

Route glm:-prefixed models through the CLI/Anthropic path: ResolveModelId
strips the glm: prefix, and CreateCliStartInfo activates the z.ai
Anthropic-compatible endpoint (ANTHROPIC_BASE_URL/AUTH_TOKEN) only for that
process when IsZaiModel matches, leaving every other request's OAuth login
untouched. GLM model list is loaded through the existing model cache and
exposed via /api/models/glm with a "GLM (z.ai)" optgroup in the agent form.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
MelekiandClaude Opus 4.8 committed 2026-06-20 14:01:43 +02:00
1 parent e6770bb5f8
commit 0f3d658fd3
8 files changed
+83 -9

No files matched your search

+3 -1
View File
@@ -28,6 +28,7 @@ registerPage('agent', {
const geminiOptgroup = document.getElementById('geminiOptgroup');
const openaiOptgroup = document.getElementById('openaiOptgroup');
const minimaxOptgroup = document.getElementById('minimaxOptgroup');
const glmOptgroup = document.getElementById('glmOptgroup');
// Modelle dynamisch laden
const loadProviderModels = async (url, prefix, optgroup) => {
@@ -55,7 +56,8 @@ registerPage('agent', {
loadProviderModels('/api/models/nvidia', 'nvidia', nvidiaOptgroup),
loadProviderModels('/api/models/pollinations', 'pollinations', pollinationsOptgroup),
loadProviderModels('/api/models/gemini', 'gemini', geminiOptgroup),
loadProviderModels('/api/models/minimax', 'minimax', minimaxOptgroup)
loadProviderModels('/api/models/minimax', 'minimax', minimaxOptgroup),
loadProviderModels('/api/models/glm', 'glm', glmOptgroup)
]);
const allowUserChoiceEl = document.getElementById('agentAllowUserChoice');
const autoCommitEl = document.getElementById('agentAutoCommit');