Perplexity's Code Mode: model writes JS programs to batch tool calls, replacing one-by-one JSON
AravSrinivas · x · 2026-12-04
Perplexity's Arav Srinivas argues that as smaller models get better at writing short glue code, programmatic tool calling will replace one-by-one tool calls as the default. The analogy: treat the LLM as the CPU, context as scarce RAM, disk as storage, and tools as I/O — one-by-one JSON tool calling is synchronous blocking I/O where every raw byte gets copied into RAM. Code Mode + embedded QuickJS + execwait moves the agent loop closer to an actual OS kernel: deterministic loops and filtering run outside the neural net, raw state sits on disk, and slow I/O runs asynchronously.
Usage: add {"type": "programmatictoolcalling"} to the tools array of a POST /v1/agent request, and put programmatic in each tool's allowedcallers; the xhigh and ultra effort levels enable it automatically. One program can call a tool per list item in parallel, chain outputs into the next call, and filter results before returning to the model. Without an effort level, set maxsteps (reading program output then writing a new program takes two or more steps). Note that Python SDK 0.50.0 and the JS SDK 0.45.0 lack Code Mode types — official examples send HTTP requests directly.
Related event: Perplexity Code Mode Cuts Task Costs by Up to 53% While Boosting Accuracy(4 posts)→
More from coding & agent
- Cognition raises $3B+ at $78B valuation as revenue hits $1.4B run-rate — ns123abc · 2026-12-04
- GitHub launches public preview of SHA-256 Git repositories, a more secure default-to-be — 0xkarasy · 2026-12-04
- Datadog engineers watch Luna and Claude Opus play RollerCoaster Tycoon — dylan_ebert_ · 2026-12-04
- Claude only reads secondhand page summaries — Elicit's fix: give the model full texts — jungofthewon · 2026-12-04
- "One ephemeral environment per command or test": why median cloud env lifetime is under a minute — charliermarsh · 2026-12-04
- Code Mode exposes all Agent API tools through a single typed tools.* interface — AravSrinivas · 2026-12-04