Skip to main content

@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 (default apple-foundation-models).
  • --fallback — none (default), cloud, or any; applies to cases that don't set their own fallback. runEvalSuite also defaults to 'none', matching the runtime.
  • With ENDPOINT set, cloud uses 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. ENDPOINT is ignored (with a warning) unless cloud is in --providers.