feat(providers): add Perplexity as a supported model provider#8920
feat(providers): add Perplexity as a supported model provider#8920jliounis wants to merge 1 commit intoaaif-goose:mainfrom
Conversation
Adds Perplexity as an OpenAI-compatible chat completions provider, modeled on the xAI provider. Perplexity's chat models are natively grounded in real-time web search, which is a natural fit for a developer agent. - crates/goose/src/providers/perplexity.rs (new): PerplexityProvider using OpenAiCompatibleProvider with base URL https://api.perplexity.ai. Accepts PERPLEXITY_API_KEY (canonical) or PPLX_API_KEY (alias). - crates/goose/src/providers/{init,mod}.rs: register provider. - crates/goose/tests/providers.rs: integration smoke test entry. - documentation/docs/getting-started/providers.md: provider table row.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ad7f68986
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| PERPLEXITY_KNOWN_MODELS.to_vec(), | ||
| PERPLEXITY_DOC_URL, | ||
| vec![ | ||
| ConfigKey::new("PERPLEXITY_API_KEY", true, true, None, true), |
There was a problem hiding this comment.
Mark PPLX_API_KEY as a valid configured credential
from_env explicitly accepts PPLX_API_KEY as a fallback, but metadata declares only PERPLEXITY_API_KEY as the required secret. Configuration status is computed from metadata via default_inventory_configured (crates/goose/src/providers/inventory/mod.rs), and exposed through provider_config_status (crates/goose/src/acp/server.rs), so users who set only PPLX_API_KEY will still be reported as unconfigured (and can be filtered out in configured-provider flows) even though runtime auth would succeed. Please add alias-aware configured checks (or include the alias in required-key semantics) so status matches actual provider behavior.
Useful? React with 👍 / 👎.
Summary
Adds Perplexity as a supported model provider in
crates/goose/src/providers/, mirroring the layout of the existing xAI provider (xai.rs).Perplexity's chat completions API is OpenAI-compatible (
https://api.perplexity.ai), so the provider is a thinProviderDefthat returns anOpenAiCompatibleProviderconfigured with bearer-token auth. Its chat models ship with built-in real-time web search grounding, which is a natural fit for a developer agent that frequently needs to ground answers in current information.What's added
crates/goose/src/providers/perplexity.rs(new) —PerplexityProvider:https://api.perplexity.ai(configurable viaPERPLEXITY_HOST)PERPLEXITY_API_KEY(canonical) →PPLX_API_KEY(alias used by Perplexity's SDKs) → errorsonar-pro. Known models:sonar,sonar-pro,sonar-reasoning,sonar-reasoning-pro(users can overrideGOOSE_MODELto point at any other model the API accepts)crates/goose/src/providers/mod.rs— registerpub mod perplexity;crates/goose/src/providers/init.rs— registerPerplexityProviderin the registry (default-off, matching xAI/Venice)crates/goose/tests/providers.rs—test_perplexity_providersmoke test entry following the sameProviderTestConfig::with_llm_providershape astest_xai_providerdocumentation/docs/getting-started/providers.md— Perplexity row added to the provider matrixTests
5 unit tests in
crates/goose/src/providers/perplexity.rs(alongside provider source, matching the convention used byvenice.rs):test_metadata_structure— checks name, display_name, default_model, model_doc_link, and bothConfigKeys (PERPLEXITY_API_KEYrequired+secret+primary,PERPLEXITY_HOSTwith default).test_known_models_non_empty— default model is included in the known list.test_setup_steps_present— onboarding steps referencePERPLEXITY_API_KEY.test_default_model_is_known.test_doc_url_points_to_perplexity_docs.Plus 1 integration test entry (
test_perplexity_provider) incrates/goose/tests/providers.rs, which the existing test harness skips whenPERPLEXITY_API_KEYisn't set (same pattern as every other LLM provider here).Validation
References
crates/goose/src/providers/xai.rs.