Welcome to Plexmuse! This project leverages the power of AI to generate personalized playlists from your Plex music library. Whether you're looking for new music recommendations or creating the perfect playlist for any occasion, this API has got you covered.
- AI-Powered Recommendations: Generate playlists using advanced language models like GPT-4 and Claude.
- Seamless Plex Integration: Fetch and manage your music library directly from Plex.
- Customizable Playlists: Tailor your playlists with specific prompts and models.
- Python 3
- Plex Media Server with a Music library
- OpenAI API Key (for GPT-4)
- Anthropic API Key (optional, for Claude)
-
Clone the repository:
git clone git@github.com:LubergAlexander/plexmuse.git cd plexmuse
-
Setup:
make all
-
Set up environment variables: Create a .env file in the root directory and add your API keys:
cp .env.example .env
To find
PLEX_BASE_URL
andPLEX_TOKEN
, refer to the Plex support article: Finding an Authentication Token (X-Plex-Token).For setting up OpenAI, Anthropic, or other LLM keys, follow the instructions in the LiteLLM documentation: LiteLLM - Set Keys.
You can run the application using the Makefile or directly with Docker.
- Set up and run the application:
make run
- Start:
make start
-
Build the Docker image:
docker compose build
-
Start the Docker container:
docker compose up
Access the user interface at the root route /
. This UI allows you to interact with the API, select playlist length, and is mobile-friendly.
Send a POST request to /recommendations
with the following JSON body:
{
"prompt": "Chill vibes for a rainy day",
"model": "anthropic/claude-3-5-sonnet-latest",
"min_tracks": 10,
"max_tracks": 20
}
Open your browser and navigate to http://127.0.0.1:8000/docs
to explore the API endpoints.