mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
feat: add Z.AI provider to UI dashboard
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 #18496. Fixes #25482
This commit is contained in:
parent
9e6d2d2069
commit
f7cf6c4c87
3 changed files with 32 additions and 0 deletions
|
|
@ -3056,6 +3056,34 @@
|
|||
],
|
||||
"default_model_placeholder": "gpt-3.5-turbo"
|
||||
},
|
||||
{
|
||||
"provider": "ZAI",
|
||||
"provider_display_name": "Z.AI",
|
||||
"litellm_provider": "zai",
|
||||
"credential_fields": [
|
||||
{
|
||||
"key": "api_key",
|
||||
"label": "API Key",
|
||||
"placeholder": "your-zai-api-key",
|
||||
"tooltip": "Z.AI API Key from https://z.ai/manage-apikey/apikey-list",
|
||||
"required": true,
|
||||
"field_type": "password",
|
||||
"options": null,
|
||||
"default_value": null
|
||||
},
|
||||
{
|
||||
"key": "api_base",
|
||||
"label": "API Base",
|
||||
"placeholder": "https://api.z.ai/api/paas/v4",
|
||||
"tooltip": "General: https://api.z.ai/api/paas/v4. GLM Coding Plan: https://api.z.ai/api/coding/paas/v4. Override for self-hosted endpoints.",
|
||||
"required": false,
|
||||
"field_type": "text",
|
||||
"options": null,
|
||||
"default_value": "https://api.z.ai/api/paas/v4"
|
||||
}
|
||||
],
|
||||
"default_model_placeholder": "zai/glm-4.6"
|
||||
},
|
||||
{
|
||||
"provider": "CURSOR",
|
||||
"provider_display_name": "Cursor",
|
||||
|
|
|
|||
1
ui/litellm-dashboard/public/assets/logos/zai.svg
Normal file
1
ui/litellm-dashboard/public/assets/logos/zai.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg fill="currentColor" fill-rule="evenodd" height="1em" style="flex:none;line-height:1" viewBox="0 0 24 24" width="1em" xmlns="http://www.w3.org/2000/svg"><title>Z.ai</title><path d="M12.105 2L9.927 4.953H.653L2.83 2h9.276zM23.254 19.048L21.078 22h-9.242l2.174-2.952h9.244zM24 2L9.264 22H0L14.736 2H24z"></path></svg>
|
||||
|
After Width: | Height: | Size: 319 B |
|
|
@ -103,6 +103,7 @@ export enum Providers {
|
|||
WATSONX_TEXT = "Watsonx Text",
|
||||
xAI = "xAI",
|
||||
XINFERENCE = "Xinference",
|
||||
ZAI = "Z.AI",
|
||||
}
|
||||
|
||||
export const provider_map: Record<string, string> = {
|
||||
|
|
@ -210,6 +211,7 @@ export const provider_map: Record<string, string> = {
|
|||
WATSONX_TEXT: "watsonx_text",
|
||||
xAI: "xai",
|
||||
XINFERENCE: "xinference",
|
||||
ZAI: "zai",
|
||||
};
|
||||
|
||||
const asset_logos_folder = "../ui/assets/logos/";
|
||||
|
|
@ -299,6 +301,7 @@ export const providerLogoMap: Record<string, string> = {
|
|||
[Providers.WATSONX_TEXT]: `${asset_logos_folder}watsonx.svg`,
|
||||
[Providers.xAI]: `${asset_logos_folder}xai.svg`,
|
||||
[Providers.XINFERENCE]: `${asset_logos_folder}xinference.svg`,
|
||||
[Providers.ZAI]: `${asset_logos_folder}zai.svg`,
|
||||
};
|
||||
|
||||
export const getProviderLogoAndName = (providerValue: string): { logo: string; displayName: string } => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue