pplx-proxy AGENTS.md

pplx-proxy AGENTS.md is an instructions file for Codex, OpenCode from jamie950315/pplx-proxy. It costs 7,415 tokens per session, scanned B, original, MIT.

Repository instructions for pplx-proxy, a self-hosted service that forwards requests to Perplexity.ai and exposes them through an OpenAI-compatible API and MCP, a standard for connecting AI tools to applications.

In plain words
What is it for?
Use it when modifying the FastAPI server, request translation, streaming responses, model discovery, session keep-alive tasks, or account-tier filtering.
Why use it?
It gives a coding agent the system’s architecture, model access rules, and important request settings so changes are made with the proxy’s constraints in mind.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/jamie950315/pplx-proxy/agents-md
Clone the repo
git clone --depth 1 https://github.com/jamie950315/pplx-proxy

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pplx-proxy AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/jamie950315/pplx-proxy/agents-md.svg)](https://agentmods.dev/instructions/jamie950315/pplx-proxy/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/jamie950315/pplx-proxy/agents-md"><img src="https://agentmods.dev/badge/instructions/jamie950315/pplx-proxy/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 7,415 This file is loaded in full into every session.
When invoked 7,415 The same file — it is already loaded in full.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.07415 $0.07415
Opus 5 $0.03707 $0.03707
Sonnet 5 $0.01483 $0.01483
Haiku 4.5 $0.00741 $0.00741

Measured today against content hash cc1ce8197fe1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

pplx-proxy AGENTS.md scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured today.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Sends data to an external URLmediumData exfiltration

A POST to an outside endpoint may be telemetry or may be exfiltration; either way the mod talks to somewhere, and you should know where.

curl -X POST /admin/update-models -d '{"models":{"new":["pro","pref"]},"merge":true}'

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST /admin/update-models -d '{"models":{"new":["pro","pref"]},"merge":true}'
AGENTS.md · 647 lines

How it starts

The opening of the file, as written. The whole thing — 647 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md

What This Is

pplx-proxy is a self-hosted reverse proxy for Perplexity.ai. Uses your Pro/Max subscription cookie to access all models through OpenAI-compatible REST API and MCP server.

Architecture

Single FastAPI app (server.py, ~1750 lines) that:

  1. Receives OpenAI-format chat/completions or MCP requests
  2. Translates to Perplexity's internal SSE (POST /rest/sse/perplexity_ask)
  3. Uses curl_cffi with Chrome TLS fingerprinting to bypass Cloudflare
  4. Streams responses back in OpenAI SSE or MCP format
  5. Background tasks: session keep-alive (6h) + model discovery (24h)

Critical parameter: search_focus: "internet" must be set in requests to Perplexity. Without it, Perplexity defaults to "writing" mode and models will say "I cannot access real-time data" even though search results are found.

Key Concepts

Account Tiers (ACCOUNT_TYPE in .env):

  • free: only auto
  • pro: all models except Opus
  • max: all models including Opus
  • Tier filtering applies to API, MCP, model listing, and discovery

Model Map: dict of {model_id: (mode, internal_pref)}. Loaded from .models.json (persisted) or defaults. Filtered by tier at runtime.

Thinking Variants: activated via thinking: true or reasoning_effort != "none". Maps from _THINKING_MAP (e.g., gpt → gpt56_terra_thinking, sonnet → claude50sonnetthinking). Perplexity does NOT expose internal thinking blocks — reasoning_content is populated from search steps (queries, URLs, plan goals).

Context Management: request payloads are assembled as JSON with instructions / history / query. Total query capped at 96K chars (~32K tokens). Consecutive same-role messages deduped (keeps last — fixes LibreChat branch artifacts). Generic clients still use whitelist-filtered system prompts from .prompt_whitelist.txt, but LobeHub requests now discard upstream system/developer prompt content entirely and prepend local CUSTOM_PROMPTS on every turn.

Session Continuity: the proxy tracks Perplexity's backend_uuid per conversation turn. On follow-up turns (detected by hashing conversation history), only the raw user query is sent with last_backend_uuid — no instructions, no history. Perplexity's server-side session memory handles context. Sessions expire after 1 hour. Falls back to full payload on cache miss.

Read the full file on GitHub · 647 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. today Changed · +8 lines · +212 tokens per session cc1ce8197fe1
  2. 4d ago First seen · 639 lines · 7,203 tokens per session scan B 88f4b0fc4795

Subscribe to this mod's changes

pplx-proxy AGENTS.md is an instructions file published in the GitHub repository jamie950315/pplx-proxy (22 stars, last pushed yesterday), licensed MIT. It adds 7,415 tokens to every session, about $0.0371 per session on Opus 5. A static security scan graded it B with 2 findings (sends data to an external url, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens