@stewmore/expo-ai-evals
A Node-first evaluation harness for the runtime. Add it early — even a simple suite catches regressions across providers.
npm install --save-dev @stewmore/expo-ai-evals
Purpose
- Compare provider output quality.
- Verify schema validity.
- Track latency.
- Track fallback frequency.
- Test privacy boundaries.
- Detect SDK regressions.
Result shape
export type EvalResult = {
provider: ExpoAIProvider;
testName: string;
passed: boolean;
latencyMs: number;
usedFallback: boolean;
schemaValid?: boolean;
errorCode?: ExpoAIErrorCode;
detail?: string; // error message, or why a privacy check passed/failed
};
The harness runs against mock adapters, so it needs no API keys or devices:
npm run eval # from the repo root
npm run eval -- --providers apple-foundation-models,cloud --fallback cloud
--providers— comma-separated providers to register a mock adapter for (defaultapple-foundation-models).--fallback—none(default),cloud, orany; applies to cases that don't set their ownfallback.runEvalSuitealso defaults to'none', matching the runtime.- With
ENDPOINTset,clouduses the real reference server through@stewmore/expo-ai-cloud. That package is an optional peer dependency: install it only if you eval against a cloud backend.ENDPOINTis ignored (with a warning) unlesscloudis in--providers.