Skip to Content
v0.8.0 · shippedNative iOS / Android / Flutter / Capacitor SDKs, A2A discovery, SOC 2 readiness, residency, BYO storage, BYOK. Read the changelog →
SDK reference@mushi-mushi/wasm-classifier

@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-classifier
import { 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