Skip to main content

Perplexity's Agent API as a model for Simon Willison's llm CLI.

Project description

llm-perplexity-agent

Perplexity's Agent API — multi-step web research with citations — as a model for Simon Willison's llm CLI.

llm install llm-perplexity-agent
llm keys set perplexity        # skip if you already set this for llm-perplexity
llm -m perplexity-agent 'What changed in MCP 2026-07-28?'

Why

llm-perplexity wraps Perplexity's older Sonar chat models. This wraps the Agent API (POST /v1/agent) — the multi-step endpoint that runs its own searches, fetches pages, and synthesizes one cited answer. Different product, different endpoint.

Options

llm -m perplexity-agent -o preset xhigh -o recency week 'Latest on X'
llm -m perplexity-agent -o domains 'nasa.gov,-reddit.com' 'Artemis status'
llm -m perplexity-agent -o timeout 600 'Something genuinely deep'
Option Default Notes
preset medium fast, low, medium, high, xhigh, wide-research. Passed through unvalidated — Perplexity declares no enum, so a new preset works the day it ships.
recency hour, day, week, month, year
domains Comma-separated; prefix with - to exclude. Max 20.
timeout 300 Seconds before giving up.
spotlight false Wrap the answer as untrusted web content — see below.

Poll progress goes to stderr, so the answer pipes cleanly.

A note on prompt injection

Retrieved web content is untrusted, and this tool feeds it to a language model. The companion MCP server always wraps its answers in a delimiter marking them as untrusted data, because there the answer goes straight into a model that is holding tools — injected instructions could cause actions.

Here the answer goes to your terminal, and llm runs no tool loop by default, so that wrapping is off by default. Turn it on when the output is headed somewhere that matters:

llm -m perplexity-agent -o spotlight true 'Research X' | llm -m gpt-5 'Summarise'

It is a mitigation, not a fix. See SECURITY.md.

Sibling

This is one of two adapters over the same client. The other is perplexity-agent-mcp, an MCP server for Claude Desktop, Claude Code, VS Code and other MCP clients. Both are released together at the same version from one repository.

BSD-3-Clause. Copyright (c) 2026, Constantin Gonzalez.

Project details


Download files

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

Source Distribution

llm_perplexity_agent-0.3.1.tar.gz (8.1 kB view details)

Uploaded Source

Built Distribution

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

llm_perplexity_agent-0.3.1-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

Details for the file llm_perplexity_agent-0.3.1.tar.gz.

File metadata

  • Download URL: llm_perplexity_agent-0.3.1.tar.gz
  • Upload date:
  • Size: 8.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for llm_perplexity_agent-0.3.1.tar.gz
Algorithm Hash digest
SHA256 98d549b6641b9dd27ec15e78648539de583acfd39e76ea0c86ba660f621ac987
MD5 fd28ac80eec7ef32ea4b14aaa1ffd6c3
BLAKE2b-256 12182b1a39fa50a89403e9a6d03337733a3d28ca9ee1b20a7c45ed85577b8274

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_perplexity_agent-0.3.1.tar.gz:

Publisher: publish.yml on zalez/perplexity-agent-mcp

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

File details

Details for the file llm_perplexity_agent-0.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_perplexity_agent-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4b239624cb4c93c64940de2049dcc2db72b7ebc4fb3dc87c5c9d9e09bbf15fc
MD5 f06e20b177f600600d3569a90717da8d
BLAKE2b-256 9a3e5faeddcda0fb3fcaafc521af2bc3f363c0a33106822f681380f72549fffd

See more details on using hashes here.

Provenance

The following attestation bundles were made for llm_perplexity_agent-0.3.1-py3-none-any.whl:

Publisher: publish.yml on zalez/perplexity-agent-mcp

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