Skip to content

feat(perplexity-agent): sync models with current Agent API catalog#3194

Open
w3nash wants to merge 3 commits into
anomalyco:devfrom
w3nash:feat/update-perplexity-agent-models
Open

feat(perplexity-agent): sync models with current Agent API catalog#3194
w3nash wants to merge 3 commits into
anomalyco:devfrom
w3nash:feat/update-perplexity-agent-models

Conversation

@w3nash

@w3nash w3nash commented Jul 11, 2026

Copy link
Copy Markdown

Summary

Updates the perplexity-agent provider to match the current Perplexity Agent API Models catalog. The provider was outdated: it listed models Perplexity no longer serves and was missing the current lineup.

Final catalog: 33 models.

Changes

Removed (3) — no longer in the Agent API catalog:

  • google/gemini-2.5-flash
  • google/gemini-2.5-pro
  • xai/grok-4-1-fast-non-reasoning

Added (18) — each via base_model inheritance + local [cost] (docs Agent API rates) + model-specific reasoning metadata where applicable:

  • Anthropic: claude-opus-4-8, claude-sonnet-5
  • OpenAI: gpt-5, gpt-5.4-mini, gpt-5.4-nano, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna
  • Google: gemini-3.1-flash-lite, gemini-3.1-flash-lite-preview, gemini-3.5-flash
  • xAI: grok-4.5, grok-4.3, grok-4.20-reasoning, grok-4.20-non-reasoning, grok-4.20-multi-agent
  • Z.AI: perplexity/glm-5.2 (base_model zhipuai/glm-5.2)
  • Moonshot: perplexity/kimi-k2.7-code (base_model moonshotai/kimi-k2.7-code)

Pricing is taken from the Agent API Models page. The docs encode each model's cache field one of three ways (per the page's cacheEncoding note), and cache_read is transcribed accordingly:

  • a flat number → used verbatim (e.g. glm-5.2 0.26, kimi-k2.7-code 0.19, grok-4.5 0.50, grok-4.3/grok-4.20-* 0.20)
  • inputx0.1 (90% off input) → cache_read = input × 0.1
  • null → no cache_read

Reasoning audit

The Agent API accepts reasoning.effort values low, medium, high, xhigh, and max, but the global request schema does not establish that every routed model implements every value. The added models now use the intersection of Perplexity's request enum and each model's documented controls:

Reasoning options Models
low, medium, high, xhigh, max anthropic/claude-opus-4-8, anthropic/claude-sonnet-5, openai/gpt-5.6-sol, openai/gpt-5.6-terra, openai/gpt-5.6-luna, perplexity/glm-5.2
low, medium, high, xhigh openai/gpt-5.4-mini, openai/gpt-5.4-nano, xai/grok-4.20-multi-agent
low, medium, high openai/gpt-5, google/gemini-3.1-flash-lite, google/gemini-3.1-flash-lite-preview, google/gemini-3.5-flash, xai/grok-4.3, xai/grok-4.5
reasoning_options = [] perplexity/kimi-k2.7-code, xai/grok-4.20-reasoning
omitted (reasoning = false) xai/grok-4.20-non-reasoning

Notes:

  • Kimi K2.7 Code always reasons, but its API does not expose selectable effort levels.
  • Grok 4.20 Reasoning is a reasoning model, but its model page does not document selectable effort levels.
  • For Grok 4.20 Multi-Agent, reasoning.effort selects 4 or 16 collaborating agents rather than reasoning depth; the request values are still represented as an effort option because that is the exposed API field.
  • GLM-5.2 accepts all five Perplexity effort values; Z.AI maps low/medium to high and xhigh to max internally.
  • No provider-native toggle or token-budget control is claimed because the Agent API only exposes the unified effort field.

Evidence

Docs verified on 2026-07-11.

Notes

  • The perplexity/-prefixed IDs for GLM and Kimi match the Agent API model IDs a caller sends; base_model points at the origin-provider metadata (zhipuai/glm-5.2, moonshotai/kimi-k2.7-code).
  • The 3 removed models are deleted rather than marked deprecated because they are absent from the current authoritative catalog.
  • Each new file carries leading, sync-safe source citations above the first key.

Verification

  • bun validate exits 0.
  • git diff --check exits 0.
  • Generated perplexity-agent output contains no base_model leakage.

@github-actions

Copy link
Copy Markdown
Contributor

Action items

  • [medium] [possible mistake] providers/perplexity-agent/models/perplexity/glm-5.2.toml:11 (also perplexity/kimi-k2.7-code.toml:11, xai/grok-4.5.toml:11, xai/grok-4.3.toml:11, xai/grok-4.20-reasoning.toml:11, xai/grok-4.20-non-reasoning.toml:7, xai/grok-4.20-multi-agent.toml:12) - Check: cache_read values must match the cited Agent API Models page. Why: The PR body states the cache conversion rule cache_read = input × 0.1, and 11 of the 18 new models follow it (as do all retained existing models), but these 7 do not: glm-5.2 (0.26 ≈ 18.6% of input), kimi-k2.7-code (0.19 = 20%), grok-4.5 (0.50 = 25%), and grok-4.3/grok-4.20-reasoning/grok-4.20-non-reasoning/grok-4.20-multi-agent (0.20 = 16%). If the 10% rule applies uniformly, these cache prices are wrong; if the docs publish explicit per-model cache prices for these third-party models, the PR body's conversion description is incomplete and should say so. Action: Verify each of these 7 cache_read values against the cited docs and either correct them to input × 0.1 or clarify in the PR body what per-model cache pricing the docs specify for them.

@w3nash

w3nash commented Jul 11, 2026

Copy link
Copy Markdown
Author

Verified all 7 against the Agent API Models docs. The cache_read values are correct as committed; the PR body's description was the thing that was incomplete, and I've now fixed it.

The docs cache field uses three encodings (per the page's cacheEncoding note):

  • flat number → used verbatim
  • inputx0.1 → 90% off input (cache_read = input × 0.1)
  • null → no cache pricing

The 7 flagged models publish explicit flat cache rates, which is exactly what's in the TOMLs:

Model docs cache cache_read
perplexity/glm-5.2 0.26 0.26 ✅
perplexity/kimi-k2.7-code 0.19 0.19 ✅
xai/grok-4.5 0.50 0.50 ✅
xai/grok-4.3 0.20 0.20 ✅
xai/grok-4.20-reasoning 0.20 0.20 ✅
xai/grok-4.20-non-reasoning 0.20 0.20 ✅
xai/grok-4.20-multi-agent 0.20 0.20 ✅

The input × 0.1 rule only applies to the models whose docs cache field is literally "inputx0.1" (the gemini flash-lite variants and the three gpt-5.6 models). The PR body previously implied the 10% rule was uniform — it now describes all three encodings and notes that the third-party (Z.AI / Moonshot / xAI) models carry the docs' explicit flat rates. No TOML changes needed.

@rekram1-node

Copy link
Copy Markdown
Collaborator

every single one supports max? Im surprised by that

@w3nash

w3nash commented Jul 11, 2026

Copy link
Copy Markdown
Author

I checked the upstream docs, and no, not every model supports max. I had applied Perplexity's global effort enum too broadly.

I've now matched each model to the effort values it actually supports. GPT-5.6, the new Claude models, and GLM-5.2 support all five; the others use smaller sets or no configurable effort. I also added the relevant sources to each model file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants