zhu327 / gemini-openai-proxy

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

Configurably Disable OpenAI -> Gemini Model Mapping #41

Closed ekatiyar closed 3 months ago

ekatiyar commented 3 months ago

Introduces a new environment variable, DISABLE_MODEL_MAPPING, when enabled removes the OpenAI -> Gemini Model mapping and and directly exposes the underlying gemini models in the api endpoints.

Moved model mapping logic to its own models.go file inside the adapter package. Additionally, fixed a bug where responses would return the gemini model name even though model mapping was enabled.

My previous PR (#38) had some extraneous changes and disabled model mapping by default. This change provides that functionality in a configurable way, better addressing #35 and contains no breaking changes for preexisting setups.

ekatiyar commented 3 months ago

@zhu327 Here is the cleaned up version of disabled model mapping

zhu327 commented 3 months ago

LGTM