A System One model in the browser.
Fast, typed decisions from text, on the user's device, with confidence you can trust. When it isn't sure, it asks an LLM and learns from the answer.
the app crashes when I open settings
Sure: answered on this device
import { createDecider } from "decidekit";
const d = await createDecider();
const { choice, confidence } = await d.decide(
"my card still hasn't arrived",
["card_arrival", "lost_card", "refund"],
);
// choice: "card_arrival", typed as your labelsIt starts out knowing only twelve label names. What it's sure of, it answers itself; the rest goes to an LLM, and every eight answers it retrains. The LLM's answers were recorded once, so the demo is free to watch.
Kahneman called fast, intuitive thinking System 1, and slow, careful thinking System 2. A System One model is the fast kind: it doesn't write anything, it reads the text once and picks one of the options you give it. That makes it quick, cheap and safe to wire into code.
Think of Decide as a local Jev. TypeSafe's Jev is a System One model behind an API; Decide runs on the user's device, so each decision is free, private and a few milliseconds. Jev hands back a confidence and leaves the unsure cases to your code. Decide can send them to an LLM, its System 2, and learn from the answer, so it needs the LLM less over time.
Further reading: System One models (TypeSafe) · Introducing Jev · Confidence in Jev · Thinking, Fast and Slow
The answer is always one of your labels, typed as their literal union. No parsing, no made-up labels.
Trained heads are calibrated: an answer at 0.9 is right about 90% of the time, so a threshold means what it says.
Wrap your LLM call in withFallback: unsure texts go to it, its answers become training data, and it gets asked less.
A 34 MB model in a web worker, cached after the first visit. It adds 3.6 kB to your page bundle.
Train a head from a few examples per label in seconds, without sending the text anywhere.
The same API everywhere, React hooks, and a decider for the switch harness.
Answer the easy majority on device; send only unsure texts to an LLM, which teaches it as it goes.
Billing, bug, account: route a message, and show the right help while the user is still typing.
"Make it darker" to theme.dark, in milliseconds and offline.
Read typed player chat and commands with no server.
Health, finance and internal tools: training and deciding stay on the device.
A free decision model for switch, with an LLM as its teacher.