What is openai-gemini?
openai-gemini is a deployable proxy that presents a Gemini-backed API using an OpenAI-compatible interface. It is for people who want to use Gemini models with software that supports the OpenAI API and allows a custom endpoint. Deploy it to a supported cloud provider or run it locally, then configure the proxy address and a personal Google API key in the client software.
openai-gemini Features:
Chat Completions: The proxy supports the chat/completions endpoint, including messages, streaming, tool calls, and a range of shared request parameters.
Embeddings Endpoint: It supports embeddings requests, including a dimensions parameter, and uses Gemini's embedding model by default when no model is specified.
Model Selection: Requests can name a Gemini or Gemma model directly, while other model names use the proxy's configured defaults.
Web Search: Adding :search to a Gemini model name enables the built-in web search tool for supported requests.
Media Inputs: Chat requests can include vision and audio input using formats supported by the OpenAI chat API.
Flexible Deployment: The proxy can run on Vercel, Netlify, Cloudflare, or Deno, and can also be served locally with Node, Deno, or Bun.
Gemini Options: The extra_body field exposes Gemini-specific settings, including thinking_config, that are not part of the OpenAI model interface.
openai-gemini Benefits:
Reuse Existing Clients: Teams can try Gemini in tools they already use instead of finding a separate client built specifically for Gemini.
Less Server Upkeep: A cloud deployment avoids maintaining a server, while local running remains available for users who prefer it.
Personal Use Costs: The project is designed to provide a personal endpoint using Gemini's free tier, with deployment options that may also be free.
Deployment Choice: Users can choose among several cloud providers or a local runtime to match their setup and hosting preferences.
Adjustable Responses: Supported controls for output formats, sampling, and token limits give users ways to shape results for their task.
Use Cases:
OpenAI-Compatible Apps: Connect a desktop or web application that accepts a custom OpenAI API base address to Gemini models.
Command-Line Clients: Point a command-line tool at the proxy by setting an OpenAI base URL environment variable.
Chat Prototyping: Build or test chat workflows with streaming responses, tool calls, and Gemini model selection through a familiar API.
Multimodal Requests: Send image or audio input from a compatible client to explore Gemini-powered tasks involving media.
Embedding Workflows: Use a client that expects the OpenAI embeddings endpoint while directing embedding requests to Gemini.

