pinecallDocs
Testing / pinecall simulate

pinecall simulate

A persona calls the agent, written or out loud.

pinecall simulate --persona <name>… [--judge] [--turns n (15, 1 to 40)] [--voice] [--listen]
                  [--background-noise dB] [--ambience cafe] [--packet-loss 0.05] [--pause 0]
                  [--via webrtc|sip] [--delay ms] [--jitter ms] [--rate kbps]
                  [--goal "I want to move my Tuesday visit"] [--llm vendor/model] [--tts vendor] [--caller-voice id]
                  [--against stt=…,llm=…,tts=…,voice=…,end_of_turn=… | realtime=…]… [--repeats n (1, 1 to 10)]
                  [--report [dir]] [--floor 0.9] [--ceiling 1.5] [--baseline report.json] [--gate]
                  [--condition name[:knob=value,…]]… [--gate-under condition]…
                  [--agent <name>] [--file agent.tsx]

A model in the gateway plays the caller — every turn improvised from the persona's goal, its style and its own facts, with no script. One of Pinecall's personas is briefed first: the gateway gives it the one concrete thing it phones this agent about, in the agent's own terms, and keeps its manner (POST …/personas/{name}/brief, one eval), and prints what it calls about before the first line; a persona written for the agent is played as written. --goal says what the caller phones about yourself, in the first person, for any persona: nobody is briefed, and the manner, the facts and what it expects stay the persona's. --pause is the silence before each of the caller's lines on a spoken call, over the persona's own. The agent is whoever holds it — your pinecall start, a colleague's, production's with --prod; nothing is started here — this terminal prints the conversation, the gateway holds the provider keys.

Terminal
$ pinecall simulate --persona hurried --listen --turns 2
--listen is a call with audio in it: --voice is on
hurried · move the appointment to Tuesday afternoon, giving no more than needed
  listening as sup_edb03d90e627 · ffplay
