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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llm_perplexity_agent-0.3.0.tar.gz.
File metadata
- Download URL: llm_perplexity_agent-0.3.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b8f613b5bacd3aff1ad778246d28256467dd9b3b417aba7017679217f88498b
|
|
| MD5 |
b382264cc06a2a60fcb604f04e16463e
|
|
| BLAKE2b-256 |
93f6b645a8fb9c825f57a887a23c940e391e6823d960a4eab439862d9c4205b0
|
Provenance
The following attestation bundles were made for llm_perplexity_agent-0.3.0.tar.gz:
Publisher:
publish.yml on zalez/perplexity-agent-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_perplexity_agent-0.3.0.tar.gz -
Subject digest:
4b8f613b5bacd3aff1ad778246d28256467dd9b3b417aba7017679217f88498b - Sigstore transparency entry: 2268121374
- Sigstore integration time:
-
Permalink:
zalez/perplexity-agent-mcp@3d68568ef9925afa4e77a4c968196293ed78af8f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/zalez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d68568ef9925afa4e77a4c968196293ed78af8f -
Trigger Event:
push
-
Statement type:
File details
Details for the file llm_perplexity_agent-0.3.0-py3-none-any.whl.
File metadata
- Download URL: llm_perplexity_agent-0.3.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04e414a1c05f77d63a576078f486a17d7952c3c3a6b4f43a96997202094c1ced
|
|
| MD5 |
55f124badc652b3dd3bb35a4f0f704bb
|
|
| BLAKE2b-256 |
b7350a0b79f963ef155fa6300e586c5ac553165b28523614624221a943e77ec4
|
Provenance
The following attestation bundles were made for llm_perplexity_agent-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on zalez/perplexity-agent-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
llm_perplexity_agent-0.3.0-py3-none-any.whl -
Subject digest:
04e414a1c05f77d63a576078f486a17d7952c3c3a6b4f43a96997202094c1ced - Sigstore transparency entry: 2268122116
- Sigstore integration time:
-
Permalink:
zalez/perplexity-agent-mcp@3d68568ef9925afa4e77a4c968196293ed78af8f -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/zalez
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3d68568ef9925afa4e77a4c968196293ed78af8f -
Trigger Event:
push
-
Statement type: