mudler / LocalAI

:robot: The free, Open Source alternative to OpenAI, Claude and others. Self-hosted and local-first. Drop-in replacement for OpenAI, running on consumer-grade hardware. No GPU required. Runs gguf, transformers, diffusers and many more models architectures. Features: Generate Text, Audio, Video, Images, Voice Cloning, Distributed inference
https://localai.io
MIT License
23.57k stars 1.8k forks source link

Fine grained authentication system #2102

Open cryptk opened 5 months ago

cryptk commented 5 months ago

This issue is to track the proposal for a fine-grained authentication system to LocalAI. In addition to deciding if we actually want to do this, we need to determine what features it should have. Once this is determined, this will serve as a tracking issue for the various requirements. Here are some ideas that have been tossed around in Discord:

Required initial features:

Future goals:

Decisions that need to be made:

We should keep in mind that this would be the first feature utilizing a database, so decisions made implementing this feature will set the standard for how to leverage a database in future updates to LocalAI.

localai-bot commented 5 months ago

Hello cryptk,

This is the bot, an experiment of @mudler. Thank you for opening the issue "Fine grained authentication system" (#2102) in the "LocalAI" repository.

Based on your proposal, let's break down the discussion into different aspects:

  1. Initial required features:

    • Role based access: This would include establishing an admin role with complete access and a user role limited to using models only.
    • API key management: Users should have the ability to generate and manage their own API keys.
    • Secure user data storage: A secure database, such as sqlite, would be used to store user data.
  2. Future goals:

    • Custom roles: This would allow users to define and assign additional roles as needed.
    • OAuth support: This would enable the passing of authentication to other systems like goauthentik.io.
    • Integration with the in-progress rules engine: This would be an additional feature for future implementation.
  3. Decisions to be made:

    • Decide if the project wants to implement this authentication system.
    • Choose a suitable authentication system library. It's recommended to not implement a custom auth system.
    • Determine any other features that should be supported or removed from the current list.

Please let us know what you think about these points and if there's anything else you would like to add. We'll be happy to discuss and come to a decision.

Thanks, The bot - an experiment of @mudler

jtwolfe commented 5 months ago

related #2046

my vote is to keep it simple for now and work on compatibility, not saying I wouldn't appreciate built-in UAC, but at scale you would externalize that I think rbac - yes db - yes maybe oauth - yes please web admin interface - god no ;)

jtwolfe commented 5 months ago

related #1869

jtwolfe commented 5 months ago

related https://github.com/comfyanonymous/ComfyUI/issues/3365

this would be quite a big change to implement on both the ComfyUI and LocalAI side but I think this is an example the value of a more complete authentication system.