business-gemini-pool  by ddcat666

Gemini Enterprise API proxy service

Created 2 months ago
256 stars

Top 98.7% on SourcePulse

GitHubView on GitHub
Project Summary

This project provides a Flask-based proxy service for the Google Gemini Enterprise API, designed to simplify integration and enhance usability. It targets developers who need to leverage Gemini's capabilities, especially those managing multiple Gemini accounts or seeking an OpenAI-compatible API endpoint. The primary benefit is enabling load balancing and higher throughput through account rotation while offering a familiar API interface.

How It Works

The system acts as a middleware, accepting requests via an OpenAI-compatible API and routing them to configured Google Gemini Enterprise accounts. It employs an AccountManager to handle loading, saving, and rotating through available accounts based on their availability. Key features include automatic JWT token acquisition and refresh, support for Server-Sent Events (SSE) for streaming responses, and the ability to pass system instructions and maintain conversational context within a single request. An integrated web console provides management capabilities for accounts, models, and proxy settings.

Quick Start & Requirements

  • Primary install: pip install flask requests flask-cors or use docker-compose up -d.
  • Prerequisites: Python 3.7+.
  • Configuration: Requires editing business_gemini_session.json with account credentials (team ID, cookies, user agent) and proxy settings if needed.
  • Links: Web console accessible at http://127.0.0.1:8000/. API usage examples are provided via curl commands in the documentation.

Highlighted Details

  • Multi-account rotation for Gemini Enterprise accounts.
  • OpenAI-compatible API endpoint (/v1/chat/completions).
  • Streaming responses via Server-Sent Events (SSE).
  • Web management console for accounts, models, and proxy configuration.
  • Automatic JWT token acquisition and refresh.
  • Support for system instructions and multi-turn conversations.
  • Image input support via file upload or base64 encoding.

Maintenance & Community

No specific details regarding maintainers, community channels (e.g., Discord, Slack), or roadmap were found in the provided documentation.

Licensing & Compatibility

  • License: MIT License.
  • Compatibility: Offers OpenAI API compatibility, facilitating integration with existing tools and applications. Users must comply with Google's terms of service for Gemini API usage.

Limitations & Caveats

The business_gemini_session.json configuration file contains sensitive credentials and requires careful security management. Accessing Google services may necessitate proxy configuration. JWT tokens have a limited validity period, although the system attempts automatic refresh. Each API request initiates a new session, with context maintained only within that request's message history.

Health Check
Last Commit

1 week ago

Responsiveness

Inactive

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

Explore Similar Projects

Feedback? Help us improve.