Skip to main content
The Perplexity model provides access to Perplexity’s language models.

Parameters

ParameterTypeDefaultDescription
idstr"llama-3.1-sonar-small-128k-online"The id of the Perplexity model to use
namestr"Perplexity"The name of the model
providerstr"Perplexity"The provider of the model
api_keyOptional[str]NoneThe API key for Perplexity (defaults to PERPLEXITY_API_KEY env var)
base_urlstr"https://api.perplexity.ai"The base URL for the Perplexity API
retriesint0Number of retries to attempt before raising a ModelProviderError
delay_between_retriesint1Delay between retries, in seconds
exponential_backoffboolFalseIf True, the delay between retries is doubled each time
Perplexity extends the OpenAI-compatible interface and supports most parameters from OpenAI.