LibreChat icon indicating copy to clipboard operation
LibreChat copied to clipboard

[Enhancement]: if `user_provided` API KEY value is used, fetch models for user

Open zentixua opened this issue 1 year ago • 2 comments

Contact Details

[email protected]

What happened?

if user_provided API KEY value is used, the model list will not be loaded.

Screenshot: image

But setting the global key fixes it: image image

Steps to Reproduce

  1. Go to https://chat.naga.ac/
  2. Try it yourself

OR

  1. Use OPENAI_REVERSE_PROXY=https://api.naga.ac/v1/chat/completions
  2. Use OPENAI_API_KEY=user_provided
  3. Enter your NagaAI key on the web page
  4. Enjoy this issue xDDD

What browsers are you seeing the problem on?

Firefox, Chrome

Relevant log output

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

zentixua avatar Oct 08 '23 17:10 zentixua

This is by design so not a bug but a feature request. OpenAI doesn't allow model calls without API key, so this will need an added feature

image

danny-avila avatar Oct 08 '23 18:10 danny-avila

there's two potential solutions, and both can be added. # 1 might be more useful in your case (using reverse proxies)

  1. add a env var for an API KEY exclusively for fetching available models
  2. if user_provided is set, change the fetch to a different controller, which will read the encrypted key the user provided for the official api

danny-avila avatar Oct 08 '23 18:10 danny-avila