Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Admin UI - Set a limited list in the models field of a user #2162

Closed
Tracked by #2056
ishaan-jaff opened this issue Feb 23, 2024 · 12 comments
Closed
Tracked by #2056

Admin UI - Set a limited list in the models field of a user #2162

ishaan-jaff opened this issue Feb 23, 2024 · 12 comments

Comments

@ishaan-jaff
Copy link
Contributor

ishaan-jaff commented Feb 23, 2024

Problem

Prevent user from creating key for a model that is not allowed to them

cc: @Lunik

@krrishdholakia
Copy link
Contributor

Thinking

We could do something similar to what we did for keys:

litellm_settings:
  default_user_params:
    modes: ["gpt-3.5-turbo"] # default model everyone has access to 

@krrishdholakia
Copy link
Contributor

When is a new user written to our db?

  • Our sso logic assumes a user already exists when they login, this isn't always true. This means when a user logs in via /sso/callback we should be doing an upsert operation to make sure they exist in the litellm db.

@krrishdholakia
Copy link
Contributor

Documenting issues.

Created a user on keycloak.

I'm logged in as app owner, but I can see all models on proxy:
Screenshot 2024-02-23 at 2 38 52 PM

@krrishdholakia
Copy link
Contributor

Seeing hashed token issue that @Lunik saw
Screenshot 2024-02-23 at 2 39 53 PM

@ishaan-jaff
Copy link
Contributor Author

ishaan-jaff commented Feb 23, 2024

I'm logged in as app owner, but I can see all models on proxy:

This is intentional - you should be able to see all models, even ones you don't have access to. IMO App owners should be able to request models they don't have access to

@krrishdholakia
Copy link
Contributor

krrishdholakia commented Feb 23, 2024

@ishaan-jaff agreed you should see what's available, but it says i have access to all models

@krrishdholakia
Copy link
Contributor

fixed call issue
Screenshot 2024-02-23 at 2 43 25 PM

@krrishdholakia
Copy link
Contributor

krrishdholakia commented Feb 23, 2024

Issue 1:

new user unable to create keys
Screenshot 2024-02-23 at 3 43 56 PM

@krrishdholakia
Copy link
Contributor

Issue 2:

new user (not even in proxy db) is able to see all models while creating a key

Screenshot 2024-02-23 at 3 44 22 PM

@krrishdholakia
Copy link
Contributor

Looks like the dropdown calls /model/info

I think this would be solved by just calling the /models endpoint - it's written to just return models the user has access to

@krrishdholakia
Copy link
Contributor

krrishdholakia commented Feb 24, 2024

Just pushed fixes for

  • model dropdown for create key
  • Chat Ui

We now support a default_user_params as a litellm setting, so you can do

litellm_settings: 
      default_user_params: 
          models: ["gemini-pro"] 

and all new SSO users will just have access to gemini-pro

@krrishdholakia
Copy link
Contributor

this is now live

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants