Inspiration

I've loved creating mixtapes since they were actual tapes; all the existing music-discovery and playlist-building tools I could find only provided me with very general themes and genres. I couldn't ask for "jangly 90s indie songs that aren't on every 'best of' list" or "songs for a road trip with kids, but absolutely no Baby Shark please."

What it does

Describe the music you want to find -- could be a vibe ("rainy day at the beach"), a sub-genre ("disco polka"), or a set of requirements ("acoustic indie songs with my name in them"). GPTunes will find music that fits what you want, and builds you a playlist that you can listen to immediately.

How I built it

The app (Vue.js and Nuxt) takes the request from the user, creates a prompt from it, and submits it to the Gemini API (Flash), asking the LLM to return a list of tracks that meet the request, in JSON format. It then formats the response into a playable playlist and displays it for the user. If the user wants to refine the playlist, the prompt is updated to include refinement instructions and the previous set of songs.

Challenges I ran into

At first, hallucinated songs were a major challenge -- the LLM would return tracks that fit the user's criteria perfectly, except for the minor problem that they had never been recorded. Asking the LLM to provide a reason for each song it included cut down the hallucination issue to almost nothing (I then filtered out the few non-existant songs that remained by cross-checking them against the YouTube API).

What I learned

I learned that asking the model to provide reasoning for each choice dramatically improved output quality, and that enforcing structured JSON responses made the front-end integration a lot easier. I also used the AntiGravity IDE for the first time on this project, which greatly speeded up the process of working with unfamiliar APIs.

What's next for GPTunes

I'd love to implement some kind of user account system, saving playlists, exporting them, etc (this will require careful navigation of various APIs' ToS though), and expanding from that -- social features like collaborative playlists, communities, and so on.

Built With

Share this project:

Updates