Install a client
Set your key
SQWISH_API_KEY. Keep it out of source control and out of code that runs
in a browser (API keys).
Ask your first questions
One request can ask several questions about the same text, itscontext. This one asks three questions
about a support ticket, one of each decision type:
team: which team should handle it, one of three.urgent: whether it states a deadline within a day, yes or no.impact: how badly the customer is affected, on a scale from 0 to 2.
quickstart.mts and run npx tsx quickstart.mts.
Read the answer
This is a real answerkettei-core gave to that request, rounded to three places:
id.
probabilitieshas every outcome you allowed, with its probability. They add up to 1.topis the likeliest outcome, andp_topits probability.- An ordinal decision adds
expected_level, the probability-weighted level, counted from 0. modelnames the model that answered.
usage, the input tokens you are billed for, and charge, what the call cost.
Read the response explains every field.
A request that names no model asks for kettei-core. If the model you ask for can’t answer right now,
another size may answer instead, and then fallback says so
(models and fallback). To ask about pictures, name kettei-fat or
kettei-chub, and shrink each picture to the size the model reads (images).
Act on it
Add apolicy to a decision and its answer says what to do. With abstain_below, the action is abstain
when p_top is below your threshold. Otherwise it is the likeliest outcome:
Next steps
How OneHot works
The words OneHot uses, and how the pieces fit together.
Write good decisions
Wording the models read well, and the free linter that checks it.
Score many texts
Send thousands of texts within your rate limits, and price them first.
Improve a decision
Label examples, measure, tune the wording and train a model of your own.
