Litellm ryan apr 4 - #25156
Conversation
Adds tenant_id, client_id, and client_secret to the Azure provider entry in provider_create_fields.json so the credential add/edit modals and the add-model form surface Service Principal auth as an alternative to api_key. The Azure handler already reads these fields from litellm_params at request time via get_azure_ad_token(); this change makes them inputtable from the UI without code changes to the React components (the form is driven by GET /public/providers/fields).
Exposes the backend's existing model_tpm_limit/model_rpm_limit fields (which lived in team.metadata) through a new "Model-Specific Rate Limits" form section on the team Settings tab. Limits round-trip through the team-update API and render on the Overview card and Settings view. Model picker is scoped to the team's currently-selected models (unfurls wildcards, falls back to userModels for all-proxy-models / all-team-models).
Previously, a row with a model selected but both limits blank was silently dropped on save (neither model_tpm_limit nor model_rpm_limit got the key), so the row disappeared on reload with no feedback. Now the TPM field's validator blocks submission with "Set at least one of TPM or RPM" when a row has a model but neither limit filled.
… api_key_breakdown The export utility always extracted team_id from api_key_breakdown metadata to populate the entity label/ID columns. This worked for team exports (where entity key = team_id) but was wrong for every other entity type — tags, orgs, customers, agents, users all showed the API key's team name (e.g. "admins") instead of the actual entity value. Replace extractTeamIdFromApiKeyBreakdown with resolveEntityDisplay which uses the entity key directly. For teams the teamAliasMap still resolves a human-readable alias; for all other types the entity key itself is the correct label.
The previous fix (9dca431) switched the export display logic to use the entity key directly, but left the unit tests asserting the old behavior where id/alias were extracted from api_key_breakdown metadata. Rename mock entity keys from entity1/entity2 to "team-1"/"team-2" to reflect the real shape of team-export payloads (breakdown.entities is keyed by the entity identifier). Replace three tests whose assertions documented the removed behavior: - "should use key alias when available" → entity key is the alias when no team alias map is supplied - "should use team alias map when key alias is not available" → team alias map resolves from the entity key - "should use dash when team id is not available" → entity key itself is the fallback label (illustrated with a tag export)
feat(ui): expose Azure Entra ID credential fields in provider form
…l-rate-limit-ui feat(ui): add per-model rate limits to team edit/info views
fix(ui): use entity key for usage export display
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR bundles three independent UI improvements, all well-scoped and clean:
Issues found:
Confidence Score: 5/5Safe to merge — no correctness bugs, security issues, or data-loss risks found All findings are P2 (one vacuous test). Logic changes are correct, well-tested, and consistent with backend contracts. utils.test.ts has one vacuous test that should ideally be updated, but does not block merge
|
| Filename | Overview |
|---|---|
| ui/litellm-dashboard/src/components/EntityUsageExport/utils.ts | Introduces resolveEntityDisplay helper to use entity key directly for display; all export functions updated consistently |
| ui/litellm-dashboard/src/components/EntityUsageExport/utils.test.ts | Tests updated for new entity-key display behavior; one pre-existing test is now vacuous |
| ui/litellm-dashboard/src/components/team/TeamInfo.tsx | Adds per-model rate limits UI editor and read-only display; metadata serialization correctly excludes model_tpm_limit/model_rpm_limit from raw textarea |
| litellm/proxy/public_endpoints/provider_create_fields.json | Azure provider gains tenant_id, client_id, client_secret fields for Entra ID auth; none are individually required |
| tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py | New test verifies all three Entra ID fields are present, client_secret is password type, and fields are non-required; uses TestClient only |
Sequence Diagram
sequenceDiagram
participant UI as TeamInfo Edit Tab
participant API as /team/update
participant Backend as team_endpoints.py
participant DB as Prisma DB
participant UIv as TeamInfo View Tab
UI->>API: PATCH {model_tpm_limit, model_rpm_limit, metadata}
API->>Backend: UpdateTeamRequest (model limits as top-level fields)
Backend->>Backend: _update_metadata_fields(updated_kv)
Note over Backend: Moves model_tpm_limit/model_rpm_limit into metadata
Backend->>DB: update team row (metadata contains model limits)
DB-->>Backend: Updated row
Backend-->>UI: 200 OK
UI->>API: GET /team/info (fetchTeamInfo)
API-->>UIv: team_info.metadata.model_tpm_limit/model_rpm_limit
UIv->>UIv: Render per-model limits in Rate Limits card
Comments Outside Diff (1)
-
ui/litellm-dashboard/src/components/EntityUsageExport/utils.test.ts, line 379-386 (link)Vacuous test — inner assertion never runs
After the
resolveEntityDisplayrefactor,Team IDis always the entity key string (nevernull,undefined, or"-"), soentryWithoutTeamIdis alwaysundefinedand theexpectinside theifblock never executes. The test trivially passes while providing zero coverage.The new test at line 388 already covers the correct fallback behavior. Consider replacing this test with one that exercises the new behavior:
Rule Used: What: Flag any modifications to existing tests and... (source)
Reviews (1): Last reviewed commit: "chore: poetry lock" | Re-trigger Greptile
Litellm ryan apr 4
feat(ui): expose Azure Entra ID credential fields in provider form
feat(ui): add per-model rate limits to team edit/info views
fix(ui): use entity key for usage export display
circle ci
https://app.circleci.com/pipelines/github/BerriAI/litellm/73091/workflows/760fb24e-2102-4415-8483-2fa439a718af