7

GitHub - zuisong/gemini-openai-proxy: Convert OpenAI protocol to Google Gemini P...

 7 months ago
source link: https://github.com/zuisong/gemini-openai-proxy
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Repository files navigation

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.

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

✅ Gemini Pro

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

✅ Gemini Pro Vision

curl -s http://localhost:8000/v1/chat/completions \
  -H  \
  -H  \
  -d 



















  • /v1/chat/completions
    • stream
    • complete

Run On Serverless

Cloudflare Workers

build command npm run build:cf_worker

Copy main_cloudflare-workers.mjs to cloudflare-workers

Deno Deploy

build command npm run build:deno

Copy main_deno.mjs to deno deploy

Run On Local

deno task start:deno
npm install && npm run start:node
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

Star History

Star History Chart

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK