Loading component…
Loading component…
One request finding a model that answers, as a flow diagram – it branches to each model in fallback order, failed branches break red, the one that answers runs on to the response
To reuse this local React demo, copy all files from the Code tab into the same folder, then import FallbackChain from ./fallback-chain.
import { FallbackChain, type FallbackAttempt } from "@/components/ui/fallback-chain";
export function Route({ attempts }: { attempts: FallbackAttempt[] }) {
return (
<FallbackChain
title="Summarize support ticket"
route="openrouter/auto"
attempts={attempts} // { id, model, provider?, providerLogo?, region?, logo?, status, startedAt?, duration?, timeout?, cost? (USD), reason?, note?, details? }
request={{ name: "HubSpot · Ticket #4821", logo: <HubSpotLogo />, text: prompt }}
response={{ name: "Slack · #support", logo: <SlackLogo />, text: answer }}
onRetry={() => resend()}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| attempts | FallbackAttempt[] | The models in the order they're tried, each with its status: waiting, trying, failed, answered or skipped | |
| title | string | "Request" | What was asked, above the diagram next to the attempt and the running time and cost |
| route | string | The route on the request node, e.g. "openrouter/auto" | |
| request | ChainEnd | Where the request came from – { name, logo, text, details } for its hover card: the source, a preview of the prompt and extra lines | |
| response | ChainEnd | Where the answer goes – { name, logo, text, details } for its hover card; the preview shows once a model answered | |
| now | number | A clock you control for the live timer – without it it follows real time | |
| onRetry | () => void | Shows a Retry button once every model failed | |
| className | string | Extra class on the root |
Below 680px the provider moves into the model's hover card; below 520px the diagram turns into a tree – the request on top, the models branching off one line, the result stays in the line above
Dark mode built in; colors are CSS variables on .ui-fbk