shipwithjev

Catalog / Games & real time

0339GitHub

jev-palette

Command-palette demo where a single Choice question over a 77-command catalog turns the returned probability distribution into the per-keystroke ranking for Portuguese or English…

amycardoso/jev-paletteREADME ↗
# jev-palette

A semantic command palette (⌘K) demo powered by [Jev](https://typesafe.ai),
TypeSafe AI's System One model. Type your *intent* — in Portuguese or English —
and the palette ranks 77 commands by meaning, side by side with a classic
fuzzy matcher that fails honestly on the same queries.



*"jogar fora essa mensagem" → Delete message · "make it dark in here" → Toggle
dark mode (100%) — while the fuzzy baseline finds nothing.*

## The trick

One `Choice` question per keystroke, with the whole command catalog as options.
Jev returns the **full probability distribution** over all options in a single
~100ms call — the distribution *is* the ranking. No embeddings, no vector
index, no output tokens billed.

```
state:     { query: "jogar fora essa mensagem" }
question:  { type: "choice", instructions: "Which command does the user want?",
             criteria: { delete_message: …, archive_message: …, ×77 } }
answer:    { choice: "delete_message", probabilities: { delete_message: 0.64, … }, confidence: 0.62 }
```

At ~900 input tokens per call and $0.042 per million input tokens, every
keystroke costs about **$0.00004**.

## Running it

```bash
npm install
cp .env.example .env   # put your TYPESAFE_API_KEY in it
npm run dev            # proxy on :8787 + Vite on :5173
```

No key yet? `npm run dev:mock` (or just `npm run dev` without a key) serves a
local keyword-based stand-in so the UI works offline — a "modo mock" badge
shows in the header until the real key is configured.

## Layout

- `server/index.mjs` — tiny Node proxy; keeps the API key server-side, calls
  `POST https://api.typesafe.ai/v1/systemone`, falls back to mock mode.
- `server/jev.mjs` — pure helpers: request building, distribution → ranking,
  cost accounting. Covered by Vitest.
- `src/commands.js`

Also filed under Games & real time

  1. 0607

    2048Jev: Jev plays 2048

    Built a demonstration of Jev playing 2048. Note: It might not always win. :)

    @TheRealRajdeep · Games & real time

  2. 0603

    System 1 Speedcuber: a Rubik's cube agent

    A speedcubing agent built on Jev and Laya ModernBERT-421M, with real-time 3D state, temporal memory and calibrated move probabilities instead of a solver.

    @harsha_varma02 · Games & real time

  3. 0597

    Astra and Jev play Minecraft

    A video letting Astra plan and Jev act inside Minecraft, with an outcome the creator didn't expect.

    @MatinSenPai · Games & real time

  4. 0593

    Jev Kitchen

    Inspired by @heystefan_: name a dish or a cocktail, and its ingredients rise out of a pile of stickers. ⚡ Jev judges every search in half a second 🎨 ~1,000 illustrations by FLUX.1 [dev], run locally through ComfyUI 🧠 Claude Opus 5.5 built it all and redrew the illustrations

    @nelsonpklark · Games & real time