openai-gemini  by PublicAffairs

OpenAI API proxy for the Gemini API, deployable serverlessly

created 1 year ago
2,639 stars

Top 18.2% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a serverless, OpenAI-compatible API proxy for Google's Gemini models, enabling users to leverage Gemini's capabilities through existing OpenAI API integrations. It targets developers and users who want to access advanced AI models without direct Gemini API integration or server maintenance, offering a free, personal endpoint with generous limits.

How It Works

The proxy acts as an intermediary, translating OpenAI API requests into Gemini API calls. It deploys as a serverless function on platforms like Vercel, Netlify, or Cloudflare Workers, abstracting away infrastructure management. This approach allows for easy, free deployment and maintenance, making powerful AI models accessible via familiar OpenAI endpoints.

Quick Start & Requirements

  • Deployment: Deploy via Vercel, Netlify, Cloudflare Workers, or Deno.
  • Prerequisites: A personal Google API key is required. VPN may be needed for key acquisition outside supported regions.
  • Local Development: npm install and npm run start (Node.js), or equivalent for Deno/Bun.
  • Usage: Configure software to use the deployed proxy URL (e.g., https://your-proxy.vercel.app/v1) and your Gemini API key.
  • Documentation: https://github.com/PublicAffairs/openai-gemini

Highlighted Details

  • Supports chat/completions endpoint with many OpenAI parameters mapped to Gemini equivalents.
  • Includes embeddings and models endpoints.
  • Vision and audio input are supported via inlineData.
  • Web search tool integration is available by appending :search to model names.

Maintenance & Community

  • No specific contributor or community links (Discord/Slack) are mentioned in the README.

Licensing & Compatibility

  • The README does not explicitly state a license.

Limitations & Caveats

  • The name property for messages and logit_bias, logprobs, top_logprobs, parallel_tool_calls parameters are not implemented. The n parameter has limitations for streaming. Temperature mapping may differ.
Health Check
Last commit

1 month ago

Responsiveness

1 day

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

Explore Similar Projects

Feedback? Help us improve.