GithubHelp home page GithubHelp logo

zuisong / gemini-openai-proxy Goto Github PK

View Code? Open in Web Editor NEW
247.0 4.0 75.0 2.36 MB

OpenAI to Google Gemini https://gemini-openai-proxy.deno.dev

Home Page: https://gemini-openai-proxy.zuisong.workers.dev

License: MIT License

TypeScript 99.54% Dockerfile 0.18% JavaScript 0.28%
ai chatgpt-api gemini-pro gemini-protocol openai-api bun deno deno-deploy hono node

gemini-openai-proxy's Introduction

Hi I'm ZuiSong 👋

Top Langs mattn's github stats

gemini-openai-proxy's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar greenjerry avatar quilljou avatar radiquum avatar vuchaev2015 avatar zuisong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gemini-openai-proxy's Issues

Not real streaming output

I tried to deploy it to CF workers. I set it to stream output. But the result seems to be not streaming, All result output when the request ends on the user end. Anything wrong with my operation

embbending

are you going to add embbending end point ?

如何使用 Gemini 1.5 Pro ?

大佬你好,现在的模型好像是全列出来,都是使用 gemini-pro

而隔壁 https://github.com/zhu327/gemini-openai-proxy 做了模型的映射,感觉这样操作比较清晰,能不能参考,例如:

gpt-3.5-turbo -> gemini-1.0-pro-latest
gpt-4 -> gemini-1.0-ultra-latest
gpt-4-turbo-preview -> gemini-1.5-pro-latest
gpt-4-vision-preview -> gemini-1.0-pro-vision-latest

error sending request for url

The reponse returned error like below, the base_url is expired?

{"id":"chatcmpl-abc123","object":"chat.completion","created":1721044629,"model":"gpt-4-turbo-preview","choices":[{"message":{"role":"assistant","content":"[GoogleGenerativeAI Error]: Error fetching from google -> error sending request for url (https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro-latest:streamGenerateContent?key=xxxxxxxxxxxxxxxxxxxk&alt=sse): error trying to connect: tcp connect error: Cannot assign requested address (os error 99)"},"finish_reason":"stop","index":0,"logprobs":null}]}

能否解决 Gemini 地区限制.

gemini 只在一些语言和地区提供.
我收到限制地区的错误.

Error: [GoogleGenerativeAI Error]:  
Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:streamGenerateContent?alt=sse: 
[400 Bad Request] User location is not supported for the API use. 

部署在 workers 和 deno 的服务器上应该在 gemini 提供的地区内.
能否像azure-openai-proxy这个项目一样解决限制地区的问题.

谢谢!

部署到Cloudflare worker,出现Internal Server Error

自己部署到Cloudflare worker后,无论是使用workers.dev,还是自定义域名,总是出现Internal Server Error 错误。
20240307155136

使用项目提供的网址,出现429错误。
20240307164255

不使用转换,在其他软件直接使用gemini key,正常。

Deno deployment not working

I installed a Deno deployment
https://github.com/zuisong/gemini-openai-proxy/blob/main/dist/main_deno.mjs
put I am receiving an error

{"id":"chatcmpl-abc123","object":"chat.completion","created":1708722674499,"model":"gpt-3.5-turbo","choices":[{"message":{"role":"assistant","content":"[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1/models/gemini-pro:generateContent: [400 Bad Request] User location is not supported for the API use."},"logprobs":null,"finish_reason":"stop","index":0}]}

无法拉取镜像

测试了对最新的0.8和旧版本的0.6镜像都无法拉取,在多台服务器测试均提示 manifest unknown

ghcr.io域名下的其他镜像可正常拉取,这个情况很奇怪,不知道要如何解决

Hello, I cant use the vision model

When i upload an image an ask about it I always get back an error

open-webui  | INFO:     172.19.0.1:54044 - "POST /openai/chat/completions HTTP/1.1" 500 Internal Server Error
open-webui  | generate_title
open-webui  | gpt-4-vision-preview

Uh-oh! There was an issue connecting to Google Gemini-1.0-pro-vision-latest.
text input must be of type `str` (single example), `List[str]` (batch or single pretokenized example) or `List[List[str]]` (batch of pretokenized examples).

But if i use ollama vision models it works just fine

500 Internal Server Error

Check below error message:

Error: [500 Internal Server Error] An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting
    at makeRequest (file:///root/gemini-openai-proxy/dist/main_node.mjs:914:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async generateContent (file:///root/gemini-openai-proxy/dist/main_node.mjs:880:20)
    at async streamingChatProxyHandler (file:///root/gemini-openai-proxy/dist/main_node.mjs:1020:22)
    at async file:///root/gemini-openai-proxy/dist/main_node.mjs:1078:24
    at async Object.pull (file:///root/gemini-openai-proxy/dist/main_node.mjs:1091:31)

支持部署到CF worker

希望可以转换为 CF worker部署,这样就不需要 docker 了,而且更加方便。

tool/function calls not working??

can anyone share a working example of the tool or function calls working?? no matter what i do it just gives an empty response when it should call a tool

修改默认safety settings

你好,这个程序非常方便。不过我发现了一个小问题。Gemini api 有一个safety settings。不知道你有没有处理

我测试的时候,输出总是blockReason': 'SAFETY'。非常蛋疼

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.