Conversation
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR registers Z.AI (Zhipu AI) as a selectable provider in the LiteLLM UI dashboard by adding metadata to Confidence Score: 5/5Safe 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.
|
| 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"]
Reviews (1): Last reviewed commit: "feat: add Z.AI provider to UI dashboard" | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
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. |
Relevant issues
Fixes #25482
Pre-Submission checklist
tests/test_litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewType
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 thezai/provider prefix already exists inlitellm/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)ZAIprovider 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 endpointhttps://api.z.ai/api/coding/paas/v4for 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)ZAI = "Z.AI"to theProvidersenum.ZAI: "zai"inprovider_map.[Providers.ZAI]: \${asset_logos_folder}zai.svg`inproviderLogoMap`.3. Assets
ui/litellm-dashboard/public/assets/logos/zai.svg— sourced from LobeHub icons, which matches the logo used on https://chat.z.ai.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 buildpasses (TypeScript compile + Next.js static page generation succeed).npx prettier --check./assets/logos/zai.svg.zai/provider routing inlitellm/llms/zai/is unaffected.