hitsmaxft / gemini-openai-proxy

Convert OpenAI protocol to Google Gemini Pro protocol https://gemini-openai-proxy.zuisong.workers.dev

Home Page:https://gemini-openai-proxy.deno.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gemini-OpenAI-Proxy

Gemini-OpenAI-Proxy is a proxy software. It is designed to convert OpenAI API protocol calls into Google Gemini Pro protocol, so that software using OpenAI protocol can use Gemini Pro model without perception.

If you're interested in using Google Gemini but don't want to modify your software, Gemini-OpenAI-Proxy is a great option. It allows you to easily integrate the powerful features of Google Gemini without having to do any complex development work.

Demo

Get api key from https://makersuite.google.com/app/apikey

export YOUR_GEMINI_API_KEY="your api key"

curl -s http://localhost:8000/v1/chat/completions \
  -H "Authorization: Bearer $YOUR_GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "model": "gpt-3.5-turbo",
      "messages": [{"role": "user", "content": "Hello, Who are you?"}],
      "temperature": 0.7
      }'

demo

Plan

  • /v1/chat/completions
    • stream
    • complete

Run On Serverless

build command npm run build:cf_worker

Copy main_cloudflare-workers.mjs to cloudflare-workers

build command npm run build:deno

Copy main_deno.mjs to deno deploy

Run On Local

deno

deno task start:deno

node

npm install && npm run start:node

bun

bun run start:bun

docker

docker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:deno
## or
docker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:bun
## or
docker run -d -p 8000:8000 ghcr.io/zuisong/gemini-openai-proxy:node

About

Convert OpenAI protocol to Google Gemini Pro protocol https://gemini-openai-proxy.zuisong.workers.dev

https://gemini-openai-proxy.deno.dev

License:MIT License


Languages

Language:TypeScript 93.8%Language:Dockerfile 6.2%