Opt-In Content-Aware Routing

Tally Max

Shape-only routing sees the silhouette. Tally Max reads the letter — and hands you back a sharper model pick and a leaner payload, in one call.

Two Routes, One Router

Choose per call — the privacy default never changes

Every Tally integration already sends a semantic shape: a structural fingerprint of the request — task type, complexity, context size, tool surface — and never a word of content. That stays the default, forever. Tally Max is a second route you ask for explicitly, on the calls that are expensive enough to deserve it. Those calls send the actual payload alongside the shape, and Tally reads it before answering.

Default · /route

Shape-only

  • Sends: structural envelope only — no content, ever
  • Latency: milliseconds
  • Answers: which model, from learned shape statistics
  • Use for: the bulk of your traffic
Opt-in · /route/max

Tally Max

  • Sends: envelope plus the payload (per-call, per-key opt-in)
  • Latency: ~1–3s analyzer pass; identical payloads replay from cache in ms
  • Answers: refined model pick plus machine-applicable context edits
  • Use for: expensive calls — big contexts, hard tasks, real money
What Max Returns

A refined pick, and a leaner payload to send

The verdict contains the model recommendation — refined from what your content actually is, not what the client-side heuristics guessed — plus context ops: structured, machine-applicable edits that cut cost without touching the answer. The SDK applies them mechanically and defensively; every op is auditable, and your live user turn is never on the table. Tally proposes and quantifies — it never silently rewrites your conversation.

{
  "model": {"primary": "claude-sonnet-5", "fallbacks": ["…"]},
  "confidence": 0.87,
  "why": ["tool-use + 40k ctx", "true task: retrieval, not reasoning"],
  "context_ops": [
    {"op": "move_to_cache_prefix", "blocks": ["sys", "docs_0-11"],
     "savings": "~38k tok cached on repeats"},
    {"op": "summarize_span", "messages": [4, 17], "max_tokens": 500,
     "replacement_text": "…faithful condensation, generated by Tally…",
     "savings": "~11k tok"},
    {"op": "strip_tool_defs", "names": ["legacy_search"], "savings": "~2.3k tok"}
  ],
  "est_savings_pct": 31
}
How It Works

Refines the input — never replaces the router

Deterministic measurements — the whole payload, no exceptions

Exact per-section token estimates, duplicate-block detection, tool-schema weight, cache-prefix alignment. Rules see everything; nothing is windowed away from them.

One fast analyzer pass — judgment where rules can't reach

A small, quick model reads a budgeted verbatim view plus the measurements and judges true task type, true complexity, and what's bloat for this specific prompt. Summaries are only ever written over ranges the analyzer read in full — and the model proposes; the rules validate and price every op.

The same gate and bandit decide — Max just tells them the truth

The refined shape flows through the unchanged capability gate and routing bandit, so every safeguard and all accumulated learning keep working. If the analyzer is ever unavailable, you get exactly what shape-only routing would have said. Max is never a hard dependency.

The Learning Loop

The expensive tier trains the cheap tier

Every Max call compares three things: what the SDK guessed, what the content actually was, and how the chosen model performed. Outcomes are credited to both shape clusters — the declared one your SDK produced and the refined one the analyzer computed. And where the two systematically disagree — a client whose "reasoning" calls are really retrieval, token estimates running hot on code — that bias itself becomes data: shape-correction priors that let the shape-only route stop repeating a known-wrong guess. Max traffic makes free-tier routing smarter for everyone, including callers who never opt in.

SDK shape + payload Tally Max refined pick + ops outcome both clusters learn
Privacy & Control

Analyze-and-discard, with the keys in your hand

Opt-in twice over

Max is enabled per API key (features.max) and chosen per call. An unentitled key gets a clean 403 — and the SDK falls back to shape routing, so nothing ever breaks.

No content at rest

The payload exists only for the duration of the analysis. What Tally stores: the two envelopes, the ops, section sizes and counts, and a content hash — nothing a prompt could be reconstructed from.

Your turn is sacred

No op may drop or summarize the live final message — enforced server-side and again in the SDK. Edits are auditable; skipped ops come back with reasons, never surprises.

Measured, not promised

Every analysis carries an estimated saving; every billed outcome reports the realized one. You can watch est-vs-realized and the analyzer's own cost on the inspector — Max has to pay for itself.

Turn it on

One flag on your API key, one new SDK call. The verdict cache means repeat payloads never pay the analyzer twice.