Building the Jev router

Video lesson

This video comes with the full course

Timestamps (9)
  1. 0:00Set up the TypeSafe API key and Pi
  2. 1:42Scaffold the jev-model-router project
  3. 2:41Prompt Claude to build the extension
  4. 5:10Walk through the generated code
  5. 7:25Export the key and load the extension in Pi
  6. 8:25Route simple prompts to GPT-6 Luna
  7. 9:52Trigger the cache guard with a harder prompt
  8. 11:33Let Jev pick the thinking level too
  9. 12:59Ship the extension to GitHub and npm

Custom Pi Model Router

Building the Jev router

I scaffold an npm project with the TypeSafe SDK, have Claude Code build the /jev Pi extension from a detailed prompt, and walk through the generated code. Then I test it live in Pi: simple prompts route from Astra down to GPT-6 Luna, a harder one triggers the cache guard before switching to Sol, and I finish by adding a thinking-level choice and publishing the extension as @zazencodes/pi-jev-model-router.

Topics

  • Set up the project: export TYPESAFE_API_KEY, run npm init -y, and install @typesafe-ai/sdk
  • Read the build prompt: the Jev Choice criteria for simple, standard and complex, the MODELS map for OpenAI Codex, and the ctx.ui.confirm cache guard
  • Walk through jev-model-router.ts: pi.registerCommand("jev", ...), the mid-session check, setModel, and sendUserMessage
  • Watch Jev route “what is in this dir?” to Luna, keep a node_modules question on Luna at 65%, and send a feature request to Sol
  • See the cache guard warn before a Luna to Sol switch, cancel on No, and route without asking when the prompt is the first in the session

Timestamps

  • 0:00 - Set up the TypeSafe API key and Pi
  • 1:42 - Scaffold the jev-model-router project
  • 2:41 - Prompt Claude to build the extension
  • 5:10 - Walk through the generated code
  • 7:25 - Export the key and load the extension in Pi
  • 8:25 - Route simple prompts to GPT-6 Luna
  • 9:52 - Trigger the cache guard with a harder prompt
  • 11:33 - Let Jev pick the thinking level too
  • 12:59 - Ship the extension to GitHub and npm

Comments (0)

No comments yet.