genai-processors  by google-gemini

Build modular, asynchronous AI pipelines

Created 4 months ago
1,967 stars

Top 22.4% on SourcePulse

GitHubView on GitHub
Project Summary

This library provides a Python framework for building modular, asynchronous, and composable AI pipelines, specifically targeting generative AI applications. It enables efficient, parallel content processing for developers and researchers working with large language models like Gemini, offering a structured way to manage complex AI workflows.

How It Works

The core abstraction is the Processor, a class that encapsulates a unit of work. Processors accept an asynchronous iterable of ProcessorPart objects (representing text, images, etc.) and return a similar stream. This design allows for chaining (+) and parallelization (//) of processors, creating sophisticated data flows and agentic behaviors. It leverages Python's asyncio for concurrency and provides utilities for stream management, making it suitable for both turn-based and real-time streaming interactions.

Quick Start & Requirements

  • Primary install: pip install genai-processors
  • Prerequisites: Python 3.10+
  • Resources: No specific hardware requirements mentioned, but generative AI tasks typically benefit from GPUs.
  • Getting Started: Content API Colab, Processor Intro Colab

Highlighted Details

  • Modular design allows chaining and parallelization of processors for complex workflows.
  • Integrates directly with the GenAI API for model calls and real-time streaming.
  • Supports rich content handling with ProcessorPart, including metadata for various content types.
  • Built on asyncio for efficient asynchronous and concurrent task orchestration.

Maintenance & Community

The project is maintained by Google. Contribution guidelines are available in CONTRIBUTING.md.

Licensing & Compatibility

  • License: Apache License, Version 2.0.
  • Compatibility: Use of Gemini via this framework requires adherence to Gemini Terms of Service.

Limitations & Caveats

Requires Python 3.10 or higher. While designed for efficiency, performance will heavily depend on the underlying AI models and hardware used.

Health Check
Last Commit

2 weeks ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
48 stars in the last 30 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Boris Cherny Boris Cherny(Creator of Claude Code; MTS at Anthropic), and
17 more.

marvin by PrefectHQ

0.2%
6k
Python framework for agentic AI workflows
Created 2 years ago
Updated 2 days ago
Feedback? Help us improve.