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

Support permissions for models (and possibly tools/assistants) #1417

Open
zacps opened this issue Aug 19, 2024 · 6 comments
Open

Support permissions for models (and possibly tools/assistants) #1417

zacps opened this issue Aug 19, 2024 · 6 comments
Labels
enhancement New feature or request

Comments

@zacps
Copy link
Contributor

zacps commented Aug 19, 2024

Describe your feature request

We are considering using chat-ui for our own custom LLM tools. Because we want complete control over the generation we're currently implementing these as models. However, some of these tools will have access to documents that are not broadly available within the company. Because of this we want to be able to restrict model access by user.

Implementation idea

  • Retrieve groups via OIDC
  • Add an alllowed_groups field to each model
  • Restrict usage & visibility of each model by group membership

We're currently working on implementing this in our private fork, but I wanted to reach out to ask @nsarrazin if a patch would be accepted upstream, and if there would be any additional requirements.

@zacps zacps added the enhancement New feature or request label Aug 19, 2024
@nsarrazin
Copy link
Collaborator

I think that would be a great addition! We would definitely accept a patch for this as long as it's not a breaking change, which should be doable 😄

@moellert
Copy link

moellert commented Oct 2, 2024

This is currently my biggest question mark for using assistants to implement our RAG, as not all data should be accessible by everyone.
I'm not a developer, but I'd be happy to help with testing when the time comes!

@nsarrazin
Copy link
Collaborator

Yes I think it would be a great add, however it's not really aligned so far with the chat-ui features we use for HuggingChat so we're not really dedicating much internal resources on this.

However I would happily discuss an implementation plan for this with someone who feels like making a PR for it!

@moellert
Copy link

moellert commented Oct 8, 2024

@zacps how far have you come with your implementation?

@jonstrutz11
Copy link

jonstrutz11 commented Oct 9, 2024

Hi all! While Zac opened this issue here, I'm the one who led this specific effort internally at our company (with much help from @zacps).

To update y'all, we do have a working solution at this point on our private fork of chat-ui. We abstracted away the specific auth provider and use a hybrid flow (response_type=code id_token) to authenticate if this feature is turned on in the config, use the id token to get an access token, grab a user's groups (using MS Graph API in our case) using the access token, and then show/hide models based on those groups. We implemented it with microsoft Entra as an auth provider, but like I said, we abstracted these details away (similar to how "endpoints" are handled) so that folks could implement this functionality for other auth providers reasonably easily.

There are some other features we added to our private fork as well, but I'm not sure how much about those I can say here or if we plan on upstreaming them (@zacps feel free to chime in, although for everyone's benefit Zac is on vacation for the next 2 weeks so may take some time to respond).

I plan to rebase our private fork onto the current upstream branch and then submit a PR with Zac's help once he returns from vacation in 2-3 weeks (I anticipate there will be quite a few merge conflicts).

@nsarrazin
Copy link
Collaborator

Hi 👋 Let me know once you have a PR and I'll happily help with merge conflicts and such 😄

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

No branches or pull requests

4 participants