jev-piano
Jev can’t write a note, but with the right questions it improvises piano.
# Jev at the piano
**Experimental.** Jev cannot generate text, or code, or a single note. It answers typed questions
with probabilities and nothing else. So this hands it a piano and asks it questions.
Describe a mood — *a slow, sad waltz* — and it plays, continuously, deciding as it goes.
**Live at [jev-piano.zammitpaul.com](https://jev-piano.zammitpaul.com).**
## An X collaboration
This started on X. [@BaselAshraf81](https://x.com/BaselAshraf81) tried to make Jev play the piano,
found that it would not, and put five dollars on whoever could.
[@LamplighterPaul](https://x.com/LamplighterPaul) reckoned that given some music theory it would
find the next chord quite happily. So we are building it together.
We think it is possible. We are trying.
## Run it
```sh
npm ci && npm run build
TYPESAFE_API_KEY=... npm start # http://localhost:8787
```
Add `TYPESAFE_API_KEY_2` (and `_3`, `_4`…) to rotate over several keys: calls go round robin, and a
key that comes back rate limited stands aside for the next one. `TYPESAFE_API_KEYS` also takes a
comma-separated list. `GET /api/health` reports how many it found.
## Why "it cannot play piano" was the wrong test
The obvious experiment is to feed Jev the notes so far and ask for the next one. That cannot work,
and not for any musical reason: [Jev](https://typesafe.ai) is a System One model whose entire API is
`{state, questions} -> probabilities`. Three question types — yes/no, pick one of these, score on
this scale. It has no way to emit a note, the same way it has no way to emit a word.
Ask it the question it *can* answer and it turns out to know a great deal:
```
"a slow, sad waltz"
C minor · 3/4 · 70 bpm
bar 1 — where Jev put its weight across all 36 chords it was offered:
Cm █████████████████████