genai-processors  by google-gemini

Build modular, asynchronous AI pipelines

created 3 months ago
1,843 stars

Top 24.0% on sourcepulse

GitHubView on GitHub
1 Expert Loves This Project
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

1 day ago

Responsiveness

Inactive

Pull Requests (30d)
16
Issues (30d)
9
Star History
1,868 stars in the last 90 days

Explore Similar Projects

Starred by Jeff Hammerbacher Jeff Hammerbacher(Cofounder of Cloudera) and Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake).

InternEvo by InternLM

1.0%
402
Lightweight training framework for model pre-training
created 1 year ago
updated 1 week ago
Feedback? Help us improve.