zhu327 / gemini-openai-proxy

A proxy for converting the OpenAI API protocol to the Google Gemini Pro protocol.
MIT License
504 stars 92 forks source link

proxy error L curl: (52) Empty reply from server #26

Closed nullnuller closed 3 months ago

nullnuller commented 3 months ago

$ curl http://127.0.0.1:8081/v1/chat/completions -H "Content-Type: application/json" -H "Authorization: Bearer $API_KEY" -d '{ "model": "gpt-4", "messages": [{"role": "user", "content": "Say this is a test!"}], "temperature": 0.7 }' curl: (52) Empty reply from server

Here's the docker: $ docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 9a49c5c0b3e4 zhu327/gemini-openai-proxy:latest "/app/gemini" 3 minutes ago Up 3 minutes 0.0.0.0:8081->8081/tcp gemini

zhu327 commented 3 months ago

curl 'https://generativelanguage.googleapis.com/v1beta/models?key='

Please confirm that you have access to gemini-1.0-ultra-latest or gemini-1.5-pro-latest

nullnuller commented 3 months ago

models/gemini-1.0-pro models/gemini-1.0-pro-001 models/gemini-1.0-pro-latest models/gemini-1.0-pro-vision-latest models/gemini-pro models/gemini-pro-vision

Which OAI model is supported?

zhu327 commented 3 months ago

Model Mapping:

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

nullnuller commented 3 months ago

How can I modify it so that

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

nullnuller commented 3 months ago

How can I modify it so that

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

Anyone?

zhu327 commented 3 months ago

You should modify the code by yourself

nullnuller commented 2 months ago

You should modify the code by yourself

Can you point to the code where it can be changed?