feat: add TwelveLabs Pegasus client for whole-video analysis - #70
Open
mohit-twelvelabs wants to merge 1 commit into
Open
feat: add TwelveLabs Pegasus client for whole-video analysis#70mohit-twelvelabs wants to merge 1 commit into
mohit-twelvelabs wants to merge 1 commit into
Conversation
Add an opt-in 'twelvelabs' client that analyzes an entire video in a single Pegasus call, bypassing the frame-extraction, transcription, and reconstruction stages. Wired into the client registry and config the same way as the existing ollama and openai_api clients; defaults are unchanged. The twelvelabs SDK is an optional dependency, imported lazily. Adds unit tests (no network) and a live Pegasus test gated on TWELVELABS_API_KEY, plus README setup docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi! I'm Mohit, I work at TwelveLabs (@mohit-twelvelabs).
What this adds
An opt-in
twelvelabsclient backed by Pegasus, TwelveLabs' video understanding model. Pegasus ingests an entire video in a single call and reasons jointly over its visuals, motion, and audio. When this client is selected, the frame-extraction, Whisper transcription, and reconstruction stages are bypassed — Pegasus produces the description directly from the video (a local file or a public URL).Why it helps
It collapses the project's three-stage LLM + CV + ASR pipeline into one API call: no local GPU/Ollama, no Whisper download, no frame sampling. This is a fast, low-setup alternative for users who want a high-quality whole-video description, while everything that exists today stays exactly as-is.
Opt-in / non-breaking
ollamaandopenai_api. Defaults are unchanged (ollamaremains the default).twelvelabsSDK is an optional dependency, imported lazily — it's only needed if you actually select this client, with a clear error message if it's missing.analysis.jsonshape, so existing tooling/UI keeps working.How it was tested
generate()path.TWELVELABS_API_KEY, skipped when unset) that analyzes a public sample video and asserts a non-empty description. Verified locally againsttwelvelabs==1.2.8.You can grab a free API key at https://twelvelabs.io — there's a generous free tier.