I wanted `if` statements for fuzzy conditions, so I built askif
Description and use
A developer built askif to enable fuzzy condition branching using Jev, simplifying code and reducing costs.
Problem
Hard to express fuzzy conditions in code for branching logic, e.g., triaging support tickets for human agent requests.
Outcome
Reduced code complexity, improved maintainability, and achieved cost of ~$0.013 per 1,000 calls with ~250 ms latency.
Workflow
- Install
askifand@askif/jevvia npm. SetTYPESAFE_API_KEY. Useask.ifto evaluate a condition string and provide callbacks forthen,else, andunsure. Optionally useask.switchfor multi‑choice routing. Optionally useask.scorefor severity scoring. Handle the returned probability or boolean as needed.
Evidence
"askif" lets you branch on fuzzy judgments (ask.if, ask.switch, ask.score) with typed results.
Cost: about $0.013 per 1,000 calls.
Latency: 72 ms inference + 175 ms network ≈ 250 ms.
Node 22+, server-side only. TypeSafe's SDK refuses to run in a browser, since it would expose your API key.
- Record date: 2026-10-01T21:56:01.866Z