› Clínica Norte, good morning.  How can I help you?
‹ Hi, I need to move my Thursday appointment with Dr. Vidal to Tuesday afternoon.
→ freeSlots({"day":"Tuesday"})
← freeSlots [{"when":"Tuesday at ten","doctor":"Dr. Vidal"},{…
› Here are Tuesday's free slots. …
call_6123e7d7deb875e2e9be7686 · 2 caller turns · 3 agent turns · a clean line · llm_node_ttft 1681ms
  → pinecall sessions call_6123e7d7deb875e2e9be7686 reads it whole

Each turn's latencies are left off the transcript and summed up on its last line; PINECALL_DEBUG=1 prints them a turn at a time. With --judge the score follows: how many judges broke of how many held or broke, the ones that broke with their reason and the lines they cite (#30), the ones that held by name, and the ones that did not apply on one line.

--persona names one of the agent's callers, kept by the gateway — not a file of the project — so --agent <slug> simulates an agent from any folder, one built in Studio too (pinecall personas list --agent <slug> names its callers). The model that plays it is the persona's own llm when it set one; with --judge, a caller that wrote a rule adds a persona row to the score — held when it hung up satisfied, broken when it declined, which is exit 1 like any broken judge.

--voice is a real line: a room, the agent dispatched into it as a phone call is — at whoever holds its line (line), the pinecall start that holds the agent or production's process with --prod — and the caller read out in the persona's own tts and voice when it set them — else the platform's default voice vendor and a voice from the operator's list for the agent's language that the agent does not have (English's when that language has none), so the two sides are told apart by ear. The caller waits for the opening to be said before its first line, as a person does. --background-noise, --ambience and --packet-loss spoil that line on purpose and are refused without it: --background-noise is dB under the caller of what plays behind it, --ambience which of television, cafe, office and street plays (the persona's own unless said); --packet-loss is the share of the caller's packets that never arrive, from 0 to 1, as test takes it.

--via sip has the caller ring the agent by phone instead of sitting in its room: the caller's own room dials a leg over SIP to the sandbox's SIP service, in a carrier's codec (G.711 µ-law at 8 kHz), and that leg lands in the call's room. The agent answers a phone call — the phone channel, a SIP leg for a caller, a hang-up that is a BYE — at the number it answers in the sandbox, or at the box's test line when it answers at none (neither: refused, 409). No carrier is in it and nothing is billed by one. The sandbox's alone, on a deployment whose envs have a SIP service each (503 otherwise); --via webrtc is the room, and what is used when the flag is left out.

--delay, --jitter and --rate are the network the caller's packets cross, with --packet-loss: every packet held --delay milliseconds (0 to 2000), each one's hold moved up to --jitter milliseconds either way (0 to 500), and the line carrying --rate kilobits a second (8 or more; a voice needs about 64, and under it the line's queue drops what would wait past 300 ms). They are done to the call's real packets, each way, by a relay inside the gateway the caller is routed through — so a lost packet is one the room never got, concealed or asked for again as on a real path — and the caller hears each answer --delay late. The four, and --via, are a spoken call's and are refused without --voice, exit 2. The summary's line says what the call was placed on:

Terminal
$ pinecall simulate --persona in-a-hurry --voice --via sip --packet-loss 0.05 --delay 150 --jitter 40
…
call_6123e7d7deb875e2e9be7686 · 4 caller turns · 5 agent turns · a phone line, 5% packet loss, 150 ms delay ± 40 ms

--llm, --tts and --caller-voice play the caller on another model or voice for this run alone: --llm google/gemini-3.5-flash-lite, --tts google --caller-voice Puck. The persona keeps its own; a --tts without --caller-voice drops the persona's voice for one of that vendor's that the agent does not have. A model or a vendor the runtime lacks, or one nobody keyed for the org, is refused before the call opens, and so is a run past the org's simulations (429, and credits.exhausted on the agent's log): a refused run opens no call and counts nothing. The caller runs on the runtime's keys unless the org brought that vendor's; each run that opens counts as one simulation of the org's simulations from the moment its call begins (limits adds it when the call ends), and what its caller cost is kept with the call — the usage feed's caller_cost_usd; a written run keeps who played its caller too (runs names it).

--against runs the agent on other values for this run alone — stt=, llm=, tts=, voice=, language=, temperature=, end_of_turn= (stt, livekit, smart-turn), joined by commas: --against llm=groq/openai/gpt-oss-120b,tts=deepgram — as the console's test room does, whoever set what the agent runs on, the org or its class; a model or a voice named on another vendor leaves the first one's voice and options behind. realtime=vendor/model runs the call on a model that hears and speaks itself, in the place of the three (--against realtime=google/gemini-3.8-live): a spoken call's alone (400 without --voice), on the org's own key for that vendor as agent set --realtime is (409 on a key Pinecall lends, 503 where nobody holds one), both said before a call is placed. So a pipeline's models and the realtime ones are compared in one command, a --against each; a llm= named on an agent set on a realtime model takes that call off it. The agent's saved settings do not change, and the call keeps what it ran on. In the sandbox only, with a key that edits the pipeline (403 otherwise); a knob the test room does not have is refused. The gateway plays the caller then, written or spoken, and this terminal follows the call's log. Said twice or more, it is a comparison: the same caller against every configuration, placed together, judged as each one ends, and printed as one table best first — the caller's goal held, then every judge, then the most held, then the fastest reply, then the cheapest — one row per call with its judges, its reply, model, voice and hearing medians, its cost, its length and its call:

Terminal
$ pinecall simulate --persona hurried --voice --judge --against llm=groq/openai/gpt-oss-120b \
    --against llm=google/gemini-3.5-flash-lite --against llm=anthropic/claude-haiku-5-5,tts=deepgram
hurried · leave a message for the business: I am Ana García and the delivery for tomorrow has to come after 4 pm
cmp_7f3a1c9b2d4e · 3 calls placed · judged as each one ends
hurried against receptionist · 3 calls · best first
#  THE AGENT RUNS ON                                        JUDGES    REPLY    THINKS  SPEAKS  HEARS   COST     LENGTH  CALL
1  thinks groq/openai/gpt-oss-120b                          held 7/7  0.84 s   210 ms  120 ms  0 ms    $0.0091  41 s    call_…
2  thinks anthropic/claude-haiku-5-5 · speaks deepgram      held 7/7  1.12 s   480 ms  110 ms  0 ms    $0.0120  44 s    call_…
3  thinks google/gemini-3.5-flash-lite                      broke 6/7 1.31 s   620 ms  170 ms  0 ms    $0.0074  39 s    call_…
  → pinecall sessions <call> reads one whole

--repeats n rings the caller that many times under each configuration, 1 to 10, with or without --against: pinecall simulate --persona books-a-visit --judge --repeats 5 puts the same caller to the agent five times as it stands. One call tells whether the agent can do a task; several tell how often it does. --persona said again is another caller (ten at most), each against every configuration, the rows read caller by caller; --goal is one caller's, and refused with several. A caller is a task: its run is done when the judge of what it expects held (expected-outcome, a judge the agent has to have on), or, for a caller that expects nothing, when every judge did.

Several runs, by --repeats or by several callers, end in a second table, by configuration, the one that did the most first: how many of each caller's runs did its task, all of them with their share, the middle reply, what the configuration's calls cost, and what one completed call cost — everything those calls cost over the ones that did the task, since a call that failed was paid for too:

Terminal
$ pinecall simulate --persona books-a-cleaning --persona in-a-rush --voice --judge --repeats 5 \
    --against llm=google/gemini-3.5-flash-lite --against llm=anthropic/claude-haiku-5-5
…
how often each did the callers' tasks, and what a completed call cost
THE AGENT RUNS ON                    BOOKS-A-CLEANING  IN-A-RUSH  ALL             REPLY   COST     A COMPLETED CALL
thinks anthropic/claude-haiku-5-5    5 of 5            4 of 5     9 of 10 · 90%   1.31 s  $0.4120  $0.0458
thinks google/gemini-3.5-flash-lite  5 of 5            3 of 5     8 of 10 · 80%   1.22 s  $0.3980  $0.0498
``` A comparison places a round of every
configuration before the next round, and one larger than the org's simulated calls at once runs
whole: the calls past it **wait their turn**, the first line saying how many (`12 calls placed · 8
waiting their turn`), and the gateway places each as the ones before it end. How many calls the org
may have on the line at once, and how many one comparison may place, are the org's own — ten each
unless the operator gave it more; a comparison past the second is refused before anything is placed,
its sentence naming the number. Each row's JSON (`--json`) carries what the table has no column for:
`goal`, every judge's verdict in `judges`, and for a spoken call `hearing` — the caller's lines the
agent never answered, its replies the room cut off, the turns it heard that nobody said, and the
word error rate of what it heard, measured against what the simulated caller really said. A spoken
comparison sums those by configuration in a table of their own, **how each heard its callers**: the
lines said, the unanswered, the turns heard while the caller said nothing, the replies the room cut
off, the lines talked over, and the middle word error.

A call **that does not count** is in the table, its judges' column saying `not counted:` and whose
fault — `vendor` (a vendor of the agent refused or failed one of its stages, an account out of credit
among them), `platform` (our side lost the call) or `caller` (its own simulated caller broke, or its
voice broke up on the way) — with the reason under the table, and it is in no count: not in how often
a configuration did the task, not in its reply, not in what a completed call cost. A model that was
wrong, slow or silent counts: that is the comparison. One simulation that does not count says so
under its result the same way. In a comparison the gateway **places such a call again**, twice at most
for each call planned of its caller and setup, so the table ends with the calls it planned; the
command goes on reading until the gateway says the comparison is played no more. A vendor that
refused a call **for good** (no credit, a quota spent, a key or a model it does not know) is rung no
more: `no more calls on <setup>: <the vendor's words>` is printed as it happens and under the table,
and the calls of that setup still waiting are `not placed`, one line for all of them.

A configuration the gateway refuses (a vendor nobody keyed, the org's limits) is said under the
table, `not placed`, and the others go on; `--listen` is one call, so a comparison refuses it. The
console's Simulations has the same under "Compare", and opens each row's call.

`--listen` puts the call on **this machine's speakers** while it happens: the same hidden `observe`
seat the console's listen button takes, joined from Node, both tracks mixed onto whichever of
`ffplay`, `play`, `aplay` or `pw-play` you have. It turns `--voice` on and says so, because a
written call has no audio in it. `--judge` reads back the `call.score` the log seals on, and the
exit follows it: 0 when every judge held, 1 when one answered `broken`, and **2 when nobody judged
the call** — no judge is on for the agent, only `n/a` and classifications came back, the evals ran
out, or no `call.score` came within a minute — with the reason in one sentence, because a call nobody
looked at must never open a gate.

A refusal ends the command at once: the gateway's own sentence on stderr — a vendor nobody keyed is
its 503, a model or vendor the runtime does not have its 400 — and exit 2, as for every refusal; a call `simulate` had
already opened is hung up, never left holding one of the org's seats.

## `benchmark`

The benchmark of an agent, as a folder to open or to publish. It is made of calls `simulate` placed:
either as they end (`simulate … --report`) or of comparisons already played (`benchmark cmp_…`).

```console
$ pinecall simulate --persona books-a-visit --persona hurried --voice --repeats 5 --report
$ pinecall simulate --persona books-a-visit --voice --repeats 5 --report reports/gemini \
    --against llm=google/gemini-3.5-flash-lite --against realtime=google/gemini-3.8-live
$ pinecall benchmark cmp_4f1c2a9be07d cmp_91aa03c7d2e1 --out reports/november

From nothing, the steps are three. Write the callers beside the agent (agents/<name>/test/personas.ts, personas), each with what it expects: that line is what a completed call means, and the expected-outcome judge reads every finished call against it. Run them several times (--repeats): one call of a caller says little, and the report shows each round apart so that the difference between two runs of the same callers is seen. Read the report.

The folder. index.html is the page: the verdict, a row a setup, how each setup heard its callers, what each judge answered, a grid of every caller under every setup round by round, the calls that failed with their judge's reason, the calls that do not count, and every call to play with its lines, its tools and what each tool answered. report.json holds every number of the page (version: 2; bars, verdict, callers, setups[], calls[], refused[], comparisons[], the command that made it, the gateway and made_at). report.data.js is the same for the page opened from the disk, and calls/<call>.ogg is each recording as the gateway kept it (Ogg Opus, two sides: Chrome, Edge and Firefox play it; a browser that does not says so, and the lines are still read). The folder is static: any web server publishes it.

The bars. --floor is the share of a setup's counted calls in which the caller got what it came for (0.9) and --ceiling the middle of its calls' replies, in seconds (1.5). With several setups (--against, again for each) the one to take is the cheapest per completed call of those that clear both; with one, the agent as it is passes or fails each bar. A share is printed with the range it plausibly sits in after that many calls (Wilson's interval at 95%): 19 of 20 · 95% is 76%–99%, and twenty calls cannot tell a 95% from an 85%.

What does not count. A call a vendor of the agent refused or failed, one the platform lost, and one whose own simulated caller broke are listed with whose fault and why, and are in no number. --counted-only writes a report to publish: those calls are left out of it, listed nowhere and their recordings not kept, and every number is the same. --price <model=usd> prices a model the gateway priced nothing for at that many dollars a minute of its session (grok-voice-3.0=0.08, xAI's rate): the page says it was given. A setup that lost more calls than it has left is held to no bar and named in the verdict: six calls that went well of twenty placed say nothing of the fourteen. A gateway since 2026-11-26 says it on each row (valid, invalid); from an earlier one the same is read off the call's log.

In the console. A comparison opened in the console's Simulations is the same benchmark: its numbers are made by the code that makes this report's (@pinecall/agents/evals), its bars are typed on the screen, several comparisons of an agent are ticked into one table, and Download report.json hands over this file with each call's lines and no recording beside it. Conditions are read here alone.

A gate. --gate exits 1 when no setup clears both bars and 2 when nobody judged a call. --baseline <report.json> holds each setup against its row in an earlier report: it regressed when its share fell by more than that report's own rounds moved among themselves, and --gate fails on that too. --json prints report.json in place of the table.

Terminal
$ pinecall simulate --persona books-a-visit --persona hurried --voice --repeats 5 \
    --report reports/today --baseline reports/main/report.json --gate

Conditions. The same callers under the same setups, on several lines: a clean one, a television behind the caller, a bad network. --condition names one, again for each, and the first is the line every other is read against:

Terminal
$ pinecall simulate --persona books-a-visit --persona hurried --voice --repeats 3 --report \
    --condition clean \
    --condition television-20:ambience=television,background-noise=20 \
    --condition bad-line:packet-loss=0.05,delay=200 \
    --gate-under television-20
$ pinecall benchmark --condition clean:cmp_4f1c2a9be07d --condition television-20:cmp_91aa03c7d2e1,cmp_c07d2e1a9be1

On simulate, a condition is a name and, after a colon, what the line is under it, as the line's own flags name it: ambience (with background-noise, the dB under the caller), packet-loss, delay, jitter, rate, via. A name alone is the line as the callers have it. The line's flags themselves are refused beside --condition: the line is each condition's. Each condition is a comparison of its own and they are placed one after another, the first one first: the org's calls at once and the seats that play the callers are shared, so conditions placed together would be played under each other's load. With one condition, its line is the run's and nothing else changes. On benchmark, a condition is a name and the comparisons played under it; a comparison does not say the line it was placed on, so the report names those conditions and no more.

The report (report.json is version: 2) then has conditions[], each call its condition, and each setup's under[]: its share, its reply, its calls' length and how it heard its callers under each condition, with moved against the first one's line: the change, regressed when the share fell by more than the first line's own rounds moved among themselves, and most, the two numbers that line moved most, a call, of those it moved by a step or more: turns nobody said, replies the room cut and lines nobody answered (a step is one a call), seconds to reply (one), seconds a call (two minutes) and word error (a quarter of the words). The table, the judges and the verdict stay the first line's; the page adds "Under each condition", a row a setup and a column a line, and the verdict says which setups clear both bars under every one (verdict.held_under_every). --gate-under <condition>, again for each, exits 1 unless one setup clears both bars under that condition too, the same setup that clears them on the first line; it turns --gate on. A --baseline may be a report of either version: it is read by its first line.

Several comparisons named together are one table: a caller rung again under the same setup is another round of it. A model the gateway priced nothing for is said beside its cost, and a setup with one is never "the cheapest".