JevCalc

Agent loop playground and cost simulator

Agent loop playground

Give the loop a task.
Watch the path unfold.

A Pi-style execution canvas. Explore how a prompt becomes model turns, tool calls, observations, and a final response.

Mock execution · No API calls
110 / 4,000
Prompt stays in this tab
Template match

Keyword rule matched “refund”. Review or override the template; this is not a model-generated plan.

Refund support3 model turns · 3 tools
Preparing the canvas…
Ready to playNo model or tool has run

Execution steps 12 mock events · select a step to focus the canvas

How this preview works. A local rule selects a fixed example template. The loop shape follows context preparation, assistant responses, tool execution, and tool-result feedback in Pi’s agent loop. Domain tools, retry choices, and outputs are mock fixtures. No arbitrary-prompt understanding, real execution, hidden model reasoning, or performance measurement is claimed.

Playback speed controls the animation only. The trace is not a cost estimate or a Pi-compatible event export. Dragging a node changes its position, not the execution order.

Cost planning / separate example

Compare the three-turn refund workflow

The existing editable cost model uses a fixed refund scenario. Its prices and timings do not describe the mock path above.

Open cost model
Architecture sandbox / 01

One task. Three turns.
Where does a decision model fit?

Explore a refund-support loop. Change the assumptions and compare an LLM-only workflow with one bounded decision delegated to Jev.

Illustrative inputs, not a benchmark. Prices and timings below are editable example values, not verified provider rates or measured performance. This simulation makes no model or tool calls.

01 / WorkflowRefund support

“Review a refund request, look up the order and policy, create a handling ticket, and draft a reply.”

1

Understand & extract

LLM

Extract the order ID and request the lookup tools. Free-form understanding stays with the LLM.

Turn 1 assumptions
Tool calls → results added to context
Order lookup 300ms
Policy lookup 200ms

Parallel · slower tool sets the duration

Fixed labels + known tool arguments
2

Choose handling route

Jev candidate

Choose a predefined queue, such as standard review or specialist review. Code maps the label to the ticket action.

Standard reviewSpecialist review
Low confidence / recoverable error → LLM fallback
LLM and Jev assumptions
Validation + permissions enforced by code
Create handling ticket200ms
Ticket result added to context
3

Draft the response

LLM

Generate a customer-facing reply. This turn retains its full input and output budget in both plans.

Turn 3 assumptions

Task complete · 3 model stages, 3 tool calls

02 / Compare plansSame task & tool path
Estimated model cost / 1,000 tasks22.5% lower
LLM-only$11.800$0.011800 / task
Jev + LLM$9.144$0.009144 / task
Assumed task duration3.10s 2.77s

Hybrid is an expected mean across accepted and fallback paths. No measured percentiles.

20%
All decisions acceptedAll fall back

An assumed rate, not a confidence threshold. Each fallback pays for both the Jev attempt and the LLM decision.

The hybrid plan saves $2.656 per 1,000 tasks at these settings. Equivalent decision quality has not been established.

What you are paying for

Turns 1 and 3 stay. Only the middle decision changes.

LLM-only$11.800
Jev + LLM$9.144
Retained LLM turnsLLM decisionJev decisionExpected fallback

When does the cost advantage disappear?

Hold the task constant. Vary how often Jev falls back.

USD / 1,000 tasks06.8813.750%25%50%75%100%Fallback rate
Jev + LLMLLM-only
Hybrid model cost is lower below 95.5% fallback (rounded). This is a cost break-even, not a recommended operating threshold.
03 / Make it your workload

Inspect every assumption.

Replace example rates and timings with your own. Numeric edits apply on Enter or when you leave a field.

Model prices USD per million tokens

One LLM tariff across all turns. Jev output is unmetered in this template. No cache discounts, batch rates, tool fees, or infrastructure costs.

Tool execution Critical path, not sum of all spans
Calculation method & boundaries

Cost: LLM-only = turn 1 + turn 2 + turn 3. Hybrid = turn 1 + Jev + fallback rate × turn 2 + turn 3. Each LLM turn costs (input tokens × input price + output tokens × output price) / 1,000,000.

Time: use the same model-stage calculation with latency, then add lookup time and ticket time to both plans. Parallel lookup time is the maximum of the two durations. Sequential lookup time is their sum.

Context: each input count is the complete request, including history, tool results, and schemas. Replacing turn 2 does not automatically shrink turn 3. Context growth is not assumed to be exponential.

Eligibility: turn 2 is replaceable only when labels and tool arguments are already fixed. Code must enforce deterministic policy, authorization, and validation. No refund is executed in this example.

Scope: a simplified Pi-style model → tools → model loop, not a Pi integration. It excludes open-ended planning, retries, tool failures, compaction, and additional turns. Fallback is assumed to use the same turn-2 LLM budget and duration. Jev latency must include representative failed-attempt or timeout overhead.

Validate next: measure task success, accepted-decision errors, fallback frequency, token usage, and end-to-end duration on your workload. The lowest modeled cost is not evidence of the best policy.

Local calculations. No API key. Shareable assumptions.Scenario model v1 · Illustrative refund workflow