Skip to content

Add Perplexity as an OpenAI-compatible provider #3021

Description

@atresvilanova-pplx

Problem or Motivation

Odysseus already supports OpenAI-compatible chat providers (OpenAI, OpenRouter, Groq, etc.) by base URL. Perplexity's API (https://api.perplexity.ai) is OpenAI-compatible and offers web-grounded models (default sonar-pro) with citations, but it isn't recognized as a first-class provider, so it shows up as a generic endpoint without a proper label or provider-specific headers.

Proposed approach

Recognize api.perplexity.ai as a first-class provider in src/llm_core.py, mirroring the existing OpenRouter pattern:

  • _detect_provider: map the perplexity.ai host → perplexity
  • _provider_headers: send X-Pplx-Integration: odysseus/<APP_VERSION> via setdefault (mirrors the existing X-OpenRouter-Title convention; never clobbers caller headers)
  • _provider_label: add the "Perplexity" label

Default model sonar-pro is already present in model_context.py. Backend-only; the frontend already ships a Perplexity logo + endpoint label. Minimal diff (3 files), provider tests added.

Area

API / Backend

Notes

This is a focused, single-feature proposal. Per CONTRIBUTING's guidance on agent-assisted contributions, opening this issue first. A draft PR implementing exactly this is ready (#3015) and can be linked — happy to adjust or hold if you'd prefer a different shape before review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready for reviewDescription complete — ready for maintainer review

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions