Skip to main content

Perplexity plugin for LiveKit Agents

Support for Perplexity LLMs via the OpenAI-compatible chat completions endpoint at https://api.perplexity.ai.

See https://docs.livekit.io/agents/models/llm/perplexity/ for more information.

Installation

pip install livekit-plugins-perplexity

Pre-requisites

You'll need an API key from Perplexity. It can be passed directly or set as the PERPLEXITY_API_KEY environment variable.

Usage

from livekit.plugins import perplexity

llm = perplexity.LLM(
    model="sonar-pro",
    # api_key picked up from PERPLEXITY_API_KEY if omitted
)

The plugin reuses the OpenAI plugin's chat completions transport with base_url="https://api.perplexity.ai" and forwards an X-Pplx-Integration attribution header on every outgoing request.

Agent API usage

Perplexity's Agent API is compatible with OpenAI's Responses API and is available through the perplexity.responses submodule.

from livekit.plugins import perplexity

llm = perplexity.responses.LLM(
    model="perplexity/sonar",
    # api_key picked up from PERPLEXITY_API_KEY if omitted
)

The Responses LLM uses base_url="https://api.perplexity.ai/v1", disables websocket transport, and sends the same X-Pplx-Integration attribution header on its OpenAI-compatible client.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

livekit_plugins_perplexity-1.6.5.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

livekit_plugins_perplexity-1.6.5-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file livekit_plugins_perplexity-1.6.5.tar.gz.

File metadata

File hashes

Hashes for livekit_plugins_perplexity-1.6.5.tar.gz
Algorithm Hash digest
SHA256 75138638a9169b459f261bd9a20171ca713cf6499202c96489fbafcd87fe40e8
MD5 fc2733bcf2426841e500493967b407c1
BLAKE2b-256 48702da16f21e33c36e29d8eeecca721d8a3bb5697607688488f3b15a49610c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_perplexity-1.6.5.tar.gz:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file livekit_plugins_perplexity-1.6.5-py3-none-any.whl.

File metadata

File hashes

Hashes for livekit_plugins_perplexity-1.6.5-py3-none-any.whl
Algorithm Hash digest
SHA256 4a580e625def201bdb95f5a612432590886c5d10e5c4618016d9c073011d30cc
MD5 8f95fea5e07314db87099700b982d5a6
BLAKE2b-256 828472a3253b39462de7761e2e94264bc3fbc219302ae5ea5638b4d9a927f338

See more details on using hashes here.

Provenance

The following attestation bundles were made for livekit_plugins_perplexity-1.6.5-py3-none-any.whl:

Publisher: publish.yml on livekit/agents

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page