beta. Works well for me, but there may be some cracks in the pavement here and there.
There should be a way to connect LLMs with media libraries. Pibrarian was built to automate common media tasks for my workflows, and I'm sharing it because there's nothing else in the Pi ecosystem that talks to ODPS libraries like Calirbre.
Multi-domain content library extension for pi. Integrates with Calibre (books), Komga (comics), and Jellyfin (movies/TV) to give the LLM tools for searching, reading, downloading, and processing your media libraries.
- Search ebooks by title, author, keyword, or description
- Browse library sorted by title, author, or tag
- Get details — full metadata including authors, series, tags, formats
- Download ebooks (EPUB, MOBI, PDF, etc.) to local disk
- Read chapters from EPUB files — list chapters, read by number or title
- Extract individual panels from comic book pages using vision model
- Search and read comics
Status: Panel extraction is fully implemented. Search/read are placeholders (Komga integration pending).
- Search movies and TV shows by title, genre, year, actor
- List movies/shows with filters (year, genre, rating, sort)
- List episodes for TV shows or specific seasons
- Get details — full metadata including cast, external IDs, media sources
- Download movies or episodes to local disk
- Extract scenes/clips at specific timestamps (ffmpeg)
- Extract frames evenly across a video or within a time range
- Detect scenes automatically (ffmpeg or PySceneDetect)
- Save scene images — representative frames from each scene
- Split into scenes — cut video into individual scene clips
pi install git:github.com/<your-username>/pibrarian@v0.1.0pi install npm:pibrarian@0.1.0# Clone into your extensions directory
git clone https://github.com/<your-username>/pibrarian.git ~/.pi/agent/extensions/pibrarian
cd ~/.pi/agent/extensions/pibrarian
npm installCopy config.json.example to config.json and fill in your endpoints:
cp config.json.example config.json| Section | Field | Description |
|---|---|---|
vision |
baseUrl |
OpenAI-compatible vision model endpoint |
model |
Vision model ID (e.g. qwen3.6-27B) |
|
embedding |
baseUrl |
OpenAI-compatible embeddings endpoint |
model |
Embedding model ID (e.g. nomic-embed-text) |
|
calibre |
opdsUrl |
Calibre OPDS web server URL |
username |
Calibre Content Server username (optional) | |
password |
Calibre Content Server password (optional) | |
jellyfin |
baseUrl |
Jellyfin server URL |
apiKey |
Jellyfin API key (optional) | |
scene_detect |
venvPath |
Path to Python venv with scenedetect[opencv] (optional) |
pythonBinary |
Python binary for creating the venv |
| Variable | Config field |
|---|---|
PIBRARIAN_VISION_BASE_URL |
vision.baseUrl |
PIBRARIAN_VISION_MODEL |
vision.model |
PIBRARIAN_EMBEDDING_BASE_URL |
embedding.baseUrl |
PIBRARIAN_EMBEDDING_MODEL |
embedding.model |
PIBRARIAN_CALIBRE_URL |
calibre.opdsUrl |
PIBRARIAN_CALIBRE_USERNAME |
calibre.username |
PIBRARIAN_CALIBRE_PASSWORD |
calibre.password |
PIBRARIAN_JELLYFIN_URL |
jellyfin.baseUrl |
PIBRARIAN_JELLYFIN_API_KEY |
jellyfin.apiKey |
PIBRARIAN_JELLYFIN_USER_ID |
jellyfin.userId |
PIBRARIAN_JELLYFIN_TOKEN |
jellyfin.token |
PIBRARIAN_SCENEDETECT_VENV |
sceneDetect.venvPath |
PIBRARIAN_SCENEDETECT_PYTHON |
sceneDetect.pythonBinary |
After configuring your Jellyfin URL, authenticate:
/pibrarian-jellyfin-login <username> <password>
This stores your userId and token in config.json under jellyfin_auth.
| Command | Description |
|---|---|
/pibrarian-activate <domain|all> |
Activate domain tools (books, comics, media) |
/pibrarian-deactivate <domain|all> |
Deactivate domain tools |
/pibrarian-status |
Show domain activation status |
/pibrarian-jellyfin-login <user> <pass> |
Authenticate with Jellyfin |
- ffmpeg/ffprobe — Required for all media tools. Must be on PATH.
- Python 3.12+ — Optional, for PySceneDetect (higher accuracy scene detection)
- sharp — Native Node.js module for image processing (panel extraction)
- Fast, no extra dependencies
- Uses ffmpeg's built-in scene filter
- Threshold: 0.3–0.6 (default 0.4)
- Higher accuracy
- Requires a Python venv with
scenedetect[opencv] - Set
scene_detect.venvPathin config - Pass
use_scenedetect=trueto detect/save/split tools - Threshold: 23–40 (default 32)
Apache 2.0