Skip to content

fix(zai): add provider and current model catalog - #37433

Closed
ExDevilLee wants to merge 3 commits into
BerriAI:litellm_internal_stagingfrom
ExDevilLee:litellm_fix_zai_provider_dropdown
Closed

ExDevilLee wants to merge 3 commits into
BerriAI:litellm_internal_stagingfrom
ExDevilLee:litellm_fix_zai_provider_dropdown

Conversation

@ExDevilLee

@ExDevilLee ExDevilLee commented Aug 19, 2026 •

Copy link
Copy Markdown

TLDR

Fixes the Z.AI dashboard onboarding path and brings the bundled Z.AI catalog up to the current documented models.

  • Adds Z.AI to the Add Model provider catalog.
  • Lets provider search match the LiteLLM slug zai as well as the display name.
  • Adds four missing models: glm-5-turbo, glm-5v-turbo, glm-4.7-flashx, and glm-4.6v. Upstream already includes glm-5.3 and glm-5.2.
  • Keeps model_prices_and_context_window.json and the bundled backup map in sync.

The Z.AI provider uses the OpenAI-compatible base URL https://api.z.ai/api/paas/v4.

User Flow

Before:

  1. A proxy admin opens Add Model and searches for zai or z.ai.
  2. The provider dropdown returns no result, so no Z.AI credentials or model choices can be configured.

After:

  1. The same admin searches for zai or z.ai and selects Z.AI.
  2. The form shows the API key field and default Z.AI API base.
  3. The model selector includes the current Z.AI models, including GLM-5.3, GLM-5.2, GLM-5-Turbo, GLM-5V-Turbo, GLM-4.7-FlashX, and GLM-4.6V.

Root Cause

LiteLLM supported the zai provider in the SDK and had existing Z.AI metadata, but the dashboard provider-creation catalog omitted it. The catalog also lagged the current Z.AI model list.

Relevant Issues

Fixes #25482

Supersedes the stale unmerged implementation in #25485.

The existing provider-name mapping from #26419 is retained.

Validation

  • python3 -m json.tool model_prices_and_context_window.json
  • Verified the canonical and bundled backup maps are byte-identical.
  • Added tests/test_litellm/test_zai_model_metadata.py, which asserts the documented 15-model Z.AI subset and exact metadata for the four newly catalogued models. Removes zai from the frozen unlisted-provider set now that the dropdown lists it.
  • The provider-search regression now lives in AddModelForm.integration.test.tsx. The latest local run was blocked by a missing Rollup native dependency.
  • In a local Admin UI running against the proposed bundled catalog, GET /public/litellm_model_cost_map exposes all six new model IDs and the Add Model selector shows all six, including search results for zai/glm-4.7-flashx and zai/glm-4.6v.

CI Note

The September 14 run found a stale zai entry in the unlisted-provider test set; this PR removes it. Local catalog set equality passes; the full endpoint test awaits CI. Other failures were stale user soft_budget API descriptions, an auth prefetch test awaiting a MagicMock, and the expired mlflow vulnerability exception. The PR does not modify those paths. CI is rerunning after the test correction

Pre-Submission Checklist

  • I have added meaningful tests.
  • My PR passes all CI/CD checks.
  • My PR's scope is isolated to Z.AI dashboard onboarding and catalog metadata.
  • I have received a Greptile Confidence Score of at least 4/5 before requesting maintainer review.

Type

Bug Fix

Caveats

  • The focused Python test requires the full LiteLLM Python dependency set, which is unavailable in this local worktree. The JSON, bundled-map consistency, runtime API, and UI flows were verified locally; GitHub CI will run the Python test.
  • A full local Docker image build requires the Docker buildx plugin.

Final Attestation

  • The tests check the right things, including edge cases and real-world customer regressions.

@CLAassistant

CLAassistant commented Aug 19, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@codspeed

codspeed Bot commented Aug 19, 2026 •

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 31 untouched benchmarks


Comparing ExDevilLee:litellm_fix_zai_provider_dropdown (bd88b08) with litellm_internal_staging (c2c2a62)

Open in CodSpeed

@ExDevilLee ExDevilLee changed the title fix(ui): add Z.AI provider to Add Model fix(zai): add provider and current model catalog Aug 19, 2026
@ExDevilLee
ExDevilLee force-pushed the litellm_fix_zai_provider_dropdown branch from 8734ea5 to 4c617b6 Compare August 19, 2026 07:37
@ExDevilLee
ExDevilLee marked this pull request as ready for review August 19, 2026 08:22
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Z.AI to the dashboard provider catalog and makes provider search match LiteLLM slugs. Updates both bundled model maps with six Z.AI models and adds focused catalog, endpoint, and UI regression coverage

Confidence Score: 5/5

The PR appears safe to merge, with the catalog, provider identity normalization, and search behavior remaining consistent across the changed paths

The new provider record validates against the existing endpoint contract, both save and connection-test paths normalize ZAI to the runtime slug, and the model catalogs remain synchronized

Important Files Changed

Filename Overview
litellm/proxy/public_endpoints/provider_create_fields.json Adds a schema-compatible Z.AI provider record whose identifiers, API base, and model placeholder align with existing runtime configuration
ui/litellm-dashboard/src/components/add_model/AddModelForm.tsx Extends provider search labels with the required LiteLLM provider slug without changing selection or displayed-label behavior
model_prices_and_context_window.json Adds six internally consistent Z.AI pricing and capability records to the canonical model catalog
litellm/model_prices_and_context_window_backup.json Mirrors the six canonical Z.AI model records in the bundled backup catalog
tests/test_litellm/test_zai_model_metadata.py Verifies the expected Z.AI model subset, new metadata, and parity between canonical and backup catalogs
tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py Verifies that the public provider-fields endpoint exposes the expected Z.AI configuration
ui/litellm-dashboard/src/components/add_model/AddModelForm.test.tsx Adds regression coverage proving that searching by the lowercase zai slug finds the Z.AI provider

Reviews (1): Last reviewed commit: "fix(ui): search providers by LiteLLM slu..." | Re-trigger Greptile

@ExDevilLee
ExDevilLee force-pushed the litellm_fix_zai_provider_dropdown branch from bb3a8de to 282d700 Compare September 14, 2026 02:07
@github-actions

Copy link
Copy Markdown
Contributor

#25482 was fixed by commit 334aedf on main, so this pull request is closed. Reopen it if something was missed.

@github-actions github-actions Bot closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Z.AI (zai) provider missing from UI dropdown despite being in /public/providers API

3 participants