Skip to content

AI playlists

With AI_PLAYLISTS_ENABLED=true and ANTHROPIC_API_KEY set, a playlist takes two calls to Claude, both answered in a fixed JSON format:

  1. Plan: Claude reads the request and a summary of the library (genres and decades with song counts, and the 400 artists with the most songs) and answers with a name, a line about the playlist, and filters: genres and artists (and ones to leave out), release years, when songs were last played ("not played in the last 14 days"), when they were added ("added in the last 6 months"), play counts ("never played"), length, which songs to favour (most played, least played, recently added), and how many. Times are counted back from today, never fixed dates. The filters are strict, and the playlist's page lists them ("Not played in 2 weeks · Added in the last 6 months") so you can see how the request was read.
  2. Pick: the filters choose up to 300 songs from the database, and Claude picks and orders the playlist from those, by title, artist, album, year, genre and play count. Only songs from that list are kept, so it can't invent any.

What's sent to Anthropic: the request, that library summary, and the candidates' tags and play counts. File names, paths and audio never leave the server.

Models: Sonnet 5.5 or Haiku 5.5 is usually enough: choosing songs by name is mostly a matter of knowing music, not long reasoning. Opus 5.5 gives the best picks at twice Sonnet's price. A playlist sends roughly 10,000–15,000 tokens (mostly the candidate list), which comes to around 10¢ with Opus, 5¢ with Sonnet and well under 1¢ with Haiku; the playlist's page shows the estimate for each one. If Opus or Sonnet declines a request, Anthropic retries it on another model; Haiku has no such fallback.

"Added" means when a scan first found the song, except for songs from a library's first scan, which all arrive at once: for those it's the file's modification time (if earlier).

Each playlist is a snapshot: the songs as of when it was made. Save as mix keeps its filters instead, as a custom mix under Mixes → Your mixes: every day it picks the mix's number of songs from those meeting the filters (so "not played in 14 days" stays true), weighted by what it favours, with the songs Claude first picked five times likelier. New mix gives another pick, as with the genre and decade mixes. Custom mixes never call Claude again, so they keep working with AI playlists switched off; they can be renamed or deleted from their ⋮ menu.