Allow org admin to create teams on UI (#8407)

* fix(client_initialization_utils.py): handle custom llm provider set with valid value not from model name

* fix(handle_jwt.py): handle groups not existing in jwt token

if user not in group, this won't exist

* fix(handle_jwt.py): add new `enforce_team_based_model_access` flag to jwt auth

allows proxy admin to enforce user can only call model if team has access

* feat(navbar.tsx): expose new dropdown in navbar - allow org admin to create teams within org context

* fix(navbar.tsx): remove non-functional cogicon

* fix(proxy/utils.py): include user-org memberships in `/user/info` response

return orgs user is a member of and the user role within org

* feat(organization_endpoints.py): allow internal user to query `/organizations/list` and get all orgs they belong to

enables org admin to select org they belong to, to create teams

* fix(navbar.tsx): show change in ui when org switcher clicked

* feat(page.tsx): update user role based on org they're in

allows org admin to create teams in the org context

* feat(teams.tsx): working e2e flow for allowing org admin to add new teams

* style(navbar.tsx): clarify switching orgs on UI is in BETA

* fix(organization_endpoints.py): handle getting but not setting members

* test: fix test

* fix(client_initialization_utils.py): revert custom llm provider handling fix - causing unintended issues

* docs(token_auth.md): cleanup docs
This commit is contained in:
Krish Dholakia 2025-02-09 00:07:15 -08:00 committed by GitHub
parent e4411e4815
commit 9c4c7813fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 285 additions and 142 deletions

View file

@ -15,6 +15,24 @@ export interface Model {
model_info: Object | null;
}
export interface Organization {
organization_id: string;
organization_alias: string;
budget_id: string;
metadata: Record<string, any>;
models: string[];
spend: number;
model_spend: Record<string, number>;
created_at: string;
created_by: string;
updated_at: string;
updated_by: string;
litellm_budget_table: any; // Simplified to any since we don't need the detailed structure
teams: any[] | null;
users: any[] | null;
members: any[] | null;
}
const baseUrl = "/"; // Assuming the base URL is the root