gemini-openai-proxy  by zuisong

Proxy for Google Gemini

created 1 year ago
416 stars

Top 71.5% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a proxy server that translates OpenAI API requests to Google Gemini Pro API calls, enabling applications designed for OpenAI to seamlessly utilize Gemini models without code modifications. It targets developers and users who want to leverage Gemini's capabilities with existing OpenAI-compatible infrastructure.

How It Works

The proxy acts as an intermediary, intercepting requests formatted for OpenAI's API and reformatting them to match Google Gemini's protocol. It supports various Gemini models, mapping common OpenAI model names (like gpt-3.5-turbo, gpt-4) to their corresponding Gemini equivalents (e.g., gemini-1.5-flash-8b-latest, gemini-1.5-pro-latest). This approach allows for easy integration and model switching.

Quick Start & Requirements

  • Local Execution: deno task start:deno, npm run start:node, or bun run start:bun.
  • Docker: docker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:<deno|bun|node>
  • Prerequisites: A Google Gemini API key obtained from Google AI Studio.
  • Deployment: Supports Cloudflare Workers, Deno Deploy, Vercel, and local execution.
  • Docs: https://gemini-openai-proxy.deno.dev

Highlighted Details

  • Supports OpenAI's chat completions endpoint (/v1/chat/completions).
  • Includes support for streaming responses.
  • Handles both text and vision (image input) requests.
  • Provides a comprehensive model mapping table for compatibility.

Maintenance & Community

The project is maintained by Zuisong. A star history graph is available on the README.

Licensing & Compatibility

The repository does not explicitly state a license in the provided README. This may pose compatibility issues for commercial or closed-source use cases.

Limitations & Caveats

The README does not specify a license, which could impact commercial adoption. Compatibility with all OpenAI API features beyond chat completions is not detailed.

Health Check
Last commit

1 month ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.