feat(litellm-client): add models field to team create/update requests #248

Open
chandra.shekhar wants to merge 4 commits from feature/135-team-models-field into main

Part of phoenix/tenant-maas#135

Summary

Adds an optional models field (LiteLLM model access-group names) to the LiteLLM team DTOs so the osb-maas broker can scope a team to specific model access groups on team create and team update — the mechanism the tenant-maas reservation feature uses: team-owning plans send models: ["shared-models"], and a reservation grants the dedicated group by unioning the reservation plan's groups onto the team via /team/update.

  • CreateTeamRequest: canonical constructor gains List<String> models (last component); all pre-existing signatures retained as conveniences delegating with models = null.
  • UpdateTeamRequest: canonical constructor gains List<String> models; ALL pre-existing signatures retained (including the 6-arg convenience), delegating with models = null.
  • @JsonInclude(NON_NULL) keeps models absent from the JSON when null — unchanged payload for callers that do not set it.
  • The UpdateKeyRequest explicit-null serialization change was reverted (per-key limits are not part of this feature; the commit is preserved in history as 3fa7f63 + revert 9f81ed3).

Tests

CreateTeamRequestTest (4) and UpdateTeamRequestTest (6) following GenerateKeyRequestTest conventions: models serializes as a snake_case list when set, is absent when null, and all pre-existing constructor payloads are unchanged.

./mvnw -pl quarkus-litellm-client -am verify — BUILD SUCCESS, 14 tests green.

Compatibility

Backwards-compatible addition; no behavior change for consumers that do not set models.

Part of phoenix/tenant-maas#135 ## Summary Adds an optional `models` field (LiteLLM model access-group names) to the LiteLLM team DTOs so the osb-maas broker can scope a team to specific model access groups on team create and team update — the mechanism the tenant-maas reservation feature uses: team-owning plans send `models: ["shared-models"]`, and a reservation grants the dedicated group by unioning the reservation plan's groups onto the team via `/team/update`. - `CreateTeamRequest`: canonical constructor gains `List<String> models` (last component); all pre-existing signatures retained as conveniences delegating with `models = null`. - `UpdateTeamRequest`: canonical constructor gains `List<String> models`; ALL pre-existing signatures retained (including the 6-arg convenience), delegating with `models = null`. - `@JsonInclude(NON_NULL)` keeps `models` absent from the JSON when null — unchanged payload for callers that do not set it. - The `UpdateKeyRequest` explicit-null serialization change was reverted (per-key limits are not part of this feature; the commit is preserved in history as 3fa7f63 + revert 9f81ed3). ## Tests `CreateTeamRequestTest` (4) and `UpdateTeamRequestTest` (6) following `GenerateKeyRequestTest` conventions: `models` serializes as a snake_case list when set, is absent when null, and all pre-existing constructor payloads are unchanged. `./mvnw -pl quarkus-litellm-client -am verify` — BUILD SUCCESS, 14 tests green. ## Compatibility Backwards-compatible addition; no behavior change for consumers that do not set `models`.
feat(litellm-client): add models field to team create/update requests
All checks were successful
Build / build (pull_request) Successful in 3m31s
0688ce5587
Allow LiteLLM teams to be granted specific model access groups on create
and update. The new canonical constructors accept a models list that is
serialized as the snake_case models field, and stay absent from the JSON
payload when null (NON_NULL inclusion), so teams without explicit models
keep access to all proxy models. All existing constructor overloads are
preserved for current consumers.

Part of phoenix/tenant-maas#135
feat(litellm-client): retain 6-arg UpdateTeamRequest convenience for existing consumers
All checks were successful
Build / build (pull_request) Successful in 3m18s
f7168c5d10
Restore the pre-models six-argument UpdateTeamRequest signature as an
explicit convenience constructor delegating to the canonical constructor
with models = null, keeping osb-maas 2.11.x call sites compiling. Add a
test asserting the restored overload produces the exact prior payload
shape with no models key.

Part of phoenix/tenant-maas#135
chandra.shekhar changed title from feat(litellm-client): add models field to team create/update requests to WIP: feat(litellm-client): add models field to team create/update requests 2026-10-30 07:56:12 +00:00
feat(litellm-client): serialize an explicit null tpm_limit on key update
All checks were successful
Build / build (pull_request) Successful in 3m53s
3fa7f63caa
Override the class-level NON_NULL inclusion with ALWAYS on the tpmLimit
component of UpdateKeyRequest so an explicit null serializes as
"tpm_limit": null. LiteLLM's prepare_key_update_data builds the update
from model_dump(exclude_unset=True), so the explicit null is included and
clears the key-level limit, while an absent field would leave it
unchanged. The request has no existing consumers, so the serialization
change cannot break a caller.

Part of phoenix/tenant-maas#135
Revert "feat(litellm-client): serialize an explicit null tpm_limit on key update"
All checks were successful
Build / build (pull_request) Successful in 3m27s
9f81ed3011
This reverts commit 3fa7f63caa.

Per-key limits are gone from the feature: the entitlement is LiteLLM access groups, and no tpm/rpm limits are sent to LiteLLM. The explicit-null serialization would be unused code.

Part of phoenix/tenant-maas#135
chandra.shekhar changed title from WIP: feat(litellm-client): add models field to team create/update requests to feat(litellm-client): add models field to team create/update requests 2026-11-03 03:55:12 +00:00
All checks were successful
Build / build (pull_request) Successful in 3m27s
Required
Details
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin feature/135-team-models-field:feature/135-team-models-field
git switch feature/135-team-models-field
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
phoenix-oss/quarkus-commons!248
No description provided.