Jump to content

LLM AI integration


Recommended Posts

Posted

For a while, I’ve been using custom Python scripts alongside local LLMs to analyze my library and automate TV/movie recommendations. It worked so well that I decided to build and share a full native Emby plugin: LLM AI Assistant.

Instead of relying on simple rule-based suggestions, this plugin leverages an LLM running an autonomous tool-calling loop (agent). The model dynamically queries your Emby library, Live TV EPG, external metadata providers (TMDB, TVDB, Showbizz new releases), and the web to make smart programming and viewing recommendations.

Supported backends include local Ollama (100% private on your own hardware), Ollama Cloud, and Google Gemini.

What It Does

The plugin adds a dedicated Recommendations page directly into the Emby main menu:

  • Series & Movies to Record (Server-Level / Admin):

    Powered by a background scheduled task (LlmScheduledTask).

    The LLM analyzes your upcoming EPG, cross-references your existing library and whitelists/rules, and suggests what should be scheduled for recording.

    Recommendations are saved globally, displayed to all users, and can optionally trigger standard Emby notifications.

  • "À regarder ce soir" / Watch Tonight (Per-User & Personalized):

    Computed on demand via a custom API endpoint (TonightApiService).

    Tailored to each individual user by cross-referencing their personal watch history, tonight's live TV guide, and recent unwatched recordings.

    Includes a per-user cache so the LLM isn't re-invoked on every single page view.

  • Interactive Action Cards:

    Schedule: Instantly create a SeriesTimer for TV shows or a single Timer for movies.

    Watch: Direct one-click playback for library items or Live TV channels.

    Forget: Adds unwanted suggestions to a DroppedTitles list so the agent won't recommend them again.

How It Works (Agentic Architecture) The LLM isn't just generating text; it acts as an agent equipped with specialized tools to inspect:

  • Your local Emby library (already recorded/owned content)

  • Current & upcoming EPG data

  • External sources (TMDB, TVDB, Web searches, Showbizz feeds)

Source Code & Setup

Check out the repo for setup details, requirements, and configuration instructions. Feedback, bug reports, and suggestions are very welcome!

LLM_AI.png

reneboulard
Posted (edited)

 

A new release of **LLM_AI version 1.1.0.0** is available.

This update brings a massive leap in functionality, turning your Emby server into an intelligent assistant capable of auditing itself and interacting directly with you.

-->   Security & Design Philosophy: Safe-by-Design I know that "AI managing my server" might sound intimidating. That is why this plugin was developed with a **Zero Trust** architecture and a **Human-in-the-Loop** approach: * **No Direct Access:** The LLM does *not* have direct access to your system, shell, or files. Every single interaction must pass through specific, purpose-built plugin tools that are heavily **sanitized**. The LLM can only "see" what the tools allow it to see and "act" through strictly controlled interfaces. * **Human Approval (Opt-in Only):** No automated modifications happen behind your back. All impactful tasks—such as server remediation or scheduled recordings—are strictly **opt-in**. * **Analysis over Action:** The LLM's primary role is to **analyze data and provide intelligent recommendations**. It identifies patterns, detects issues, and suggests solutions, but the final decision to execute any change always rests with you, the administrator.

What's New in v1.1.0.0?

1.  Server Health Audit (`SystemAuditTool`) You can now run a full **Server Health Audit** via the admin dashboard. An LLM agent will inspect your server (logs, disk usage, active sessions, transcoding status, etc.) and generate a detailed **Markdown report**. It identifies issues with severity tags (🔴/⚠️/✅) and provides actionable recommendations to keep your server running smoothly.

2.  Interactive AI Chat Dashboard The plugin now features a dedicated **full-frame Chat interface** directly in the Emby Admin section. You can have a multi-turn conversation with your LLM agent. It has access to all the plugin's tools (TV Guide, Library, TMDB/TVDB, Web Search) to answer your questions about your media or help you manage your server.

3.  Smart Orphan Recording Identification Tired of unidentified DVR recordings? The new `OrphanIdentifyTask` runs nightly to find "orphans" (recordings without IMDb/TMDB IDs). It uses a sophisticated three-stage process: 1. **Clean & Search:** Cleans EPG noise and searches TMDB. 2. **LLM Intelligence:** Uses an LLM "judge" to compare synopses, ensuring the identified movie/series is exactly the right one. 3. **Web Scrutiny:** If all else fails, it can use **SearXNG** (web search) to hunt down the correct ID.

4.  AI-Powered EPG Badges Enhance your EPG visually! The plugin now dynamically overlays badges on your EPG artwork: * 🟢 **AI Suggestion:** A green sparkle badge for upcoming programs suggested by the AI. * 🟡 **Already Owned:** A yellow badge letting you know at a glance that you already have this title in your library.

5.  Enhanced Multi-language Support & i18n We've significantly improved how the LLM handles languages. You can now force the **LLM Response Language** (French, English, Spanish, etc.) for both recommendations and audit reports. The plugin also features much better server-side internationalization for metadata and UI elements. ---

--> Full Changelog For a complete list of all technical improvements, bug fixes (including much-improved accented character handling!), and configuration updates, please check the official changelog here: 👉 https://github.com/reneboulard/LLM_AI/blob/master/CHANGELOG.md

-->  Installation As always, you can find the latest releases on the GitHub repository. I would love to hear your feedback and see how you use these new AI features in your Emby setup!

 

Example of a chat with the llm :

 

 

You

How can you help me

AI assistant

I can assist you in managing, monitoring, and enriching your Emby server through several specialized capabilities:

1. Library & EPG Management

  • Search: I can search your entire library for movies, series, episodes, or specific actors.
  • TV Guide (EPG): I can check what is playing tonight, view upcoming scheduled programs, or list new series and seasons available in your EPG.
  • Library Overview: I can provide summaries of your library content and tracks items by genre, year, or rating.

2. Content Discovery & Information

  • New Releases: I can track newly announced TV series and seasons from web sources to help you stay updated.
  • Metadata Enrichment: If a title lacks details, I can fetch synopses, ratings, genres, and posters using TMDB or TVDB.
  • Web Research: I can search the web for news regarding upcoming releases, actor information, or context about specific shows.

3. Server Health & System Auditing

  • System Monitoring: I can check server health, including CPU/RAM usage, disk storage, and active transcoding sessions.
  • Library Maintenance: I can identify items missing metadata (like synopses or images) and monitor the status of library scans.
  • Server Logs & Tasks: I can list scheduled tasks, inspect server logs for errors, and check active user sessions.
  • Process Management: I can detect orphaned processes (like ffmpeg) and monitor high-resource processes on your host.

How to interact with me: You can ask me specific questions like *"What's playing tonight?"*, *"Check my disk usage"*, *"Find new series releases"*, or *"Search my library for Action movies."*

 

Have fun!

Edited by reneboulard

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...