Model or dataset
google-gemini/genai-processors avatar
google-gemini/genai-processors

GenAI Processors: A Processor Abstraction for Gemini Streaming Pipelines

GenAI Processors is a lightweight Python library that enables efficient, parallel content processing.

2,117 stars225 forksPythonApache-2.0

At a glance

What is it?
Google's genai-processors wraps Gemini model calls, tool output and multimodal chunks in one async Processor interface. It is a reasonable fit for live audio and multi-agent pipelines, and the wrong tool if you only need single-shot text completions.
Who is it for?
Adopt genai-processors if you are building a Gemini application that mixes live audio, tool calls and multiple model invocations inside one asyncio event loop, and you want one content type across all of them. Do not adopt it if your product is a single request-response text call, because the Processor, ProcessorStream and ProcessorPart vocabulary adds a layer you will never exercise.
Can I use it commercially?
Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 6 days ago.
What is it written in?
Mainly Python, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The fragmentation problem genai-processors actually targets

The README states the library addresses "the fragmentation of LLM APIs." That is a specific complaint. A Gemini application that does text completion, Live API audio, and a tool call typically ends up with three different payload shapes and three different iteration patterns, and the glue between them is where bugs live. GenAI Processors answers with one representation, ProcessorPart, described as a wrapper around genai.types.Part enriched with MIME type, role and custom attributes, and one execution unit, the Processor. The intended user is not someone calling a model once. It is someone assembling a pipeline where a model's output feeds a tool, whose output feeds another model, while audio or image parts travel alongside text. The library is Python only, requires Python 3.10 or newer, and ships under Apache-2.0.

The dual-interface Processor and how parts move through a chain

A Processor has two faces. The producer side is the call method, which receives a ProcessorStream and yields ProcessorPartTypes as they arrive. The consumer side is the object you invoke: you hand it strings, ProcessorPart instances, or lists mixing both, and you get back something you can await with gather(), read with text(), or iterate part by part. Strings are cast into Parts automatically, which is why the README's example can pass ["Hello ", content_api.ProcessorPart("World")] without conversion code. Composition is expressed with operators rather than a graph builder: + chains processors and // parallelizes them. Because call is an async generator, a downstream processor can start work on the first part before the upstream one has finished producing. That is the whole architectural bet. It is a streaming model with a convenience layer for callers who do not want to think about streaming.

Installing it and the first thing to do after

Installation is a single command: pip install genai-processors. The package is on PyPI, and the repository tracks releases by version, with v2.0.0 dated 2026-03-10, v1.1.1 dated 2025-12-17, and v1.1.0 dated 2025-08-01. After installing, the README points at two things before you write application code. First, the documentation microsite at google-gemini.github.io/genai-processors, which covers concepts and architecture. Second, a file named llms.txt in the repository root. The README is explicit about why: generative models often do not know recent SDK changes and will suggest outdated code, so the project recommends pasting those instructions into your development environment to give the model current context. That is an unusual step to see documented as part of onboarding, and it tells you the API surface has moved enough that model priors are a real hazard. Four colabs are listed in a recommended order: content_api_intro, processor_intro, create_your_own_processor, and live_processor_intro.

Where the abstraction stops paying: live sessions and error contracts

The built-in processors split along a clear line. GenaiModel handles turn-based API calls. LiveProcessor handles real-time streaming through the Gemini Live API. The README's realtime_simple_cli.py example is described as a client-side Live processor built on text-based Gemini API models, and the live_commentator example composes two agents, one for event detection and one for conversation management. What the supplied material does not describe is what happens when a live session drops, when a tool call returns malformed JSON, or when one branch of a // fan-out raises while its sibling is still yielding. There is no cancellation or retry contract in the README. If you are building anything long-lived, that is the first thing to read in the source rather than assume. A second constraint is scope: the core/ directory is described as a set of basic processors that "will evolve over time," and additional processors live under contrib/. That wording signals that the built-in set is intentionally thin and that the project expects you to write your own Processor subclasses for anything domain-specific.

How it differs from calling the google-genai SDK directly

The google-genai SDK is the lower-level client this library wraps: it exposes model calls and the Live API session, and it is what you would use if you wanted direct control over request construction and response parsing. The difference in approach is the unit of composition. With the raw SDK, your application logic lives in the code between calls, and streaming means writing the loop yourself each time. With genai-processors, that logic is itself a Processor, so it composes with + and // the same way a model call does. The trade is a layer of indirection and a vocabulary you must learn: Processor, ProcessorStream, ProcessorPart, ProcessorContent, PartProcessor. If your pipeline is one call followed by formatting, the SDK alone is less code. If your pipeline is a graph of model calls, tools and stream transforms, the abstraction is what keeps the graph readable.

Licence and the cost of tracking a fast-moving API

The project is Apache-2.0, which permits commercial use and modification and includes a patent grant, but this is not legal advice and you should read the LICENSE file and your own obligations. On maintenance: the release cadence visible here is roughly two to three releases a year, with a major version bump to v2.0.0 in March 2026. A major bump on a library this young means the API has already broken once. The README's own advice to feed llms.txt to your coding model is a practical admission that generated code drifts from the current SDK. Budget for reading release notes before upgrading, and pin the version in your dependency file rather than tracking latest. The contrib/ processors are the other cost centre: they are community contributions, and the README does not promise they are maintained on the same schedule as core/.

A concrete way to decide in an afternoon

The four colabs are ordered for a reason, and working through them in sequence is the cheapest way to find out whether this library fits. Start with content_api_intro to see whether ProcessorPart's metadata model matches what your application already carries. Then processor_intro, then create_your_own_processor, which is the real test: if writing a Processor subclass for your domain feels natural, the abstraction is earning its place. Finish with live_processor_intro only if you need real-time. If by the end of create_your_own_processor you find yourself wrapping a single SDK call in a class with no chaining, stop there. The library is built for pipelines that compose, and a pipeline of one is just overhead.

Editorial conclusion

Adopt genai-processors if you are building a Gemini application that mixes live audio, tool calls and multiple model invocations inside one asyncio event loop, and you want one content type across all of them. Do not adopt it if your product is a single request-response text call, because the Processor, ProcessorStream and ProcessorPart vocabulary adds a layer you will never exercise. Before committing, verify three things against the current docs and PyPI release: the exact Python version floor, whether the contrib processors you depend on are still maintained, and how errors surface from a LiveProcessor session, since the README does not describe a failure contract.

Official sources

  1. google-gemini/genai-processors on GitHub
  2. License: Apache-2.0
  3. Project website
  4. README
  5. Releases
Community notes

Community notes