Skip to main content

Perplexity

Bad API Key.

Error Message Looks Like This

Exception:
401 Authorization Required
openresty/1.21.4.3

Reason

Old, expired, or otherwise invalid API Key. Copy-pasted the API Key from the wrong Provider?

Solution

Fix the API Key.

Bad Model Name

Error Message Looks Like This

Exception: Error code: 400 - {'error': {'message': "Invalid model 'mixtral-8x7b-instructXXX'. Permitted models can be found in the documentation at https://docs.perplexity.ai/docs/model-cards.", 'type': 'invalid_model', 'code': 400}}

Reason

The model name must be exactly as published by the Inference Provider.

Solution

Fix the model name.

Bad Parameter

Error Message Looks Like This

Exception: Error code: 400 - {'error': {'message': 'Requested 999999999999 to generate tokens, following a prompt of length 32, which exceeds the max limit of 16384 tokens.', 'type': 'requestedtoomany_tokens', 'code': 400}}

Reason

The model name must be exactly as published by the Inference Provider.

Solution

Examine the parameter list. Not all providers use the same parameters, and not all models have the same parameters available.

Bad ProviderUrl

Error Message Looks Like This

Exception: Error code: 404

Reason

This should not happen if the model was configured through the UI. Were you messing with the configuration JSON file directly?

Solution

Review all settings. Delete and recreate the model.

Corrupted API Template.

Error Message Looks Like This

Inference Failure. provider: 'PerplexityXXX' not found. Most likely due to corrupted API template.

Reason

Solution

Delete and recreate the model. Or revert to the backup of the JSON configuration that you made before messing with it.