An AI DJ. A local LLM (served via Ollama) progressively composes music by editing a song file. Each "turn" the DJ reads the current song, proposes a unified diff, we apply it, and the player renders what's changed. Over time the song grows, mutates, and evolves — live.
- The song lives in a single plain-text file (
.aidjformat) that is cheap for an LLM to read, diff, and mutate. - The DJ loop repeatedly:
- Reads the current song file.
- Prompts Ollama (
/api/chat) with the file + recent "DJ context" (beat position, energy, listener cues). - Receives a unified diff.
- Validates + applies the diff.
- The player hot-reloads and continues from the current beat.
- All state is in the file → the session is trivially replayable / rewindable
via
git logon the song file.
# 1. Ollama running locally on :11434 with a model pulled
ollama pull llama3.1
# 2. Install
uv sync # or: pip install -e .
# 3. Run the DJ on an empty song
aidj dj songs/new.aidj --model llama3.1src/aidj/ # package code
songs/ # song files (the DJ's working canvas)
prompts/ # system prompts + few-shot examples
tests/ # unit tests
See CLAUDE.md for architecture details.