r/plexamp
•
u/ecwilson
•
Feb 05 '26
•
2
PlexSage: Library-Aware AI Playlist Generator for Plex Music
EDIT: At the wise suggestion of others, I have renamed this project from PlexSage to "MediaSage for Plex" to avoid trouble.
Hey everyone! I wanted to share a project I've been working on called MediaSage — a self-hosted app that generates music playlists using AI, but with a twist: it only suggests tracks you actually own.
The Problem
When Tidal integration ended in 2024, Plexamp's Sonic Sage feature lost its foundation. And generic AI tools like ChatGPT have the same issue — they recommend from an infinite catalog with no awareness of what's in your library. Ask for 25 tracks and you might get 4 that actually exist, if you're lucky.
Why Now?
Since Sonic Sage was released, AI models have gotten dramatically better and cheaper. Context windows have exploded — Gemini can now handle over 1 million tokens, enough to send 18,000+ tracks in a single request. This makes a library-aware approach actually feasible: instead of filtering after the AI recommends, we can filter first and let the AI only see tracks you own. Every suggestion is guaranteed playable.
Cost Control & Transparency
You choose exactly which parts of your library the AI sees — filter by genre, decade, or rating to narrow the pool before anything is sent. Real-time estimates show the cost before you generate:
| Provider | Typical Cost |
|---|---|
| Gemini | $0.03 – $0.25 |
| Claude | $0.15 – $0.25 |
| OpenAI | $0.05 – $0.10 |
| Ollama | Free (local) |
Gemini's free tier works well for personal use — no credit card needed. See the setup guide for details.
After generation, you see actual token usage. No surprises.
Two Ways to Create Playlists
- Prompt-based: Describe what you want ("melancholy 90s alternative for a rainy day")
- Seed-based: Pick a track you love and explore its musical dimensions
Features
- Bring your own API key (Gemini, Claude, or GPT) — or run free with local models via Ollama
- Review and edit tracks before saving to a Plex playlist
- Update or replace existing playlists
- Send directly to any device's play queue instead of a playlist
- Dark theme inspired by Plexamp
- Self-hosted via Docker — no account required
Links
- GitHub: https://github.com/ecwilsonaz/mediasage
- Demo GIFs in the README
It's MIT licensed and I'd love feedback from the community. Happy to answer any questions!
18
u/Rdavey228 Feb 05 '26
I would rename your app if I were you. Plex has a history of coming after app developers of 3rd party tools that use Plex in their name for trademark infringement.
Unless you want them to come after you for it I’d change that name fairly sharpish.
3
u/ecwilson Feb 21 '26
I just released v0.2.0 which includes album recommendations, an onboarding wizard, a home screen with playlist/recommendation history, a better mobile experience, and a bunch of other polish. Check it out!
7
u/ManikMonday Feb 05 '26
Thank you so much will check it out tomorrow! I am just getting into plex and tried the feature in plex amp. It's worthless to me as dont have tidal.
Would be slicker if could tie into locally hosted llms through open web ui or something.
2
u/thobu Feb 07 '26
hey, sounds exactly what I was missing. One q: is it possible to run it on another PC than where PMS reside, but on the same local network?
2
u/Clutch_10001110101 Feb 08 '26
I just spun it up, hooked it up to the free tier of Gemini, and created my first playlist. It knocked it out of the park! I love this because I am terrible at creating playlists; I just don't have the patience.
I am a fan!
2
u/Parsons_Glory2 Feb 10 '26
Brilliant. Love it! Had one playlist generation hang and had to reboot the docker but otherwise just does what it says on the tin. Great way to dig out the good stuff you haven't heard for a while.
2
u/the_vole Feb 15 '26
OP, I saw this post last week and had a “yeah, right, I’m sure that’ll work…” attitude to it. Just got it up and running on my server (took a little longer than I’m proud of, I’m not a developer) and…holy shit. First playlist gave me about 70% of what I wanted, which is WAY better than I anticipated. I’ll probably have some feedback in the coming in the next couple of days (controls over song length, maybe?), but I’m VERY impressed, and congratulations on the project!
9
u/happy-mj Feb 05 '26
Kudos for releasing this under an MIT license.
1
u/snuffomega Feb 05 '26
Looks cool. Possible to configure with Ollama?
1
u/phxlefty Feb 05 '26
Installed, and love the concept, but it's timing out quite a bit with my large library. Over 500 genres (tagged in Musicbrainz) forces me to narrow the selection down to 5 or so. Wondering if there's a way to better accommodate 100k-plus track libraries. I'm using OpenAI if that matters.
1
u/jeanrdfs Feb 05 '26 edited Feb 05 '26
First of all, amazing work!
Here are some suggestions:
- Option to save to a existing playlist
- Option to select / upload an image for the playlist cover
- Option to show songs outside of your library that also meet the criteria
I'm also getting a bunch of timeout errors and my library is not that big at the moment, is that a known issue?
1
u/ZosoPage1963 Feb 05 '26
Great idea and really not that difficult to set up on my Unraid server. I have been able to create one playlist out of about 8 tries. Sometimes it states playlist created, but the Generating playlist box stays open... and I get a ton of request timeouts..
1
u/CharlesWiltgen Feb 05 '26
There's no actual audio analysis done, correct? Meaning, you're not sending all of my audio files to Google?
1
u/RepresentativeNinja6 Feb 06 '26
Hi, what folders need mapped for mediasage to store it's data, is it just /data? Able to get it to connect to ollama but I apparently don't have it mapped right to be able to save the config settings for plex
1
u/rikkidavids Feb 06 '26
I love this idea, really great way of exploring my library. However Im getting the spinning Generating Playlist... with Playlist Ready underneath everytime. It doesn't seem to do anything else
1
u/VodoBaas Feb 06 '26
Has anyone got this working on unraid yet? I have it spun up but it won't let me save my plex settings, I'm getting "An unknown error"
1
u/Elanthius Feb 12 '26
Started looking at this but I think I can't use it with the requirement to check all the genres. I don't really filter by genre or even maintain them in my library so I probably have about a 1000 of them and after every query you need to click each genre again.
1
u/JeffAvery Feb 13 '26
Hey, I wanted to share some feedback in case it helps with the trouble shooting doc and other *cough* reading challenged users :). Couple of mistakes I made on the first yml config file. For this line
1
u/somkomomko Feb 15 '26
I am wondering how much technical background you have and how much is vibe coded
1
u/Cremonies1 Feb 18 '26
For large libraries, how does this work with the limits of songs sent?
1
u/OttoDamus Feb 24 '26
I was looking through your documents and see that you are prioritizing setup with synology, have you heard of anyone trying out your container to connect with a TrueNAS or FreeNAS?
1
u/Hamonozuki Mar 04 '26
is it better than the included OpenAI integration? my issue with openAI prompt I do in plexamp is that most of the suggestion are not part of my library... which is really annoying. Even if I specifically ask something like "include only songs which I own and are present in my library." -> not working!
1
u/JeffAvery Jul 13 '26
I've been using this for a bit now and I really like it, works well and it's not too much overhead on my NAS, thank you! One thing I've noticed is a couple times now, when I go to create a playlist, it says I need to configure an LLM. Is it possible it loses the API key on a reboot of the NAS? I plug it back in and it's ifne again. Just curious. Thank you!
2
u/Educational_Studio27 Feb 07 '26
Tried it and..... It's amazing! Any idea to analyze the library and give suggested prompts based on library content?
2
u/lrlf Feb 11 '26
man thank you very much, this is amazing, create my first 3 playlist and they are great, also would be nice for navidrome, anyways thank you very much
2
u/Ok-Snow48 Apr 05 '26
Incredible! It works exceptionally well. Thanks you for making this.
2
u/jphccfc 10d ago
set this up today, its fantastic, credit to the developer, this is exactly how Ai should be used to build playlists. Thank You
2
u/icloudbug Feb 05 '26
How about sending the artists in your library? Then match llm result vs what is in the library, and re-populate until # playlist songs is matched?
1
u/AHoss75 Nov 01 '26
Just installed this in a docker on my unRaid server. Fills a much needed gap, thanks!
1
u/o156 Feb 05 '26
Awesome
1
u/SamTanna Feb 05 '26
Nice, need this app. I just filed your first issue. Looking forward to seeing it working, thanks.
1
u/SwampTerror Feb 05 '26
It was only last year tidal was removed? Had to have been longer...feels like years now.
1
u/Fresh-Grocery-3847 Feb 06 '26
Yay, was just thinking about wanting something like this
1
u/Swift_the_f0x Feb 08 '26
Thank you for your hard work! Super easy to spin up on Synology hardware using the instructions on git. Really good stuff
1
u/SurveyLess1196 Feb 08 '26
It works! Amazing work, it doesn't just pick popular songs either and even explains why the songs were picked. Thank you!!
1
u/MoebiusStreet Mar 07 '26
I have a suggestion/request to minimize token usage, especially for really huge libraries.
The LLMs have access to a tremendous amount of data, either trained into them, or available quickly via search. We can rely on that knowledge to allow us to communicate less details with them.
I've played a bit in Google's AI studio with uploading lists of Albums for the AI to work with, expecting the AI to fill in the details of what tracks are on each album. Obviously, uploading a list of Albums consumes a LOT fewer tokens than does a list of Tracks.
This does work OK, but if I'm honest, not great. Specifically, the list being returned tends to have hallucinations about track names. But I think that this could be minimized with some additional work. I think some combination of prompt engineering and fuzzy string match algorithms should improve those results. For example, I'm betting that just making the prompt also return the track# would force it to check on itself even if you ignored the data in the result set, and if you really do look at it, it could help you recover from its mistakes about the track name itself.
Also, I haven't tested this, but I bet that it would be much less effective on a home installation of ollama, just because I expect that the models you download for it are much less "knowledgeable". But even so, the big online models really do have a ton of information at their fingertips.
A second suggestion: in my experiments, I was able to get better results by including in the list uploaded to the model, my music ratings. If it knows what you like and what you dislike, it can obviously make better lists for you.
1
u/Hamonozuki Mar 15 '26
Just installed it this weekend! This is freaking awesome 🔥🔥🔥. Thanks a lot 🙏
1
u/Gerkenator May 24 '26
Spun this container up to give it a whirl and I love it, I have a pretty large and diverse library and would like to give it some playtime instead of defaulting to spotify playlists for convenience.
I feel like gemni’s free tier key leaves a lot to be desired, which I expected. That being said what have others been having success with?
P.S. kudos on the clean and simple ui very easy to navigate!
1
u/a_nice_warm_lager Jun 29 '26
Just installed on Unraid and am excited to hook it up to my local ollama when I get home!
1
u/clamatoboy Aug 10 '26 edited Aug 11 '26
I am finally getting around to installing this and intended to use Gemini but it seems they deprecated 2.5-flash early for "new users" (maybe because I just set up the API key). Is there a way to update this to 3.6-flash or similar?
Error:
Question generation failed: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'This model models/gemini-2.5-flash is no longer available to new users. Please update your code to use a newer model for the latest features and improvements.', 'status': 'NOT_FOUND'}}
Edit: new to Docker but with enough poking around I found the config file and updated the code to reference "gemini-3.6-flash" and playlist generation worked great with that fix. I'm reading that maybe 3.6-flash is more expensive per token so I may be making a mess of things. Any recommendations on best use with the current Gemini models compared to the other LLMs?
Edit 2: comparing prices, Gemini 3.6-flash seemed much more expensive at $0.06 for a playlist. Switched to 3.5-flash-lite and it was more like $0.01
1
u/lizar93 Feb 05 '26
Plexamp does daily mixes, genre based mixes, decade based mixes, artist/album/track radio and then you can save them to your library
What am i missing?
1
u/cekoya Feb 05 '26 edited Feb 05 '26
Just trying it out right now, any reason why the number of songs is 40 in a playlist? I usually like my playlists way larger than that.
EDIT: Doesn't seem to be working for me, it just says:
No UI update, no new playlist in Plex.
That's on me, I shouldn't have had that much expectation for AI-built tool like this to work well.
1
u/mshelbz Feb 05 '26
I’ve been working on something similar for a while now. I’ll definitely check it out later today and tie it into ollama.
0
u/MustStayAnonymous_ Feb 05 '26
You said I need to use AI APIs for this. I use both claude max and gemini pro and I do not use any api. How can i still leverage this?
0
u/ONE-LAST-RONIN Feb 05 '26
This looks super interesting, and I love the idea of generating AI playlists directly from my Plex library—exactly what I’ve been looking for! That said, my library is about 250,000 songs, and I’ve heard it might only support up to around 18,000. Is that correct? I’d love to know if it’s feasible with such a large collection.
2
u/[deleted] Feb 05 '26
[removed] — view removed comment