Music streaming · Music app developers
Map Playlist Mood Descriptions to UI Color Palettes
Static genre tags fail to capture evocative user playlist descriptions like 'midnight drive through rainy neon streets'. This example evaluates free-text atmospheric descriptions against defined visual themes to select an appropriate color palette archetype for UI rendering.
Updated · Examples verified with jev-1.13.0
Interactive demo
Floating Atmosphere Particle Cluster
Playlist atmosphere descriptions trigger glowing colored particles that float into liquid containers proportional to matching palette probabilities.
The visitor inputs text such as 'rain splashing on city neon at 2 AM' and presses analyze. Each run sends one live request to the public API; results are model judgments and can vary.
Verified sample results (4 inputs, jev-1.13.0)
Midnight urban rain setting with strong neon synthwave vibe
{ "state": { "playlist_description": "rain splashing on city neon at 2 AM with glowing midnight violet light and chrome synth pads" }, "answers": { "is_nighttime": { "noul": 0.99, "type": "noul" }, "palette_category": { "type": "choice", "choice": "neon_synthwave", "confidence": 1, "probabilities": { "pastel_lofi": 0, "golden_sunset": 0, "neon_synthwave": 1, "earthy_acoustic": 0, "unclear_atmosphere": 0 } } } }Natural sunlit organic acoustic setting
{ "state": { "playlist_description": "sunlight streaming through forest canopy in morning, warm acoustic guitar, mossy logs and hot tea" }, "answers": { "is_nighttime": { "noul": 0.01, "type": "noul" }, "palette_category": { "type": "choice", "choice": "earthy_acoustic", "confidence": 0.98, "probabilities": { "pastel_lofi": 0, "golden_sunset": 0.02, "neon_synthwave": 0, "earthy_acoustic": 0.98, "unclear_atmosphere": 0 } } } }Sun-drenched golden hour sunset atmosphere
{ "state": { "playlist_description": "warm golden hour afternoon sun, amber rays over summer beach, sun-drenched chill music" }, "answers": { "is_nighttime": { "noul": 0.01, "type": "noul" }, "palette_category": { "type": "choice", "choice": "golden_sunset", "confidence": 1, "probabilities": { "pastel_lofi": 0, "golden_sunset": 1, "neon_synthwave": 0, "earthy_acoustic": 0, "unclear_atmosphere": 0 } } } }Soft vintage pastel lofi aesthetic
{ "state": { "playlist_description": "soft cassette tape hiss, faded pink sky, cozy bedroom afternoon study beats and pastel lofi aesthetic" }, "answers": { "is_nighttime": { "noul": 0.03, "type": "noul" }, "palette_category": { "type": "choice", "choice": "pastel_lofi", "confidence": 1, "probabilities": { "pastel_lofi": 1, "golden_sunset": 0, "neon_synthwave": 0, "earthy_acoustic": 0, "unclear_atmosphere": 0 } } } }
The problem
The application receives a short free-text atmosphere description written by a user or playlist curator. Traditional metadata like genre, tempo, or release year does not reveal whether a playlist feels like a neon synthwave night or a golden sunset afternoon. The application must evaluate the ambient description against candidate palette definitions and choose the matching archetype or select a neutral default theme. Downstream code then uses this evaluation to update player UI styling dynamically.
How TypeSafe helps
In these observed examples, the application submits the atmosphere_description text field under the palette_archetype choice question. For inputs describing rainy synth streets or warm coastal sunsets, the returned evaluations selected the neon_synthwave and golden_sunset archetypes, whereas generic focus text yielded unclassified_neutral. Downstream application code can read the returned choice to update player interface themes or load matching CSS palette variables. While the API provides the visual classification judgment based on criteria, application code executes the actual theme routing and determines local UI fallback policies.
- Input
- A short free-text playlist atmosphere description.
- Decision
- Choose the colour palette archetype (neon synthwave, earthy acoustic, pastel lofi, golden sunset) the description evokes.
- Next action
- Apply the matching colour theme to the player interface.
Three verified examples
These responses were returned during a previous API verification. New probabilities can differ.
Midnight drive through rainy neon streets state (primary)
Expected behavior: Atmosphere description describes a rainy nighttime synth setting, matching neon_synthwave.
Input
{
"atmosphere_description": "Midnight drive through rainy neon streets with synth retro rhythms."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 461,
"output_tokens": 67
},
"answers": {
"palette_archetype": {
"type": "choice",
"choice": "neon_synthwave",
"confidence": 1,
"probabilities": {
"pastel_lofi": 0,
"golden_sunset": 0,
"neon_synthwave": 1,
"unclassified_neutral": 0
}
}
}
}Warm acoustic golden hour sunset state (alternative)
Expected behavior: Atmosphere description describes a warm summer golden hour setting, matching golden_sunset.
Input
{
"atmosphere_description": "Warm acoustic guitars playing during a summer golden hour sunset on the coast."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 462,
"output_tokens": 67
},
"answers": {
"palette_archetype": {
"type": "choice",
"choice": "golden_sunset",
"confidence": 1,
"probabilities": {
"pastel_lofi": 0,
"golden_sunset": 1,
"neon_synthwave": 0,
"unclassified_neutral": 0
}
}
}
}Generic algebra homework atmosphere state (edge case)
Expected behavior: Atmosphere description lacks visual or atmospheric imagery, falling back to unclassified_neutral.
Input
{
"atmosphere_description": "Tracks for focusing on algebra homework."
}Previous verification response
jev-1.13.0 ·
{
"model": "jev-1.13.0",
"usage": {
"input_tokens": 455,
"output_tokens": 67
},
"answers": {
"palette_archetype": {
"type": "choice",
"choice": "unclassified_neutral",
"confidence": 0.97,
"probabilities": {
"pastel_lofi": 0.02,
"golden_sunset": 0,
"neon_synthwave": 0,
"unclassified_neutral": 0.98
}
}
}
}Try online
Start with a verified example, edit the request, then ask Jev. A live request is sent only when you press Try online.
Expected behavior: Atmosphere description describes a rainy nighttime synth setting, matching neon_synthwave.
Use non-sensitive test data. Live input goes to typesafe.pro and TypeSafe. Anonymous requests use the gateway’s free rate limit.
The best-fitting label
Probabilities compare your labels. Confidence describes how decisive the model is, not whether it is correct.
import jsonfrom urllib.error import HTTPError, URLErrorfrom urllib.request import Request, urlopenBASE_URL = "https://api.typesafe.pro"payload = { "model": "jev-latest", "state": { "atmosphere_description": "Midnight drive through rainy neon streets with synth retro rhythms.", }, "questions": { "palette_archetype": { "type": "choice", "criteria": { "pastel_lofi": "Cozy room, chill beats, soft warm pastel colors, rainy afternoon or coffee aesthetic.", "golden_sunset": "Warm acoustic sunbeams, summer afternoon, golden hour glow, open road outdoor vibes.", "neon_synthwave": "Nighttime, rainy streets, glowing neon lights, futuristic or retro electronic mood.", "unclassified_neutral": "The description is generic, missing atmospheric visual detail, or does not clearly evoke any defined palette archetype.", }, "instructions": "Evaluate the playlist atmosphere description in state and select the single visual color palette archetype it best matches, or unclassified_neutral if none match.", }, },}request = Request( f"{BASE_URL}/v1/systemone", data=json.dumps(payload).encode("utf-8"), headers={"Content-Type": "application/json"}, method="POST",)try: with urlopen(request, timeout=20) as response: result = json.load(response)except HTTPError as error: raise SystemExit(f"API returned HTTP {error.code}") from errorexcept URLError as error: raise SystemExit(f"Connection failed: {error.reason}") from errorprint(json.dumps(result["answers"], indent=2))Limitations and review
- This single Choice question returns one primary option per request, though applications can use independent Noul questions if a workflow requires multi-label attribute scoring for complex playlist descriptions.
- The unclassified_neutral label provides an explicit no-match option in criteria, but you can implement application-side confidence thresholds or fallback default themes before applying visual updates.
- Categorizing user text into visual archetype options provides a semantic mood triage rather than authoritative music metadata verification or guaranteed visual suitability.
Set thresholds against your own examples before relying on an automated decision.