Skip to content
System One

philippdubach/pi-jev-router

A minimal Pareto-optimal router for OpenRouter models in the Pi coding agent, using Jev to pick a model on the cost-quality frontier for each turn.

philippdubach/pi-jev-router on GitHub

Stars
14
Forks
1
Language
TypeScript
License
MIT
Last push
22 Sep 2026

Read from GitHub on . Counts change daily.

How it uses Jev

  const raw = await (client as any).systemOne(
    { model: CLASSIFIER_MODEL, state: env, questions: buildQuestions(env) },
    { signal },
  );
  return normalizeResponse(raw, startedAt, CLASSIFIER_MODEL);
} catch (err: any) {
  return {
    answers: {},
    requestedModel: CLASSIFIER_MODEL,
    resolvedModel: CLASSIFIER_MODEL,
    latencyMs: Date.now() - startedAt,
    ok: false,
    error: err?.message ?? String(err),
    classifierUnavailable: true,
  };

View in src/classifier.ts

Open on GitHub

More like this

Use cases this is tagged with