paper-qa icon indicating copy to clipboard operation
paper-qa copied to clipboard

Error Code 404

Open thedimpop opened this issue 1 year ago • 4 comments

Not sure what I'm doing wrong but this is the error message I get when trying to run pqa ask:

NotFoundError: litellm.NotFoundError: OpenAIException - Error code: 404 - {'error': {'message': 'The model gpt-4o-2024-08-06 does not exist or you do not have access to it.', 'type': 'invalid_request_error', 'param': None, 'code': 'model_not_found'}} Received Model Group=gpt-4o-2024-08-06 Available Model Group Fallbacks=None

thedimpop avatar Sep 13 '24 19:09 thedimpop

Hey @thedimpop! I'm here to assist you with any bugs, questions, or contributions you have. Let's work on solving this together!

The error message indicates that the model gpt-4o-2024-08-06 does not exist or you do not have access to it. This could be due to a typo in the model name or a lack of permissions to access the specified model.

To resolve this issue, you can try the following steps:

  1. Check the Model Name: Ensure that the model name gpt-4o-2024-08-06 is correct and exists in the list of available models.

  2. Update the Model Configuration: If the model name is incorrect or unavailable, update the model configuration in your settings. You can specify a different model that you have access to. For example:

    from paperqa import Settings, ask
    
    answer = ask(
        "What manufacturing challenges are unique to bispecific antibodies?",
        settings=Settings(
            llm="gpt-4o-mini", summary_llm="gpt-4o-mini", paper_directory="my_papers"
        ),
    )
    
  3. Check Permissions: Ensure that you have the necessary permissions to access the specified model. If you are using a service like OpenAI, verify that your API key has access to the model.

  4. Fallback Mechanism: Implement a fallback mechanism to handle cases where the specified model is not found. This can be done by catching the NotFoundError and using an alternative model. For example:

    try:
        answer = ask(
            "What manufacturing challenges are unique to bispecific antibodies?",
            settings=Settings(
                llm="gpt-4o-2024-08-06", summary_llm="gpt-4o-2024-08-06"
            ),
        )
    except litellm.NotFoundError:
        answer = ask(
            "What manufacturing challenges are unique to bispecific antibodies?",
            settings=Settings(
                llm="gpt-4o-mini", summary_llm="gpt-4o-mini"
            ),
        )
    

By following these steps, you should be able to resolve the NotFoundError and successfully run the pqa ask command.

To continue talking to Dosu, mention @dosu.

dosubot[bot] avatar Sep 13 '24 20:09 dosubot[bot]

Do you have funds added to the account associated with the OpenAI API key? If yes, I would try creating a new key and testing with it.

taabishm2 avatar Sep 13 '24 21:09 taabishm2

@taabishm2 thank you. I'm making progress. Now looks like I'm hitting 30k TPM limit even when only 1 paper is in the folder. Relevant Papers=1 | Current Evidence=14, but the answer is blank. Is 30k TPM not enough to process such request?

thedimpop avatar Sep 13 '24 22:09 thedimpop

Hi @thedimpop we are working on figuring out rate limits in https://github.com/Future-House/paper-qa/issues/377

Since it looks like your OpenAI key issue is resolved here, do you mind if I consolidate the TPM limit stuff on https://github.com/Future-House/paper-qa/issues/377?

jamesbraza avatar Sep 19 '24 01:09 jamesbraza

This should be fixed by latest release and setting to use tier1_limits (or equiv tier)

whitead avatar Oct 09 '24 16:10 whitead