billzhuang / azure-openai-proxy

run Azure OpenAI API as vanilla OpenAI API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Welcome to azure-openai-proxy 👋

Version License: MIT

🚀 azure-openai-proxy Copy From reflare-demo

Install wrangler

npm install -g wrangler

wrangler login

Install

npm install && npm run build

Local Development

npm run build && npm run dev

modify environment variables in wrangler.toml

Parameters Description Default Value
AZURE_OPENAI_ENDPOINT Azure OpenAI Endpoint, usually looks like https://{custom}.openai.azure.com. Required.
AZURE_OPENAI_APIVERSION Azure OpenAI API version. Default is 2023-03-15-preview. 2023-03-15-preview
AZURE_OPENAI_MODEL_MAPPER A comma-separated list of model=deployment pairs. Maps model names to deployment names. For example, gpt-3.5-turbo={azure_deployment_name}. gpt-3.5-turbo=gpt-35-turbo,gpt-4=gpt-4,gpt-4-32k=gpt-4-32k

Usage

npm run deploy

Add custom domain

modify Route in wrangler.toml

routes = [
	{ pattern = "Your Custom Domain", custom_domain = true },
]

Author

Show your support

Give a ⭐️ if this project helped you!

About

run Azure OpenAI API as vanilla OpenAI API

License:MIT License


Languages

Language:TypeScript 100.0%