Skip to content

GenAI Processors

License PyPI version Source Code

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.

    Quick Start

  • Core Concepts


    Deep dive into Processors, Parts, Streams, and Orchestration.

    Concepts

  • Examples


    Explore real-world applications, agents, and CLI tools.

    Examples

  • Built-in Processors


    Documentation for core processors like GenaiModel and LiveProcessor.

    Processors

✨ 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 Processor and PartProcessor units, which are easily chained (+) or parallelized (//) to create sophisticated data flows and agentic behaviors.
  • Integrated with GenAI API: Includes ready-to-use processors like GenaiModel for turn-based API calls and LiveProcessor for 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 around genai.types.Part enriched 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 asyncio framework 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.