Back to components

AI Interfaces

Speculative Model Race

A parallel routing view where a fast draft streams while a deeper model verifies response quality.

routinglatencymodels

Installation

Copy and paste the code into your project.

Accessibility notes

The ordered list preserves race priority and every candidate exposes timing, quality, and status as text.

Speculative race

Parallel response routing

310ms saved
  1. 1

    Fast draft

    Quality 91

    380ms

    Accepted

  2. 2

    Deep verify

    Quality 96

    1.2s

    Checking

  3. 3

    Fallback

    Quality pending

    —

    Standby

The first valid draft streams while a deeper model verifies the answer.

Preview accent

TypeScript
const racers = [{ model: "Fast draft", time: "380ms", status: "Accepted", score: 91 }, { model: "Deep verify", time: "1.2s", status: "Checking", score: 96 }, { model: "Fallback", time: "—", status: "Standby", score: 0 }];

export function SpeculativeModelRace() {
  return <section className="w-full max-w-md rounded-xl border border-white/12 bg-[#0b0f14]/92 p-4 shadow-2xl">
    <header className="flex items-start justify-between"><div><p className="text-xs font-semibold uppercase tracking-[0.18em] text-[#40E0D0]">Speculative race</p><h3 className="mt-1 text-base font-bold text-white">Parallel response routing</h3></div><span className="rounded-full bg-[#40E0D0]/10 px-2.5 py-1 text-[0.65rem] font-bold text-[#d8fffb]">310ms saved</span></header>
    <ol className="mt-4 space-y-2">{racers.map((racer, index) => <li key={racer.model} className="grid grid-cols-[auto_1fr_auto] items-center gap-3 rounded-lg border border-white/9 bg-white/[0.025] p-3"><span className="grid h-8 w-8 place-items-center rounded-full bg-white/[0.06] text-xs font-bold text-slate-400">{index + 1}</span><div><p className="text-xs font-semibold text-slate-200">{racer.model}</p><p className="mt-1 text-[0.65rem] text-slate-500">Quality {racer.score || "pending"}</p></div><div className="text-right"><p className="text-xs font-bold text-white">{racer.time}</p><p className="text-[0.65rem] text-slate-500">{racer.status}</p></div></li>)}</ol>
  </section>;
}
Usage
<SpeculativeModelRace />

Related components

Routing sandbox

Model route simulator

1,000 runs
  • Simple lookup

    → Fast

    $0.002
  • Multi-step reasoning

    → Deep

    $0.041
  • Sensitive action

    → Deep + review

    $0.058

Projected cost

$18.70

Quality target

92.4%

AI Interfaces

Model Route Simulator

Advanced

A routing sandbox for projecting model selection, quality, and cost across different request classes.

routingmodelssimulation
View component

Agent handoff

ready
CSBL

Billing specialist

Confidence 96%

Context attached

  • Customer intent
  • Billing history
  • Draft response

AI Interfaces

Agent Handoff Card

Intermediate

A transparent transfer surface for routing conversations between specialized agents with shared context.

agenthandoffrouting
View component

Model availability

Regional endpoints

  • Reasoning

    US East

    620ms

    Available

  • Realtime

    Europe

    94ms

    Available

  • Vision

    Asia Pacific

    —

    Degraded

AI Interfaces

Model Availability Grid

Beginner

A regional model status grid showing endpoint health and observed latency.

modelsavailabilitystatus
View component