Skip to main content

llm-gemini-youtube

PyPI Changelog Tests License

LLM plugin for agentic YouTube video understanding with Gemini.

The plugin enables agentic processing for every video. It uses the Gemini Interactions API with an API key and the GenerateContent API with Gemini Enterprise Agent Platform. Gemini can selectively inspect the frames, audio, and transcript needed to answer the prompt instead of processing the whole video at a fixed frame rate.

Installation

Install this plugin in the same environment as LLM.

llm install llm-gemini-youtube

Configuration

Configure either a Gemini Developer API key (quickest way to get started) or Google Cloud. You do not need both.

Gemini Developer API (Google AI Studio)

Configure the API key using LLM's standard key mechanism (or set the LLM_GEMINI_KEY environment variable):

llm keys set gemini

API-key requests use the Interactions API with processing="agentic".

References:

Google Cloud (Gemini Enterprise Agent Platform)

The Google Gen AI SDK can route requests through Gemini Enterprise Agent Platform using its standard environment variables:

export GOOGLE_GENAI_USE_ENTERPRISE=1
export GOOGLE_CLOUD_PROJECT='your-project-id'
export GOOGLE_CLOUD_LOCATION='global'
gcloud auth application-default login

When Google Cloud is enabled, LLM_GEMINI_KEY does not need to be set. The SDK uses Application Default Credentials together with the configured project and location, and requests use the GenerateContent API with media_processing="AGENTIC".

References:

Usage

llm -m gemini-4-hydrogen-yt -a 'https://www.youtube.com/watch?v=9hE5-98ZeCg' 'Can you summarize this video?'

llm -m gemini-3.8-flash-yt -a 'https://www.youtube.com/watch?v=9hE5-98ZeCg' 'What are the examples given at 01:05 and 01:19 supposed to show us?'

llm -m gemini-3.5-flash-lite-yt -a 'https://www.youtube.com/watch?v=9hE5-98ZeCg' 'Transcribe the audio from this video, giving timestamps for salient events in the video. Also provide visual descriptions.'

Supported YouTube URL formats are youtube.com/watch?v=, youtu.be/, and youtube.com/shorts/. The Gemini Developer API supports public videos only (not private or unlisted); Google Cloud also allows videos owned by the signed-in Google Cloud account.

Supported models (if you are unsure which to start with, gemini-4-hydrogen-yt and gemini-3.8-flash-yt are good defaults—see the pricing links above for token rates):

Model Gemini Developer API (Google AI Studio) Google Cloud (Gemini Enterprise Agent Platform)
gemini-4-carbon-yt gemini-4-carbon gemini-4-carbon
gemini-4-neon-yt gemini-4-neon gemini-4-neon
gemini-4-argon-yt gemini-4-argon gemini-4-argon
gemini-4-hydrogen-yt gemini-4-hydrogen gemini-4-hydrogen
gemini-3.8-flash-yt gemini-3.8-flash gemini-3.8-flash
gemini-3.7-flash-yt gemini-3.7-flash (deprecated; routes to gemini-3.8-flash) gemini-3.7-flash
gemini-3.6-flash-yt gemini-3.6-flash gemini-3.6-flash
gemini-3.5-flash-lite-yt gemini-3.5-flash-lite gemini-3.5-flash-lite

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-gemini-youtube
python -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

python -m pip install -e '.[test]'

To run the tests:

python -m pytest

Project history

Metadata

Release files for llm-gemini-youtube 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for llm-gemini-youtube 0.1.2
File Size Uploaded Provenance Actions
llm_gemini_youtube-0.1.2.tar.gz 10.7 kB With provenance Details for llm_gemini_youtube-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for llm-gemini-youtube 0.1.2
File Interpreter ABI Platform Actions
llm_gemini_youtube-0.1.2-py3-none-any.whl Python 3 none any Details for llm_gemini_youtube-0.1.2-py3-none-any.whl

Total release size: 20.2 kB

Release files / llm_gemini_youtube-0.1.2.tar.gz

Download URL llm_gemini_youtube-0.1.2.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
59eda10dea26a32d9f8b2bb35263898d09a920ca05ade34ecc2d85dae2656dc3
BLAKE2b-256 checksum
How to use checksums
69e6d691a65156be70b97e7fa0519f91d390b035c6ffc86bdfddc3d38f26719b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Release files / llm_gemini_youtube-0.1.2-py3-none-any.whl

Download URL llm_gemini_youtube-0.1.2-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8a5ab47ec0c376d0e1a86552d6d534216ac68a169e5e4dddd65a11c0372649b
BLAKE2b-256 checksum
How to use checksums
0462631051fc6be59191975395c4494ef497d5542cc4259450bc960afd655def
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

Security for llm-gemini-youtube 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for llm_gemini_youtube-0.1.2.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page