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

fix: error handling if user has no access to gpt4 yet #26

Open
Hey opened this issue Mar 31, 2023 · 7 comments
Open

fix: error handling if user has no access to gpt4 yet #26

Hey opened this issue Mar 31, 2023 · 7 comments
Labels
good first issue Good for newcomers

Comments

@Hey
Copy link
Contributor

Hey commented Mar 31, 2023

The problem

At the moment, GPT4 rollout isn't available for everyone yet, if an API key is used that does not have access yet we should at least show something.

Error when calling model

{
    "error": {
        "message": "The model: `gpt-4` does not exist",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}

Multiple ways to fix:

  1. We check if the error is error.code = model_not_found and display a message telling the user to switch because they don't have access yet. But this requires us to implement some general error
  2. When supplying an API key we call https://api.openai.com/v1/models which returns the available models and we lock GPT4 if it isn't in this list and lock it if is.
  3. When switching models we call https://api.openai.com/v1/models to see if this key has access to GPT4 and lock the model switch in settings.

2 and 3 can maybe be done in combination because if a user gets access while they already had supplied the key on Flux they would have to switch api keys for it to refetch this information.

@Hey
Copy link
Contributor Author

Hey commented Mar 31, 2023

good first issue imo

@transmissions11 transmissions11 added the good first issue Good for newcomers label Mar 31, 2023
@transmissions11
Copy link
Member

fosho— def has confused some ppl

@AdamSchinzel
Copy link
Contributor

I can take this.

I was also thinking about the options that are there. I would say that we need to check it every time not only when used firstly pastes API key or later changed it because if initially his API didn't have access to GPT-4 but later on they were granted access, we may not be aware of that.

I think it will be also nice to only disable it in the list of option and provide link where to join the waitlist.

@transmissions11
Copy link
Member

transmissions11 commented Apr 1, 2023

nice, this all sounds right to me, though i lean towards reducing complexity wherever possible — so maybe we dont block off GPT-4 in the dropdown but just check when they select it, and show a toast or something saying "you don't have access to this model, click here to sign up for the waitlist" etc?

@AdamSchinzel
Copy link
Contributor

AdamSchinzel commented Apr 1, 2023

Sounds great!

I will also add check that if someone without access to GPT-4 but with GPT-4 selected will automatically roll on GPT-3.5-turbo.

@AdamSchinzel
Copy link
Contributor

Just want to let I will have time to work on this on weekend, if someone wants he can pick it up

@nmandal
Copy link

nmandal commented May 1, 2023

@AdamSchinzel happy to take this one over if you haven't started working on it yet!

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

No branches or pull requests

4 participants