Skip to content

feat: add Z.AI provider to UI dashboard - #25485

Closed
gert-cs wants to merge 1 commit into
BerriAI:mainfrom
gert-cs:feat/ui-add-zai-provider
Closed

gert-cs wants to merge 1 commit into
BerriAI:mainfrom
gert-cs:feat/ui-add-zai-provider

Conversation

@gert-cs

@gert-cs gert-cs commented Apr 10, 2026

Copy link
Copy Markdown

Relevant issues

Fixes #25482

Pre-Submission checklist

  • I have Added testing in the tests/test_litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

Type

New Feature

Changes

Summary

Registers Z.AI (Zhipu AI) in the LiteLLM dashboard's provider dropdown so users can configure Z.AI models from the UI without editing config.yaml. Backend support for the zai/ provider prefix already exists in litellm/llms/zai/; this PR only adds the UI-layer registration.

Follows the pattern established by the MiniMax provider PR #18496.

What was added

1. Backend metadata (provider_create_fields.json)

  • Added ZAI provider entry with:
    • api_key — required password field. Tooltip links to https://z.ai/manage-apikey/apikey-list (where users create API keys).
    • api_base — optional text field. Default: https://api.z.ai/api/paas/v4. Tooltip also documents the alternative GLM Coding Plan endpoint https://api.z.ai/api/coding/paas/v4 for Coding Plan subscribers (per the Z.AI API reference).
    • default_model_placeholder: zai/glm-4.6 (Z.AI's documented flagship model).

2. Frontend (provider_info_helpers.tsx)

  • Added ZAI = "Z.AI" to the Providers enum.
  • Registered ZAI: "zai" in provider_map.
  • Added [Providers.ZAI]: \${asset_logos_folder}zai.svg`inproviderLogoMap`.

3. Assets

Files modified

  • litellm/proxy/public_endpoints/provider_create_fields.json (+28 lines)
  • ui/litellm-dashboard/src/components/provider_info_helpers.tsx (+3 lines)
  • ui/litellm-dashboard/public/assets/logos/zai.svg (new, 319 bytes)

Verification

  • npm run build passes (TypeScript compile + Next.js static page generation succeed).
  • Both modified files pass npx prettier --check.
  • Dev server confirmed the logo file is served correctly at /assets/logos/zai.svg.
  • No backend code is modified; existing zai/ provider routing in litellm/llms/zai/ is unaffected.

Registers Z.AI in the dashboard's provider dropdown so users can
configure Z.AI models from the UI. Backend support for the zai/
prefix already exists in litellm/llms/zai/.

- provider_create_fields.json: add ZAI entry with api_key (required)
  and api_base (optional, defaults to https://api.z.ai/api/paas/v4).
  The api_base tooltip also notes the alternative GLM Coding Plan
  endpoint at https://api.z.ai/api/coding/paas/v4 for subscribers.
- provider_info_helpers.tsx: register ZAI in Providers enum,
  provider_map, and providerLogoMap.
- zai.svg: sourced from LobeHub icons
  (https://lobehub.com/icons/zai), matches https://chat.z.ai branding.

Follows the pattern of MiniMax PR BerriAI#18496.

Fixes BerriAI#25482
@vercel

vercel Bot commented Apr 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Apr 10, 2026 10:20am

Request Review

@greptile-apps

greptile-apps Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR registers Z.AI (Zhipu AI) as a selectable provider in the LiteLLM UI dashboard by adding metadata to provider_create_fields.json, a ZAI enum entry and map entries in provider_info_helpers.tsx, and an SVG logo. Backend support in litellm/llms/zai/ already exists and is untouched; this is a pure UI/metadata addition that follows the established pattern (e.g. MiniMax PR #18496).

Confidence Score: 5/5

Safe to merge — pure UI metadata addition with no backend logic changes.

All three changes are additive, follow the established pattern exactly, and touch no runtime logic. The pre-submission test checklist is unchecked, but a UI enum/JSON metadata entry has no meaningful unit-testable behavior beyond what the TypeScript compiler already validates at build time (which the author confirmed passes).

No files require special attention.

Important Files Changed

Filename Overview
litellm/proxy/public_endpoints/provider_create_fields.json Adds a well-formed ZAI provider entry with api_key (required, password) and api_base (optional, with default) fields; follows exact schema of neighboring entries.
ui/litellm-dashboard/src/components/provider_info_helpers.tsx Correctly adds ZAI to the Providers enum, provider_map, and providerLogoMap in alphabetical order matching the surrounding entries.
ui/litellm-dashboard/public/assets/logos/zai.svg Adds a clean inline SVG logo sourced from LobeHub; no external references, safe for serving as a static asset. Missing trailing newline (cosmetic).

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["UI: Provider Dropdown"] --> B["provider_info_helpers.tsx\nProviders.ZAI = 'Z.AI'"]
    B --> C["provider_map\nZAI → 'zai'"]
    B --> D["providerLogoMap\nZAI → zai.svg"]
    C --> E["provider_create_fields.json\nZAI entry: api_key + api_base"]
    E --> F["POST /proxy/provider/create\nlitellm_provider: 'zai'"]
    F --> G["litellm/llms/zai/\n(existing backend)"]
    D --> H["Static Asset\npublic/assets/logos/zai.svg"]
Loading

Reviews (1): Last reviewed commit: "feat: add Z.AI provider to UI dashboard" | Re-trigger Greptile

@codspeed

codspeed Bot commented Apr 10, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 16 untouched benchmarks


Comparing guanyu-gerry-tao:feat/ui-add-zai-provider (f7cf6c4) with main (9e6d2d2)

Open in CodSpeed

@codecov

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

This branch was successfully deployed

1 active deployment
Preview f7cf6c4c Deployed Apr 10, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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

1 participant