From e9b0d9247be56e31c4e8f6f1192bfdd0e7bce876 Mon Sep 17 00:00:00 2001 From: James Liounis Date: Wed, 27 May 2026 15:07:03 -0400 Subject: [PATCH] feat(providers): add Perplexity as a declarative OpenAI-compatible provider (#9324) --- .../src/providers/declarative/perplexity.json | 21 +++++++++++++++++++ .../docs/getting-started/providers.md | 1 + 2 files changed, 22 insertions(+) create mode 100644 crates/goose/src/providers/declarative/perplexity.json diff --git a/crates/goose/src/providers/declarative/perplexity.json b/crates/goose/src/providers/declarative/perplexity.json new file mode 100644 index 0000000000..bcda340243 --- /dev/null +++ b/crates/goose/src/providers/declarative/perplexity.json @@ -0,0 +1,21 @@ +{ + "name": "perplexity", + "engine": "openai", + "display_name": "Perplexity", + "description": "Chat models with built-in real-time web search grounding", + "api_key_env": "PERPLEXITY_API_KEY", + "base_url": "https://api.perplexity.ai", + "models": [ + { "name": "sonar", "context_limit": 128000 }, + { "name": "sonar-pro", "context_limit": 128000 }, + { "name": "sonar-reasoning", "context_limit": 128000 }, + { "name": "sonar-reasoning-pro", "context_limit": 128000 } + ], + "supports_streaming": true, + "model_doc_link": "https://docs.perplexity.ai/docs/getting-started", + "setup_steps": [ + "Go to https://www.perplexity.ai/account/api/keys", + "Create or copy an existing API key", + "Paste the key above as PERPLEXITY_API_KEY" + ] +} diff --git a/documentation/docs/getting-started/providers.md b/documentation/docs/getting-started/providers.md index 90367355c7..570a01b00d 100644 --- a/documentation/docs/getting-started/providers.md +++ b/documentation/docs/getting-started/providers.md @@ -45,6 +45,7 @@ goose is compatible with a wide range of LLM providers, allowing you to choose a | [Ollama Cloud](https://ollama.com/) | Access hosted models on ollama.com via OpenAI-compatible API. Requires an Ollama account and API key. | `OLLAMA_CLOUD_API_KEY` | | [OpenAI](https://platform.openai.com/api-keys) | Provides gpt-4o, o1, and other advanced language models. Also supports OpenAI-compatible endpoints (e.g., self-hosted LLaMA, vLLM, KServe). **o1-mini and o1-preview are not supported because goose uses tool calling.** | `OPENAI_API_KEY`, `OPENAI_HOST` (optional), `OPENAI_ORGANIZATION` (optional), `OPENAI_PROJECT` (optional), `OPENAI_CUSTOM_HEADERS` (optional) | | [OpenRouter](https://openrouter.ai/) | API gateway for unified access to various models with features like rate-limiting management. | `OPENROUTER_API_KEY` | +| [Perplexity](https://www.perplexity.ai/) | Chat models with built-in real-time web search grounding. OpenAI-compatible chat completions API at `https://api.perplexity.ai`. | `PERPLEXITY_API_KEY` | | [OVHcloud AI](https://www.ovhcloud.com/en/public-cloud/ai-endpoints/) | Provides access to open-source models including Qwen, Llama, Mistral, and DeepSeek through AI Endpoints service. | `OVHCLOUD_API_KEY` | | [Ramalama](https://ramalama.ai/) | Local model using native [OCI](https://opencontainers.org/) container runtimes, [CNCF](https://www.cncf.io/) tools, and supporting models as OCI artifacts. Ramalama API is a compatible alternative to Ollama and can be used with the goose Ollama provider. Supports Qwen, Llama, DeepSeek, and other open-source models. **Because this provider runs locally, you must first [download and run a model](#local-llms).** | `OLLAMA_HOST` | | [Routstr](https://routstr.com/) | OpenAI-compatible aggregator that fronts dozens of upstream providers (Anthropic, OpenAI, Google, DeepSeek, Llama, …) behind a single API. Authenticate with an `sk-...` bearer issued by your Routstr instance — payment is handled outside goose. | `ROUTSTR_API_KEY`, `ROUTSTR_HOST` (optional, default `https://api.routstr.com`) |