Skip to content

Add Perplexity as a model provider#5095

Open
jliounis wants to merge 1 commit intoAider-AI:mainfrom
jliounis:add-perplexity-provider
Open

Add Perplexity as a model provider#5095
jliounis wants to merge 1 commit intoAider-AI:mainfrom
jliounis:add-perplexity-provider

Conversation

@jliounis
Copy link
Copy Markdown

Summary

Adds Perplexity as a first-class model provider in Aider, mirroring the OpenRouter integration pattern. Perplexity exposes an OpenAI-compatible Agent API at https://api.perplexity.ai, which LiteLLM already supports under the perplexity/ provider prefix.

The default model in all examples is perplexity/sonar-pro.

Files changed

  • aider/website/docs/llms/perplexity.md — new provider docs page (mirrors openrouter.md)
  • aider/resources/model-settings.yml — model entries for sonar, sonar-pro, sonar-reasoning, sonar-reasoning-pro, sonar-deep-research
  • aider/onboarding.pyPERPLEXITY_API_KEYperplexity/sonar-pro in default-model auto-selection
  • aider/models.pyperplexity provider added to fast_validate_environment keymap
  • tests/basic/test_onboarding.py — coverage for Perplexity env-var detection
  • tests/basic/test_models.py — coverage for the new model-settings entries

Available models

  • perplexity/sonar
  • perplexity/sonar-pro (default)
  • perplexity/sonar-reasoning
  • perplexity/sonar-reasoning-pro
  • perplexity/sonar-deep-research

Test plan

  • pytest tests/basic/test_onboarding.py tests/basic/test_models.py — all pass
  • Full tests/basic/ suite passes (only the pre-existing test_voice.py failures from this sandbox's missing sound device are unrelated)
  • aider --model perplexity/sonar-pro resolves the new model settings

References: https://docs.perplexity.ai

Mirrors the OpenRouter integration pattern: docs page, model-settings
entries for Sonar models, env-var detection in onboarding and
fast_validate_environment, and tests.

Perplexity exposes an OpenAI-compatible Agent API at
https://api.perplexity.ai, which LiteLLM already supports under the
`perplexity/` provider prefix. Default model is `sonar-pro`.

Files:
- aider/website/docs/llms/perplexity.md (new docs page)
- aider/resources/model-settings.yml (sonar, sonar-pro,
  sonar-reasoning, sonar-reasoning-pro, sonar-deep-research)
- aider/onboarding.py (PERPLEXITY_API_KEY -> perplexity/sonar-pro)
- aider/models.py (perplexity provider in fast_validate_environment)
- tests/basic/test_onboarding.py + tests/basic/test_models.py
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


james-pplx seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants