@mushi-mushi/wasm-classifier
Optional on-device pre-classifier built on a Phi-3-mini ONNX model running
under onnxruntime-web. Detects obvious junk before the request even
leaves the browser, cutting your LLM bill.
pnpm add @mushi-mushi/wasm-classifierimport { useWasmClassifier } from '@mushi-mushi/wasm-classifier'
const classifier = await useWasmClassifier()
const verdict = await classifier.classify('asdf qwer')
// → { keep: false, confidence: 0.96, reason: 'low-information' }The web SDK auto-loads this when present and skips classification on the
server when the verdict is keep: false with confidence ≥ 0.85.
Last updated on