In brief
- Across 390 production entry-agent runs (Langfuse, 2026-10-08 to 2026-11-07), the loop made a median of 4 LLM calls and 372 runs made exactly 4. The three earlier production runs we have per-call usage for used 7, 8 and 11.
- Median uncached input was 73,360 tokens and median loop time 74 s per run. The earlier single runs used 104,496 to 195,955 uncached tokens and took 207 to 271 s. At list price a run now costs about $0.009.
- In the same window the runtime made all 1,167 stage transitions and ran a median 9 mandatory reads out of 15 tool calls per run. The model made zero navigation calls.
- Offline, the first core request now carries 4 tool schemas and 2,216 tokens instead of 10 and 4,102 (cl100k_base). Trimming tool descriptions saved only about 85 tokens.
- Two changes did nothing measurable: skipping a redundant finalization fired in 0 of 390 runs, and compact state left provider context at 1.005x raw history. Decision quality was not measured.
In the previous part we measured the tool definitions our entry agent sends to the model and concluded they were not the problem: a bounded couple of thousand tokens, never more than 10 tools in context, with market data taking most of the window. The post ended by pointing the work at the data.
That was half right. When we looked at real runs in September, the expensive part was not any single payload. It was how many times the loop asked the model for something, and what it asked for.
One reported run used 11 LLM calls, about 196,000 uncached input tokens and four and a half minutes to assess one setup. Much of that was the model doing jobs with only one correct answer: fetch the data every assessment needs, ask which stage comes next, request the transition, re-read a tool that had already answered. None of that needs judgment. It needs code.
So in September we moved those jobs into the deterministic runtime. This post covers what moved, what it measured in production, the regression it caused, and the parts that did not work.
The numbers, first
All "after" figures come from 390 production Entry runs recorded in Langfuse between 2026-10-08 and 2026-11-07, read from the metrics the runtime attaches to each run. Every run used the same model as the earlier runs, at the same price. Costs use the provider's list price for that model ($0.10 per 1M input tokens, $0.002 cached, $0.20 output). They are estimates, not invoices.
| Per run | Median | p90 |
|---|---|---|
| LLM calls | 4 | 4 |
| Uncached input tokens | 73,360 | 87,246 |
| Cached input tokens | 15,330 | 30,148 |
| Output tokens (incl. reasoning) | 6,697 | 8,475 |
| Loop wall clock | 73.9 s | 97.6 s |
| Cost at list price | $0.0087 | $0.0101 |
The call count barely varies: 372 runs made exactly 4 calls, 17 made 5, one made 2. No run made 8 or more.
What we cannot show you is a clean "before" distribution. Our Langfuse retention starts on 2026-10-08, so the two weeks before the changes are gone, and per-call usage was never stored anywhere else. What remains are three production runs from late September that earlier incident reports recorded in full. All three ran on intermediate code, with some of the changes already deployed and others not:
| Production run (date) | Calls | Uncached input | Output | Wall clock | Cost at list price |
|---|---|---|---|---|---|
| BTCUSDT session-low long (09-25) | 7 | 162,273 | 22,535 | not recorded | $0.021 |
| QQQUSDT 1H BPR short (09-28) | 8 | 104,496 | 18,282 | 207 s | $0.014 |
| DOGEUSDT weekly BPR (09-28) | 11 | 195,955 | 26,246 | 271 s | $0.025 |
| Median after (390 runs) | 4 | 73,360 | 6,697 | 74 s | $0.009 |
Those three runs were written up because they looked expensive. They probably overstate a typical earlier run, so read the table as a change in order of magnitude on similar setups, not as a measured average saving. We are not claiming a percentage.
Four chores the model no longer does
Our entry agent walks four analysis stages: core, detailed, market_data and auxiliary. Each stage exposes a curated tool set, as described in part one. Before September, the model navigated those stages itself. It called the tools, called a meta-tool to read stage information, called another to request a transition, and repeated that for each stage.
Much of that work has exactly one correct answer, which is known before the model sees anything:
| Chore | Before | Now | Production evidence (Oct 8 – Nov 7) |
|---|---|---|---|
| Fetch mandatory evidence. POI data, market structure, momentum, price location, bias, session liquidity, displacement, volume profile, market aggregate, session | The model decided to call each tool, one LLM turn per batch | The runtime runs every read whose arguments follow from the setup, at stage entry, through the same validation, recovery and trace path | Median 9 runtime reads out of 15 tool calls per run |
| Navigate stages | get_stage_info and request_stage_transition calls by the model |
The runtime advances once mandatory evidence is complete and the model's optional turn ends; both navigation tools are removed from the request | 1,167 runtime transitions, 0 model navigation calls |
| Hide finished tools | Every stage tool stayed exposed, including ones that had already succeeded | One-shot tools that succeeded, and fixed-scope tools already read, are removed. Repeating one is blocked at dispatch | Tools exposed per call: [4, 7, 3] in 372 runs |
| Reuse overlapping evidence | get_atr re-ran after get_volatility had already returned ATR |
A matching request receives a truthful reuse observation that names its source | 59 reuses |
One stage now never reaches the model at all. market_data used to cost at least one turn. The runtime now fetches its aggregate and session reads and advances, so production runs follow core → detailed → auxiliary → finalization, with one model turn per stage.
The model keeps what needs judgment: optional evidence beyond the mandatory set, the question it asks our trade memory (model-authored in 389 of 390 runs), the reasoning and the decision. Scoring rules and evidence interpretation did not change.
In simplified form, each stage now looks like this:
# simplified: one stage of the entry loop
tools = provider_tools(stage, run_state) # stage-local, minus satisfied tools
run_prefetch(mandatory_plan(stage, obligations, run_state)) # deterministic reads
if stage_complete(stage, run_state) and not optional_tools(stage, run_state):
stage = advance(stage) # runtime transition, no LLM call
continue
reply = llm(context(run_state), tools) # one optional-analysis turn
execute(reply.tool_calls, allowed=tools) # authorized against this exact schemaThis applies our standing rule: logic goes into deterministic code, and the prompt is only a guardrail. "Always fetch market structure first" used to be an instruction the model could follow, forget or vary. Now it is a code path with a test. The same setup produces the same reads in the same order, and the trace records them as runtime events, so a reader can tell which reads the model chose and which the system made.
The payload got smaller, but that was not the main saving
Measured offline the same way as in part one (serialize what each version sends, count with cl100k_base; our provider's tokenizer differs slightly), for a crypto setup:
| Stage | Before (10 Sep commit) | Now, after prefetch | Tools exposed in production |
|---|---|---|---|
| core | 10 tools / 4,102 tokens | 4 / 2,216 | 4 |
| detailed | 10 / 3,403 | 7 / 2,646 | 7 |
| market_data | 5 / 907 | 1 / 103 | no LLM call |
| auxiliary | 5 / 1,403 | 4 / 1,282 | 3 |
Two notes so this table is not misread. First, the registry grew between August and September (core was 1,948 tokens in part one and 4,102 at the start of this work), so the two posts' numbers are not directly comparable. Second, we also rewrote five tool descriptions to remove repeated sentences. That saved about 85 tokens in total. It was worth doing and it changed nothing that matters.
Schemas are now roughly 1,300 to 2,600 tokens of a 20,000 to 24,000-token request. Most of the saving came from making three analytical requests and one finalization instead of seven to eleven calls, not from making each request smaller.
The regression: 11 calls and an iteration limit
The first version of runtime stage progression shipped on 2026-09-28. A production DOGEUSDT run then used 11 LLM calls and hit the analytical iteration limit, even though all mandatory evidence had been collected.
There were two causes. The transition check ran after the model's no-tool replies rather than after tool batches, so a stage could finish its evidence and still wait for another round trip before moving on. An internal weekly timeframe label also failed to match the public timeframe name at the prefetch boundary, so one mandatory read fell back to the model.
The fix reconciles stage state after every prefetch and tool batch, and normalizes timeframes at that boundary. It also authorizes each returned tool call against the exact schema of the current request, so a call to a tool from a later stage is rejected rather than executed. New counters separate analytical turns, optional batches, recovery turns and blocked cross-stage calls per stage. A rollback flag restores model-driven navigation if this goes wrong in operation.
At the time we could only verify the fix with scripted provider responses. That scripted run took 4 calls, and we said in the incident report that live savings were unmeasured. The production table above is the first real evidence for that claim. In 30 days, one run reached the iteration limit.
What did not work
Skipping redundant finalization: 0 of 390 runs. We added a gate that accepts a complete, schema-valid analytical answer and skips the separate finalization call. In production, the model's last analytical turn is almost always a memory search, never a complete answer. So the gate never fired, and every run still pays for a finalization call. That call is also the least cached: a median 22,394 of its 23,175 input tokens were uncached.
Compact state: no measurable compression. We replaced the replayed transcript with a compact run state that keeps distinct observations, obligations and recent notes. On a synthetic fixture it cut context by about a quarter. In production, provider context was 1.005 times the raw history in bytes. With only three analytical turns there is little history to compact. The change still bounds worst-case growth, but it did not save anything on runs this short.
Prompt cache reuse is low and falling. We stabilized the cache routing key, so changing tool lists no longer split one run's requests into different cache groups. Even so, the median cached share of input was 16.3% over the window and 9.4% in the first week of November. A prefix that should repeat on every call is clearly not being reused as often as it could be, and we do not know why yet.
The token soft budget is off. The code exists, but the threshold defaults to zero, and every production run recorded it as disabled. We have not set a threshold because we had no production distribution to derive one from. Now we have one.
The other agents: no before, so no claim
The same September work also changed position management and bias. Both now keep a compact run state instead of replaying the full transcript, and bias and the personal position guard got a cheaper forced-finalization or recovery path. For these agents we have no per-call production data from before the change, so we only publish what they cost now (production, Oct 8 – Nov 7, medians at list price):
| Agent | Runs | LLM calls | Uncached input | Cost |
|---|---|---|---|---|
| Global position management | 57 | 3 | 34,615 | $0.0051 |
| Bias | 59 | 7 | 56,639 | $0.0082 |
Two of the cheaper fallback paths never ran in the window. No bias run reached forced finalization, and position management never made a separate finalization call. Those changes protect the worst case; they did not change the typical run. The personal guard's compact recovery did run: 26 recovery calls, with a median of 1,401 uncached input tokens each.
How the branch was reviewed
Before merging, the whole optimization branch went through an independent review against main. The review found a high-severity bug the branch had introduced: displacement evidence from the wrong timeframe (15m) could satisfy a 5m mandatory obligation and allow finalization. Obligations are now matched on timeframe, side and symbol. The review also found a pre-existing issue at an execution boundary in a legacy code path, unrelated to cost, and it was fixed in the same pass. Moving work from the model into the runtime gives the runtime more authority, so it needs the same review discipline as any execution code.
When we would change our mind
- If an evaluation shows the fixed path misses evidence. Fewer, more predictable turns are only better if the decisions are at least as good. We have not measured that (see below). If a paired evaluation shows the model skipping optional evidence it used to gather, the analytical turn budget per stage is the first thing we would revisit.
- If setups stop fitting four stages. The runtime owns navigation because the stage graph is fixed and small. If the domain grows into branching paths, a model choosing the next step may become the right design again, and the rollback flag keeps that option available.
- If spend is driven by run count rather than run cost. At under a cent per run, how often we run Entry matters more than the loop's internals. Admission gates and verdict reuse ship in the same weeks for that reason, and that is where we would look next.
What we are deliberately not doing
- Lowering reasoning effort or capping output tokens. We asked for a shorter final synthesis, but we did not reduce the model's reasoning budget. Cost is not worth a cheaper decision we cannot evaluate.
- Adopting provider-hosted tool search. We reviewed it again and kept it as an offline spike. Mandatory prefetch already removes most of the tools such a search would load on demand. That provider's API also cannot combine tool search with the structured JSON output this agent needs.
- Writing the memory query in code. The query depends on what the analysis found, so the model still writes it, and a code-built query exists only as a labelled fallback for failures.
- Treating fewer calls as better decisions. Nothing here shows that the agent decides better. It shows that it costs less and is more repeatable.
What these numbers do not show
- Decision quality was not measured. We have no paired replay that compares scores, actions and reasoning between the old and new loop on the same market snapshot.
- No matched before/after distribution exists. The "before" side is three single runs from intermediate code, chosen because they looked expensive.
- Several changes overlap in time. Over the same weeks, other changes reduced how many runs happen at all: setup admission gates, skipping the trade planner for rejected setups, and reusing cached verdicts across ranking refreshes. Per-run figures exclude cache hits, but total spend mixes both effects.
- Costs are list-price estimates from recorded token usage, not provider invoices, and loop time excludes queueing, review and persistence.
Part one argued that you should measure your own payload before adopting a fix for someone else's. The follow-up is less comfortable: measure the loop too, and expect some of your fixes to show up as zero. The biggest saving here did not come from compression, caching or shorter prompts. It came from letting the model stop doing jobs that have only one correct answer.

Public pen name of LiquidMind's founder and builder. Writing first-hand engineering notes and transparent performance reviews from the system's internal ledger.
Related Posts
Stay Liquid
New posts on transparency, engineering, and the LiquidMind thesis — no noise.
Loading discussion…