hajimi  by wyeeeee

FastAPI proxy for Google's Gemini API, designed for easy/secure access

created 4 months ago
1,324 stars

Top 30.9% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a FastAPI-based proxy for Google's Gemini API, designed for easy deployment and integration with tools expecting OpenAI API formats. It targets developers and users needing a flexible, secure, and configurable gateway to Gemini, offering features like API key management, rate limiting, and compatibility with various deployment environments.

How It Works

The proxy acts as an intermediary, translating requests formatted for OpenAI's API into the native format required by Google's Gemini. It supports text, file, and image inputs, and offers both streaming and non-streaming responses. Key features include automatic API key rotation, optional password protection for the web UI, and configurable rate limiting to prevent abuse. It also includes novel features like "fake streaming" to maintain connections and "concurrent requests" with caching for improved response generation and resilience.

Quick Start & Requirements

Highlighted Details

  • OpenAI API compatibility for seamless integration.
  • Token counting for API usage monitoring.
  • "Fake streaming" to prevent disconnections.
  • Concurrent request and caching mechanism for enhanced reliability.
  • Optional "disguise" feature to mask requests.
  • Network mode for Gemini to access the internet via search.
  • Persistent storage for configuration and logs (beta).

Maintenance & Community

  • Active development with recent updates (v0.2.1beta).
  • Community contributions acknowledged.
  • Links to deployment documentation for various platforms.

Licensing & Compatibility

  • License: CC BY-NC 4.0 (Creative Commons Attribution-NonCommercial 4.0 International).
  • Restrictions: Non-commercial use only. Commercial licensing requires written permission from the author.

Limitations & Caveats

The project is licensed under CC BY-NC 4.0, strictly prohibiting commercial use. The Hugging Face Spaces deployment is not recommended due to server issues. The persistent storage feature is in beta. The "disguise" feature may cause issues with clients other than SillyTavern.

Health Check
Last commit

4 days ago

Responsiveness

Inactive

Pull Requests (30d)
3
Issues (30d)
16
Star History
753 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.