GenAI Processors
Composable Building Blocks for Generative AI Pipelines
GenAI Processors is a lightweight Python library designed for building modular, asynchronous, and composable AI applications and agents.
-
Getting Started
Install the library and build your first pipeline in minutes.
-
Core Concepts
Deep dive into Processors, Parts, Streams, and Orchestration.
-
Examples
Explore real-world applications, agents, and CLI tools.
-
Built-in Processors
Documentation for core processors like GenaiModel and LiveProcessor.
✨ Key Features
Genai Processors are built for rapid prototyping where low latency and responsive behavior are the priority, whether you're building for real-time interaction or traditional text. The goal is to make developing streaming, multimodal agents as straightforward as using text-only bots; by simplifying the way you mix streaming and non-streaming code, we ensure that achieving a fast time-to-first-token is obtained out-of-the-box.
- Modular: Breaks down complex tasks into reusable
ProcessorandPartProcessorunits, which are easily chained (+) or parallelized (//) to create sophisticated data flows and agentic behaviors. - Integrated with GenAI API: Includes ready-to-use processors like
GenaiModelfor turn-based API calls andLiveProcessorfor real-time streaming interactions. - Extensible: Lets you create custom processors by inheriting from base classes or using simple function decorators.
- Rich Content Handling:
ProcessorPart: A wrapper aroundgenai.types.Partenriched with metadata like MIME type, role, and custom attributes.- Supports various content types (text, images, audio, custom JSON).
- Asynchronous & Concurrent: Built on Python's familiar
asyncioframework to orchestrate concurrent tasks (including network I/O and communication with compute-heavy subthreads). - Stream Management: Has utilities for splitting, concatenating, and
merging asynchronous streams of
ProcessorParts.