feat: add TwelveLabs video understanding Executor - #6245
Open
mohit-twelvelabs wants to merge 1 commit into
Open
Conversation
Adds an opt-in example Executor wrapping the TwelveLabs API: - /embed serves Marengo multimodal embeddings (512-dim) - /analyze serves Pegasus video understanding The twelvelabs SDK is imported lazily, so core Jina-serve behaviour is unchanged. Ships a config.yml, requirements, unit + live tests, a README and a tutorial.
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).
Goals:
This PR adds an opt-in, self-contained example Executor that serves TwelveLabs video understanding through standard Jina-serve endpoints.
integrations/twelvelabs/, a Jina-serve Executor project following the documented executor file structure (executor/package +config.yml+requirements.txt+ tests).TwelveLabsExecutorexposes two endpoints:/embed— Marengo multimodal embeddings (512-dim) for text queries, returned as aDocList[EmbeddingDoc]with anNdArray[512]field./analyze— Pegasus video understanding (generated text from a public video URL or an indexedvideo_id).docs/tutorials/twelvelabs-video-understanding.md, wired into the tutorials toctree.Why it helps this project: TwelveLabs gives Jina users a drop-in way to add video embeddings and video-to-text into their Flows/Deployments, complementing the existing text/image executor ecosystem for multimodal pipelines.
Opt-in / non-breaking: Nothing in core
jinachanges. ThetwelvelabsSDK is imported lazily, only when the Executor actually runs, so it adds no import-time dependency to the framework.How it was tested:
/embed,/analyze, and the missing-key error path.TWELVELABS_API_KEYis set) verifies a real Marengo call returns a 512-dim embedding. Run locally against the live API: all 4 tests pass.black -Sandisort --profile black; docstrings passpydocstyle D101/D102/D103, matching this repo's pre-commit config.You can grab a free API key at https://twelvelabs.io — there's a generous free tier.
Note: I see this repo uses a CLA (
.github/CLA.md). Happy to sign it as part of the review process — just let me know the current signing flow.