AI autotagger source for beets (http://beets.io).
Project description
Beets AI Sauce Plugin
Because your tunes deserve a little extra flavor.
Let artificial intelligence decipher and enhance the mysterious metadata of your music tracks.
Who Needs This? (Definitely You)
- You: The person who once gazed at your MP3 folder and thought, "My beats need more AI jazz hands!"
- Also You: If you trust AI more than your friend who can't stop labeling everything "Track 1".
- Definitely You: If you own folders full of tracks from bootlegs, unknown rips, or suspect compilation albums.
Features
- Auto-Metadata Magic: Automatically retrieve and correct track and album metadata using AI-generated suggestions.
- Cleanup Crew: Strip away unnecessary embellishments like "Free Download" in titles or SHOUTCAPS, giving your library a polished appearance.
- Extensible System: Leverage AI configurations and prompts custom tailored for your library needs.
Installation
Prerequisites
- Beets: Make sure you have Beets installed (
pip install beets), - AI Service API Key: Get an API key from your preferred AI service provider (e.g., OpenAI, Deepseek).
- Any service that supports openAI endpoints should work.
Plugin Setup
- Installation: Obtain the sauce by installing the plugin via pip:
pip install beets-aisauce
- Configuration: Add the plugin to your Beets configuration file (
config.yaml/beets config -e) with your AI provider details:plugins: - aisauce aisauce: mode: "metadata_source" # or "metadata_cleanup" providers: - id: openai model: gpt-4o api_key: YOUR_API_KEY_HERE api_base_url: https://api.openai.com/v1
- Execute the AI Sauce: Import your tracks through Beets to start receiving AI-enhanced metadata suggestions.
Usage
There are two main ways to use the AI Sauce plugin, either as metadata source during import or as a pre-import correction step. You can also combine both methods for maximum flavor.
As a Metadata Source During Import
When importing new music, the AI Sauce plugin can act as a metadata source. Beets will query the AI model to suggest metadata for tracks that lack sufficient information.
For this set the as_metadata_source option to true in your configuration:
aisauce:
mode: "metadata_source"
providers:
...
During beet import, the plugin will prompt the AI model to generate metadata suggestions based on existing tags or file names.
As a Pre-Import Correction Step
If you want to use AI to cleanup your metadata before retrieving candidates from other sources, set the as_metadata_source option to false:
aisauce:
mode: "metadata_cleanup"
providers:
...
During beet import, the plugin will first use the AI model to correct and enhance existing metadata before proceeding with the standard import process. This allows you to clean up messy tags before Beets attempts to match them with external databases.
Advanced Usage
- Custom Rules: Sometimes you have specific metadata correction rules that you want to apply. You can modify the default user and system prompts by adding a
sourceto your configuration file:aisauce: providers: - id: openai model: gpt-4o api_key: YOUR_API_KEY_HERE sources: - provider_id: openai user_prompt: ' Additional rules: - Replace any occurrences of Vulgar or inappropriate words with "**sauced**". '
- Multiple sources can be defined allowing you to test different prompts or configurations for different types of music or metadata corrections and models.
Contributing
Great ideas welcome! Especially if they include more puns. Open a PR or send us a message in a bottle (GitHub issues also work).
License
This project is licensed under the MIT License—meaning you can do almost anything, but please don't sue us if the AI names your tracks "Untitled Jam 42."
Development
The following sections are for developers who want to contribute to the project. Feel free to skip if you're just here for the AI sauce.
Installation for Development
Clone the repository and install the package in editable mode:
git clone
pip install -e .[dev]
Running Tests
To run the tests, you can use pytest. Make sure you have the necessary dependencies installed:
pytest .
Running mypy locally
Running mypy local is a bit tricky due to the namespace packages used in this project. To run mypy, you need to specify the --namespace-packages and --explicit-package-bases flags.
mypy --namespace-packages --explicit-package-bases .
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file beets_aisauce-0.2.0.tar.gz.
File metadata
- Download URL: beets_aisauce-0.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e3dff2315e666105503775807368809e08734768960bdcce731bd566f1a254f
|
|
| MD5 |
8aba9aacce19854857df256c822b8d95
|
|
| BLAKE2b-256 |
fcc11e9e09e50f02883786cbf99a3e39f5bb3a1f509af98a9ad480a73b17c898
|
Provenance
The following attestation bundles were made for beets_aisauce-0.2.0.tar.gz:
Publisher:
auto-release.yml on metasauce/beets-aisauce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_aisauce-0.2.0.tar.gz -
Subject digest:
1e3dff2315e666105503775807368809e08734768960bdcce731bd566f1a254f - Sigstore transparency entry: 692367834
- Sigstore integration time:
-
Permalink:
metasauce/beets-aisauce@5deaf2022f324d6da1f4d5998317960c880cd886 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/metasauce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-release.yml@5deaf2022f324d6da1f4d5998317960c880cd886 -
Trigger Event:
push
-
Statement type:
File details
Details for the file beets_aisauce-0.2.0-py3-none-any.whl.
File metadata
- Download URL: beets_aisauce-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc1eef35a39ccb5a50d5f7fed311c99195df85a00b1673654e0ce95a09f05d60
|
|
| MD5 |
718404e169cf9ed3ff618a645a4b6f9e
|
|
| BLAKE2b-256 |
68304084f8bea8fd64e2dee7599d2ec000fd24acf2bc8c3360553d6bafb0190a
|
Provenance
The following attestation bundles were made for beets_aisauce-0.2.0-py3-none-any.whl:
Publisher:
auto-release.yml on metasauce/beets-aisauce
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
beets_aisauce-0.2.0-py3-none-any.whl -
Subject digest:
bc1eef35a39ccb5a50d5f7fed311c99195df85a00b1673654e0ce95a09f05d60 - Sigstore transparency entry: 692367838
- Sigstore integration time:
-
Permalink:
metasauce/beets-aisauce@5deaf2022f324d6da1f4d5998317960c880cd886 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/metasauce
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
auto-release.yml@5deaf2022f324d6da1f4d5998317960c880cd886 -
Trigger Event:
push
-
Statement type: