mirror of
https://github.com/hanzoai/skills.git
synced 2026-11-19 00:47:36 +00:00
311 lines
31 KiB
HTML
311 lines
31 KiB
HTML
<!doctype html>
|
||
<html lang="en"><head>
|
||
<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
|
||
<title>hip-0510</title>
|
||
<meta name="color-scheme" content="dark">
|
||
<style>
|
||
/* Committed to one visual world: a dark instrument panel. No light variant —
|
||
the dot field and the hairline rules only read on black, and a naive
|
||
inversion would wash both out. Every colour is painted explicitly so the page
|
||
never borrows a host background. */
|
||
@font-face{font-family:'Zen';src:url('/fonts/Zen-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
||
@font-face{font-family:'Zen';src:url('/fonts/Zen-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
||
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Variable.woff2') format('woff2');font-weight:100 900;font-style:normal;font-display:swap}
|
||
@font-face{font-family:'Zen Mono';src:url('/fonts/ZenMono-Italic-Variable.woff2') format('woff2');font-weight:100 900;font-style:italic;font-display:swap}
|
||
@font-face{font-family:'Zen Pixel Square';src:url('/fonts/ZenPixel-Square.woff2') format('woff2');font-style:normal;font-display:swap}
|
||
|
||
:root{
|
||
--ink:#f4f4f2; --soft:#9c9c98; --faint:#6a6a66; --ground:#000; --panel:#0a0a0a;
|
||
--line:#232323; --line-hi:#3a3a3a; --accent:#f4f4f2;
|
||
--font-zen-sans:'Zen',-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
|
||
--font-zen-mono:'Zen Mono',ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,monospace;
|
||
--font-zen-pixel-square:'Zen Pixel Square',monospace;
|
||
--mono:var(--font-zen-mono);
|
||
--sans:var(--font-zen-sans);
|
||
/* Controls are pills and surfaces are soft, as on hanzo.ai. */
|
||
--r:999px; --r-soft:14px;
|
||
}
|
||
*{box-sizing:border-box}
|
||
html{-webkit-text-size-adjust:100%}
|
||
body{margin:0;background:var(--ground);color:var(--ink);font-family:var(--sans);
|
||
font-size:16px;line-height:1.65;-webkit-font-smoothing:antialiased}
|
||
.wrap{max-width:60rem;margin:0 auto;padding:0 1.75rem}
|
||
|
||
/* The dot field. A halftone made of one repeating radial-gradient, faded out
|
||
along the diagonal by a mask so it reads as a wave rather than wallpaper. */
|
||
/* No overflow clip here: the dot field is inset to the box already, and a clip
|
||
would cut off the copy-prompt menu. */
|
||
.hero{position:relative;border-bottom:1px solid var(--line)}
|
||
.hero::before{content:"";position:absolute;inset:0;
|
||
background-image:radial-gradient(var(--line-hi) 1px, transparent 1px);
|
||
background-size:7px 7px;
|
||
-webkit-mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
||
mask-image:linear-gradient(115deg,#000 0%,rgba(0,0,0,.55) 38%,transparent 72%);
|
||
pointer-events:none}
|
||
.hero .wrap{position:relative;padding-top:5.5rem;padding-bottom:4rem}
|
||
|
||
nav{border-bottom:1px solid var(--line)}
|
||
nav .in{max-width:60rem;margin:0 auto;padding:1.1rem 1.75rem;display:flex;
|
||
justify-content:space-between;align-items:center;gap:1rem}
|
||
.brand{font-family:var(--mono);font-size:.85rem;letter-spacing:.14em;
|
||
text-transform:uppercase;color:var(--ink);text-decoration:none;
|
||
display:inline-flex;align-items:center;gap:.6rem}
|
||
.brand i{font-style:normal;color:var(--faint)}
|
||
.mark{width:1.15em;height:1.15em;display:block;flex:0 0 auto}
|
||
nav a.up{font-family:var(--mono);font-size:.72rem;letter-spacing:.14em;
|
||
text-transform:uppercase;color:var(--soft);text-decoration:none}
|
||
nav a.up:hover{color:var(--ink)}
|
||
|
||
h1{font-family:var(--mono);font-size:clamp(2rem,5.4vw,3.4rem);line-height:1.12;
|
||
letter-spacing:-.02em;margin:0 0 1.1rem;font-weight:500;text-wrap:balance}
|
||
h1 em{font-style:normal;color:var(--faint)}
|
||
.lede{color:var(--soft);font-size:1.05rem;max-width:52ch;margin:0 0 2.25rem}
|
||
|
||
.btns{display:flex;flex-wrap:wrap;gap:.7rem;margin:0 0 .5rem;align-items:center}
|
||
.btn{display:inline-flex;align-items:center;gap:.5rem;font-family:var(--mono);
|
||
font-size:.72rem;letter-spacing:.14em;text-transform:uppercase;
|
||
padding:.8rem 1.4rem;border:1px solid var(--line-hi);border-radius:var(--r);
|
||
color:var(--ink);text-decoration:none;background:transparent;cursor:pointer;
|
||
line-height:1.2;font-weight:400}
|
||
.btn:hover{background:#141414;text-decoration:none;border-color:var(--soft)}
|
||
.btn.solid{background:var(--ink);color:#000;border-color:var(--ink)}
|
||
.btn.solid:hover{background:#d8d8d4}
|
||
.btn .chev{width:.7em;height:.7em;flex:0 0 auto;transition:transform .15s ease}
|
||
.btn[aria-expanded="true"] .chev{transform:rotate(180deg)}
|
||
|
||
/* Copy-prompt selector. Each row copies the prompt for its own target. */
|
||
.copy{position:relative;display:inline-flex}
|
||
.menu{position:absolute;top:calc(100% + .5rem);left:0;z-index:20;min-width:21rem;
|
||
background:var(--panel);border:1px solid var(--line-hi);border-radius:var(--r-soft);
|
||
padding:.4rem;display:flex;flex-direction:column;
|
||
box-shadow:0 12px 32px rgba(0,0,0,.75)}
|
||
.menu[hidden]{display:none}
|
||
.mi{display:flex;align-items:center;gap:.7rem;width:100%;text-align:left;
|
||
padding:.62rem .8rem;border:0;border-radius:calc(var(--r-soft) - .35rem);
|
||
background:transparent;color:var(--ink);font-family:var(--mono);font-size:.76rem;
|
||
letter-spacing:.04em;text-decoration:none;cursor:pointer;line-height:1.3;
|
||
white-space:nowrap}
|
||
.mi:hover,.mi:focus-visible{background:#181818;outline:none}
|
||
.mi .mark{width:1.05rem;height:1.05rem;color:var(--soft)}
|
||
.mi:hover .mark{color:var(--ink)}
|
||
.mi u{margin-left:auto;color:var(--faint);text-decoration:none;font-size:.68rem;
|
||
letter-spacing:.1em;text-transform:uppercase}
|
||
|
||
/* Works-with bar: one scrolling row, name and mark per agent. */
|
||
.strip{border-bottom:1px solid var(--line);background:var(--panel)}
|
||
.strip .in{max-width:60rem;margin:0 auto;padding:.9rem 1.75rem;display:flex;
|
||
align-items:center;gap:1.25rem;font-family:var(--mono);font-size:.72rem;
|
||
letter-spacing:.1em;text-transform:uppercase;color:var(--faint)}
|
||
.strip b{color:var(--soft);font-weight:400;flex:0 0 auto;
|
||
border-right:1px solid var(--line);padding-right:1.25rem;align-self:stretch;
|
||
display:flex;align-items:center}
|
||
.bar{display:flex;align-items:center;gap:.5rem;flex:1 1 auto;min-width:0;
|
||
overflow-x:auto;scrollbar-width:none;scroll-snap-type:x proximity;
|
||
-webkit-overflow-scrolling:touch;
|
||
-webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent);
|
||
mask-image:linear-gradient(90deg,#000 calc(100% - 3rem),transparent)}
|
||
.bar::-webkit-scrollbar{display:none}
|
||
.agent{display:inline-flex;align-items:center;gap:.45rem;flex:0 0 auto;
|
||
padding:.4rem .85rem;border:1px solid var(--line);border-radius:var(--r);
|
||
color:var(--soft);white-space:nowrap;scroll-snap-align:start;
|
||
text-decoration:none;background:var(--ground)}
|
||
.agent:hover{color:var(--ink);border-color:var(--line-hi);text-decoration:none}
|
||
.agent .mark{width:.95rem;height:.95rem}
|
||
|
||
h2{font-family:var(--mono);font-size:1.1rem;letter-spacing:-.01em;margin:2.75rem 0 .75rem;font-weight:500}
|
||
h3{font-size:1rem;margin:2rem 0 .5rem;font-weight:600}
|
||
h4,h5,h6{font-size:.94rem;margin:1.5rem 0 .5rem;font-weight:600}
|
||
p{margin:0 0 1rem;max-width:70ch}
|
||
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
|
||
li{margin:.22rem 0}
|
||
a{color:var(--ink);text-decoration:underline;text-underline-offset:3px;
|
||
text-decoration-color:var(--line-hi)}
|
||
a:hover{text-decoration-color:var(--ink)}
|
||
a:focus-visible{outline:1px solid var(--ink);outline-offset:3px}
|
||
code{font-family:var(--mono);font-size:.85em;background:var(--panel);
|
||
border:1px solid var(--line);border-radius:5px;padding:.1em .36em}
|
||
pre{background:var(--panel);border:1px solid var(--line);padding:1rem 1.1rem;
|
||
border-radius:var(--r-soft);overflow-x:auto;margin:0 0 1.25rem}
|
||
pre code{background:none;border:0;padding:0;font-size:.82rem;line-height:1.7}
|
||
blockquote{margin:0 0 1rem;padding-left:1rem;border-left:1px solid var(--line-hi);color:var(--soft)}
|
||
hr{border:0;border-top:1px solid var(--line);margin:2.5rem 0}
|
||
table{border-collapse:collapse;width:100%;margin:0 0 1.25rem;font-size:.92rem;
|
||
display:block;overflow-x:auto}
|
||
th,td{border:1px solid var(--line);padding:.5rem .7rem;text-align:left}
|
||
|
||
.curl{display:block;background:var(--panel);border:1px solid var(--line);
|
||
border-radius:var(--r-soft);padding:.95rem 1.1rem;font-family:var(--mono);
|
||
font-size:.8rem;color:var(--soft);overflow-x:auto;margin:0 0 2.5rem;
|
||
white-space:pre;line-height:1.9}
|
||
.curl b{color:var(--ink);font-weight:400}
|
||
.curl i{font-style:normal;color:var(--faint)}
|
||
|
||
/* index */
|
||
#q{width:100%;padding:.85rem 1.2rem;font-family:var(--mono);font-size:.85rem;color:var(--ink);
|
||
background:var(--panel);border:1px solid var(--line);border-radius:var(--r);margin:0 0 .6rem}
|
||
#q::placeholder{color:var(--faint);text-transform:uppercase;letter-spacing:.1em;font-size:.72rem}
|
||
#q:focus{outline:none;border-color:var(--soft)}
|
||
#count{color:var(--faint);font-family:var(--mono);font-size:.72rem;letter-spacing:.1em;
|
||
text-transform:uppercase;margin:0 0 2rem}
|
||
.cat{margin:2.5rem 0 .5rem;font-family:var(--mono);font-size:.7rem;letter-spacing:.16em;
|
||
text-transform:uppercase;color:var(--faint);border-bottom:1px solid var(--line);
|
||
padding-bottom:.45rem}
|
||
.row{display:block;padding:.6rem .9rem;margin:0 -.9rem;border-bottom:1px solid var(--line);
|
||
border-radius:var(--r-soft);text-decoration:none}
|
||
.row:hover{background:#0a0a0a}
|
||
.nm{font-family:var(--mono);font-size:.84rem;color:var(--ink);display:block}
|
||
.ds{color:var(--soft);font-size:.9rem;display:block;margin-top:.12rem}
|
||
footer{margin-top:4rem;padding:2rem 0 4rem;border-top:1px solid var(--line);
|
||
color:var(--faint);font-size:.85rem}
|
||
footer a{color:var(--soft)}
|
||
.fmap{display:grid;gap:1.75rem;grid-template-columns:repeat(auto-fit,minmax(11rem,1fr));
|
||
margin:0 0 2rem;font-size:.85rem}
|
||
.fmap b{display:block;font-family:var(--mono);font-size:.68rem;letter-spacing:.16em;
|
||
text-transform:uppercase;color:var(--faint);font-weight:400;margin:0 0 .6rem;
|
||
border-bottom:1px solid var(--line);padding-bottom:.4rem}
|
||
.fmap a{display:inline-block;color:var(--ink);text-decoration:none;margin:.3rem .35rem 0 0}
|
||
.fmap a:hover{text-decoration:underline}
|
||
.fmap div{color:var(--faint);line-height:1.5}
|
||
.fend{border-top:1px solid var(--line);padding-top:1.25rem;font-size:.82rem}
|
||
|
||
@media (max-width:640px){
|
||
.hero .wrap{padding-top:3.25rem;padding-bottom:2.75rem}
|
||
.btns{gap:.5rem}
|
||
.btn{padding:.75rem 1.15rem;font-size:.68rem}
|
||
.copy,.copy .btn{width:100%;justify-content:center}
|
||
.menu{left:0;right:0;min-width:0}
|
||
.strip .in{flex-direction:column;align-items:flex-start;gap:.6rem;padding:.9rem 1.75rem}
|
||
.strip b{border-right:0;padding-right:0}
|
||
.bar{width:100%}
|
||
}
|
||
</style>
|
||
<link rel="alternate" type="text/markdown" href="/hip-0510.md">
|
||
|
||
<link rel="icon" href="/favicon.svg">
|
||
<link rel="canonical" href="https://hanzoskills.com/hip-0510">
|
||
</head>
|
||
<!-- Reading this with a machine? Every page here is also plain markdown.
|
||
This one: https://hanzoskills.com/hip-0510.md
|
||
Index: https://hanzoskills.com/llms.txt
|
||
Corpus: https://hanzoskills.com/all.md
|
||
Append .md to any path for the markdown twin. -->
|
||
<body>
|
||
<nav><div class="in">
|
||
<a class="brand" href="/"><svg class="mark" viewBox="0 0 67 67" fill="currentColor" aria-hidden="true"><path d="M22.21 67V44.6369H0V67H22.21Z"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z"/><path d="M22.21 0H0V22.3184H22.21V0Z"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z"/></svg> HANZO<i>SKILLS</i></a>
|
||
<a class="up" href="/">All skills</a>
|
||
</div></nav>
|
||
|
||
<div class="wrap">
|
||
<h1>hip-0510</h1><p class="lede">HIP-510: Enso — The Router Family, Learned Per-Request Routing and the Router–Model Flywheel. Status Final. Hanzo architectural specification.</p><h1>HIP-0510: Enso — The Router Family, Learned Per-Request Routing and the Router–Model Flywheel</h1>
|
||
<h2>Abstract</h2>
|
||
<p><strong>Enso</strong> is Hanzo's router family. Zen generates, Enso routes, Kai decides (HIP-0511). This proposal specifies the family's core, the learned router: a layer that selects the best model for every request across any enabled provider and any hosted model, then improves itself from feedback. Enso makes model choice <strong>per-request</strong> and makes <strong>cost a first-class, transparent axis</strong> — it optimizes <code>quality − λ·cost − μ·latency</code> over the whole pool. The routing decision costs <strong>microseconds on a CPU</strong> (measured 300 ns heuristic → 12 µs learned), never a GPU. Enso tiers cleanly from a transparent rule router (cold start) to a learned policy (<code>xᵀWp</code>, closed-form ridge fit + online per-user LinUCB) that takes over once eval data exists and falls back to the rules whenever it is unsure. In production today the gateway serves overrides, ε-exploration and a prefer table rewritten from mean reward (§3); the <code>xᵀWp</code> engine is built and not wired (§8). Every routed request produces a content-free training tuple that trains both the router and — recursively — the next model. This HIP defines the routing contract, the per-org and global training loops, the reward sources (in-app feedback + an LLM-as-judge quality signal), the metering, and the economics. It also names the managed Enso SKUs (§5), the members that share the name without routing, Enso Diffusion and the Enso Browser (§8), and where Kai takes Enso's bounded decisions (§9, HIP-1332 §13).</p>
|
||
<h2>Motivation</h2>
|
||
<p>Frontier models trade the lead benchmark-to-benchmark: the best coder is not the best reasoner is not the cheapest capable chat model. Pinning one model for all traffic leaves both quality and money on the table, and it couples a product to a single vendor's availability, pricing, and policy. A router that picks per-request recovers the leading capability on each task <strong>and</strong> makes the cost of that capability explicit and controllable — without changing the caller's integration (<code>model=auto</code> over an OpenAI-compatible API).</p>
|
||
<p>Three properties make this a distinct layer rather than a wrapper:</p>
|
||
<ol><li><strong>Routing is effectively free.</strong> The decision is keyword-classify plus a small</li></ol>
|
||
<p> learned matrix–vector product — six orders of magnitude below the model call it precedes. No GPU is needed to route; only the selected model needs one.</p>
|
||
<ol><li><strong>It has no cold-start cliff.</strong> A transparent rule router serves from request</li></ol>
|
||
<p> one; a learned policy takes over per-task as eval data accrues and defers to the rules under uncertainty.</p>
|
||
<ol><li><strong>It learns from ordinary traffic.</strong> In-app feedback and an automatic LLM-judge</li></ol>
|
||
<p> quality score become rewards; a content-free ledger (features + score, never prompt text) trains the policy online.</p>
|
||
<h2>Specification</h2>
|
||
<h3>1. Routing contract</h3>
|
||
<p>A request for the virtual model id <code>auto</code> (alias <code>zen-router</code>) is resolved to a concrete servable model <strong>before</strong> provider, pricing, and billing resolution, so the entire existing path bills and reports the model that actually served. The gateway sets <code>X-Routed-Model</code> on the response for transparency; the response <code>model</code> field echoes the same id.</p>
|
||
<ul><li><strong>Task classification.</strong> A request is mapped to a coarse task bucket</li></ul>
|
||
<p> (<code>code</code>, <code>math</code>, <code>reasoning</code>, <code>creative</code>, <code>vision</code>, <code>long_context</code>, <code>cheap_chat</code>, <code>default</code>) by media flag, approximate length, and keyword signal.</p>
|
||
<ul><li><strong>Policy.</strong> Per task, an ordered preference of servable model ids is resolved with</li></ul>
|
||
<p> precedence **org/project > org > <code>*</code> (shared base) > conf**; the first servable model wins. The <code>known</code> predicate restricts every level to models the caller can actually serve, so a narrower scope can only narrow, never escalate. Access-gated SKUs additionally require an explicit grant.</p>
|
||
<ul><li><strong>SLO.</strong> Optional per-request ceilings (<code>X-Max-Cost</code> per 1k tokens,</li></ul>
|
||
<p> <code>X-Max-Latency-Ms</code>) gate the choice; a policy cost ceiling fills an unset budget.</p>
|
||
<ul><li><strong>Order.</strong> The org's task overrides; then the engine, only when</li></ul>
|
||
<p> <code>router.endpoint</code> is set; then ε-exploration (<code>ROUTER_EXPLORE_EPSILON</code>); then the preference walk (<code>hanzoai/ai</code> <code>router/routing_policy.go</code>).</p>
|
||
<p>The learned policy replaces the ordered preference with a bilinear utility <code>xᵀW p_m</code> over a feature vector <code>x</code> (task one-hot, hashed n-grams, length, media) and a per-model profile <code>p_m</code>, argmax subject to the SLO and access gates. It falls back to the rule policy when confidence is low or <code>W</code> is unfit. It runs in the engine's <code>POST /route</code> (<code>hanzoai/engine</code> <code>hanzo-server-core/src/route.rs</code>): <code>hanzo-router</code> rules by default, the <code>xᵀWp</code> head when <code>ROUTER_HEADS</code> mounts one.</p>
|
||
<h3>2. Reward sources</h3>
|
||
<p>A routing decision is recorded as a <strong>content-free</strong> <code>RoutingEvent</code> (task, requested→routed model, confidence, source, feature vector, tokens, cost, latency — never prompt text). A reward in <code>[0,1]</code> is attached, keyed by the response/usage request id, from either:</p>
|
||
<ul><li><strong>In-app feedback</strong> — an explicit signal a product surfaces (thumbs, accept,</li></ul>
|
||
<p> regenerate) posted to <code>POST /v1/ai/feedback</code> (HIP-1211) as <code>{request_id, reward|rating}</code>. The write is org-scoped (a request id from another org answers 404, like an unknown one), idempotent, and carries no prompt text. The earlier <code>/v1/add-routing-reward</code> is retired and answers 404.</p>
|
||
<ul><li><strong>LLM-as-judge</strong> — an automatic quality score: a judge model rates the served</li></ul>
|
||
<p> response against a task rubric; only the numeric score is stored.</p>
|
||
<h3>3. Training loops</h3>
|
||
<p>Enso trains <strong>both</strong> a shared base and every org's own policy from one ledger read:</p>
|
||
<ul><li>**Global base (<code>*</code>).<strong> Fit from the rewards of orgs that </strong>opted in**</li></ul>
|
||
<p> (<code>TrainingContribution = enabled</code>) plus reserved internal traffic. Consent-gated: a customer contributes to the shared base only by choice.</p>
|
||
<ul><li><strong>Per-org.</strong> Every org with sufficient rewarded rows fits <strong>its own</strong> policy from</li></ul>
|
||
<p> <strong>its own</strong> data, gated against <strong>its own</strong> incumbent, deployed to <strong>its own</strong> policy row. An org needs no consent to train on its own data; the fold ensures its learned policy wins for that org while the base serves everyone else.</p>
|
||
<p>Each cycle is <strong>fit → gate → deploy → publish</strong>:</p>
|
||
<ol><li><strong>Fit.</strong> The gateway trainer (<code>hanzoai/ai</code> <code>controllers/router_trainer.go</code>)</li></ol>
|
||
<p> takes the per-(task, model) mean reward over the rewarded ledger and picks each task's best arm. In the engine, <code>hanzo-router-retrain</code> fits <code>W</code> by closed-form ridge and <code>enso</code> adapts per user by LinUCB; both serve only through <code>router.endpoint</code> (§8).</p>
|
||
<ol><li><strong>Gate.</strong> A candidate is deployed <strong>only</strong> if it beats the incumbent by a margin</li></ol>
|
||
<p> on a held-out reward measure (or a benchmark eval). Otherwise the incumbent is kept and training continues on more data — <strong>promote-or-keep</strong>.</p>
|
||
<ol><li><strong>Deploy.</strong> The gated table is written to the scope's policy row; the router</li></ol>
|
||
<p> prefers it on the next request with no reload (a sub-microsecond swap).</p>
|
||
<ol><li><strong>Publish.</strong> The retrain verdict (version, event count, gate pass/value/base) is</li></ol>
|
||
<p> recorded and surfaced for observability.</p>
|
||
<p>The policy, defaults, ledger, rewards, artifact metadata and stats are served under <code>/v1/ai/router</code> (HIP-1211).</p>
|
||
<h3>4. The recursive router–model flywheel</h3>
|
||
<p>Every routed request yields a labeled tuple <code>(features, winning model, quality score)</code>. Beyond training the router, this is a preference/distillation dataset for <strong>model</strong> training: the winning responses are supervised-fine-tuning targets, the judge scores are a reward-model signal, and the discovered task boundaries inform pretraining. A better model becomes a better routing target, attracts more traffic, and generates more preference data — the router is the <strong>data flywheel</strong> for the next model. Model training remains GPU work; the router and its data collection do not.</p>
|
||
<h3>5. Serving family</h3>
|
||
<p>For callers who prefer not to manage a pool, Enso is also a managed family over the same OpenAI-compatible API (<code>/v1/chat/completions</code>, <code>/v1/responses</code>). The ids served on 2026-09-25 (<code>curl -s https://api.hanzo.ai/v1/models</code>) are <code>enso</code>, <code>enso-auto</code>, <code>enso-flash</code>, <code>enso-free</code>, <code>enso-pro</code> and <code>enso-ultra</code>.</p>
|
||
<ul><li><code>enso-auto</code> is the family's free entry and the default model of <code>hanzoai/dev</code></li></ul>
|
||
<p> (<code>crates/hanzo-config</code>, <code>DEFAULT_MODEL</code>). When the caller funds it, the gateway lifts it by reasoning depth onto a priced SKU through the <code>router.depth</code> table (<code>hanzoai/ai</code> <code>controllers/depth_route.go</code>). The lift runs only from a free SKU to a priced SKU that needs no grant, never the reverse.</p>
|
||
<ul><li>Fan-out is a catalog capability (<code>hanzoai/zen</code> <code>catalog.go</code>, <code>escalate.go</code>,</li></ul>
|
||
<p> <code>ultra.go</code>). A SKU with <code>arms</code> fans out and picks by verify-then-select; an <code>escalate</code> stanza in <code>adaptive</code> mode first probes one task-ranked arm and widens to the panel <strong>only</strong> when the probe is low-confidence, so a confident request bills one arm. The embedded catalog and <code>hanzoai/enso</code> give <code>enso-ultra</code> arms and <code>escalate</code>; the deployed catalog (<code>hanzoai/universe</code> <code>charts/app/files/enso/catalog.yaml</code>) gives it one route and neither, so today <code>enso-ultra</code> serves one model.</p>
|
||
<p>The family is data, served by the Zen serving engine with <code>ZEN_FAMILY=enso</code>. <code>hanzoai/enso</code> holds the identity prompts and a catalog; the catalog that answers a request is the deployment's, mounted over the copy baked into the image (<code>hanzoai/enso</code> <code>LLM.md</code>). Prices are what <code>GET /v1/models</code> returns; this HIP fixes none.</p>
|
||
<h3>6. Metering and pricing</h3>
|
||
<p>Every routed request is metered on <strong>one plane</strong>, so per-request cost is a real, auditable number (not a model-card estimate). Two models:</p>
|
||
<ul><li><strong>Enso Router</strong> (route across your own pool): a runtime fee of **1% of the routed</li></ul>
|
||
<p> LLM spend**. It is bounded above by the value it creates — routing away from over-provisioned models typically saves a large fraction of spend — and above what it costs to run (a microsecond CPU decision plus a sampled judge call). The fee is incentive-aligned: it grows only as the customer's routed spend grows, and the customer nets the savings minus the fee.</p>
|
||
<ul><li><strong>Enso family</strong> (managed SKUs): fixed <code>$/MTok</code> per SKU, each rung billed strictly</li></ul>
|
||
<p> above its upstream cost, at the rung that served.</p>
|
||
<h3>7. Availability, control, and self-service</h3>
|
||
<ul><li><strong>Self-service.</strong> An org enables Enso Router, selects the providers and models in</li></ul>
|
||
<p> its pool, sets a cost ceiling, and sends <code>model=auto</code> over <code>api.hanzo.ai/v1</code> — usable from any OpenAI-compatible client (CLIs, IDE assistants, agent harnesses). The switch is the org's settings row (<code>/v1/ai/org/settings</code>); the reserved <code>*</code> row sets the platform default, and an org's own row overrides it.</p>
|
||
<ul><li><strong>Provider control.</strong> An org may opt specific providers or models out of its pool</li></ul>
|
||
<p> for data, privacy, compliance, or organizational reasons.</p>
|
||
<ul><li><strong>Data ownership.</strong> The ledger is content-free; an org can export or delete its own</li></ul>
|
||
<p> routing data, and training on the shared base is opt-in.</p>
|
||
<ul><li><strong>Feature gating.</strong> Any capability not yet generally available is gated behind the</li></ul>
|
||
<p> native flag engine (<code>/v1/flags</code>), org-scoped, so the surface ships dark and enables per-org without a release.</p>
|
||
<h3>8. The Enso family</h3>
|
||
<p>The name covers the members below. This HIP specifies the router (§1–§4, §6–§7) and the SKUs (§5); the rest are listed so the name resolves, each with what its repository shows on 2026-09-25.</p>
|
||
<p>| Member | What it is | Repository | Status | |---|---|---|---| | Router | the per-request policy (§1) and its mechanism | <code>hanzoai/ai</code> (live policy); <code>hanzoai/engine</code> (<code>enso</code>, <code>hanzo-router</code>) | shipped: overrides, ε = 0.1 exploration, the prefer table the reward-mean trainer rewrites every 15m; the <code>xᵀWp</code> engine is built, not wired (<code>router.endpoint</code> is empty in <code>hanzoai/universe</code> <code>charts/app/values/hanzo/cloud.yaml</code>) | | SKUs | the managed family (§5) | <code>hanzoai/enso</code> | shipped | | Replay router | a fingerprint-keyed table: an exact recurring question goes to the cheapest model observed answering it correctly, else a domain fallback, else the strongest servable model | <code>hanzoai/enso</code> <code>router/</code> | code and tests; not linked by <code>hanzoai/ai</code> | | Router model | <code>zen-router</code>, 0.6B: one pass emits a task, a route distribution and a feature embedding | <code>zenlm/zen-router</code>, open weights on Hugging Face | experimental (model card); on no serving path: <code>router.endpoint</code> reaches the engine's <code>/route</code>, which never loads it, and <code>enso</code> refuses its 256-dimension feature head (<code>policy::D</code> is 16; <code>enso/tests/seam.rs</code>) | | Enso Diffusion | a sparse mixture-of-experts diffusion transformer with rectified-flow training and sampling, forked from DiT-MoE (arXiv:2407.11633); class-conditional image generation | <code>zenlm/enso</code> (Apache-2.0) | research code; Hanzo's commits touch only licence, docs, CI and ignore rules; no Hanzo-trained weights (no <code>zenlm/enso</code> on Hugging Face) | | Enso Browser | a desktop browser forked from <code>zen-browser/desktop</code> on Firefox 147.0.3 | <code>hanzoai/enso-browser</code> (private, MPL-2.0) | unreleased; upstream name and branding unchanged; no Hanzo feature in the tree |</p>
|
||
<p>Enso Diffusion and the Enso Browser each get their own HIP when there is something of ours to specify: trained weights, or a Hanzo change to the fork.</p>
|
||
<h3>9. Decisions before generation</h3>
|
||
<p>Choosing a model is a bounded decision: the answer space is known. HIP-1332 §13 makes Kai native to Enso. A bounded decision (model and provider, context depth, tools and skills, reasoning budget, stop, retry, escalation) goes to Kai, in process where co-resident and at <code>POST /v1/decisions</code> otherwise. Generation, and any decision Kai defers, goes to a generative model. Each decision program runs in <code>shadow</code> first (HIP-1332 §13.1), so the policy of §1 keeps serving until a program is promoted.</p>
|
||
<p>This HIP adds no requirement; HIP-1332 carries it. On 2026-09-25 no repository implements <code>enso.decide</code>, and <code>POST https://api.hanzo.ai/v1/decisions</code> answers 404.</p>
|
||
<h2>Rationale</h2>
|
||
<p>The learned policy is deliberately a small feature vector and a bilinear form rather than an embedding classifier: it avoids an embedding call (which would dominate the decision at milliseconds) while still capturing task and domain signal, keeping the whole decision on CPU in microseconds. Gating before promotion — rather than continuously overwriting weights — is what makes the loop safe to run autonomously: a regression cannot ship, and the system keeps training until it has a real improvement. Per-org policies over one shared table (via the precedence fold) give every org a router tuned to its own workloads without a per-org serving stack.</p>
|
||
<h2>Backwards Compatibility</h2>
|
||
<p><code>auto</code> is additive: a deployment without a router configuration treats it as any other unknown id, and every other model id resolves unchanged. Callers integrate once (OpenAI-compatible) and opt into routing by requesting <code>auto</code>.</p>
|
||
<h2>Security Considerations</h2>
|
||
<p>The routing ledger is content-free by construction (features and reward only). Reward attachment and the training exports are gated on one predicate, not two kinds of credential: org admin for an org's own data, SuperAdmin for the platform-wide base — membership of the reserved <code>admin</code> org (HIP-0118). A machine doing the export presents its own IAM identity and is subject to the same predicate; there is no token type that substitutes for it. Cross-org isolation is enforced by the precedence fold and the <code>known</code> predicate: a scope can only narrow to models it can serve, never escalate to another tenant's.</p>
|
||
<h2>Reference Implementation</h2>
|
||
<ul><li>Router mechanism and learned policy: <code>hanzoai/engine</code> (<code>hanzo-router</code>, <code>enso</code>,</li></ul>
|
||
<p> <code>hanzo-router-retrain</code>); built, not wired in production.</p>
|
||
<ul><li>Gateway routing, depth lift, per-org/global training, reward ledger, metering:</li></ul>
|
||
<p> <code>hanzoai/ai</code> (<code>controllers/auto_route.go</code>, <code>controllers/depth_route.go</code>, <code>controllers/router_trainer.go</code>).</p>
|
||
<ul><li>Managed family (identity prompts + catalog) and the replay router: <code>hanzoai/enso</code>.</li><li>Router model: <code>zenlm/zen-router</code> (open weights; on no serving path).</li><li>Evaluation harness: <code>hanzoai/enso-bench</code> (private: the specification does not</li></ul>
|
||
<p> depend on it; it produces the eval rows §3 fits on).</p>
|
||
<ul><li>Measurements and economics: the Enso paper (<code>hanzoai/papers/enso</code>).</li><li>Model families: HIP-0511. Decisions: HIP-1332. Model API: HIP-1211.</li></ul>
|
||
<h2>Copyright</h2>
|
||
<p>This document is placed in the public domain.</p>
|
||
<footer>
|
||
<div class="fmap">
|
||
<div><b>Build</b>
|
||
<a href="https://hanzo.app">hanzo.app</a> app builder
|
||
<a href="https://hanzo.codes">hanzo.codes</a> code with an agent
|
||
<a href="https://hanzoskills.com">hanzoskills.com</a> what an agent reads</div>
|
||
<div><b>Run</b>
|
||
<a href="https://console.hanzo.ai">console.hanzo.ai</a> cloud console
|
||
<a href="https://api.hanzo.ai">api.hanzo.ai</a> the API</div>
|
||
<div><b>Account</b>
|
||
<a href="https://hanzo.id">hanzo.id</a> sign in
|
||
<a href="https://pay.hanzo.ai">pay.hanzo.ai</a> top up
|
||
<a href="https://billing.hanzo.ai">billing.hanzo.ai</a> invoices and usage</div>
|
||
<div><b>Company</b>
|
||
<a href="https://hanzo.ai">hanzo.ai</a> canonical
|
||
<a href="https://hanzo.ventures">hanzo.ventures</a> ventures</div>
|
||
</div>
|
||
<div class="fend"><a href="/hip-0510.md">This page as plain text</a> · <a href="/llms.txt">Index for agents</a></div>
|
||
</footer>
|
||
</div></body></html> |