{"id":13788377,"url":"https://github.com/scalaone/azure-openai-proxy","last_synced_at":"2025-05-12T02:33:13.378Z","repository":{"id":160528566,"uuid":"621649536","full_name":"scalaone/azure-openai-proxy","owner":"scalaone","description":"A tool that transforms OpenAI API requests into Azure OpenAI API requests, allowing OpenAI-compatible applications to seamlessly use Azure OpenAI.  一个 OpenAI API 的代理工具，能将 OpenAI API 请求转为 Azure OpenAI API 请求，从而让只支持 OpenAI 的应用程序无缝使用 Azure OpenAI。","archived":false,"fork":false,"pushed_at":"2024-10-05T14:31:34.000Z","size":659,"stargazers_count":138,"open_issues_count":1,"forks_count":28,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-18T02:37:22.829Z","etag":null,"topics":["azure-openai","azure-openai-proxy","azureopenai","chatgpt","gpt-35-turbo","gpt-4","gpt-4-32k","nextjs","nextjs13"],"latest_commit_sha":null,"homepage":"https://gptlite.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scalaone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-31T05:13:04.000Z","updated_at":"2024-10-29T14:52:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"4fd9ee59-220a-40f2-b763-5a42fe345c61","html_url":"https://github.com/scalaone/azure-openai-proxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalaone%2Fazure-openai-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalaone%2Fazure-openai-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalaone%2Fazure-openai-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scalaone%2Fazure-openai-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scalaone","download_url":"https://codeload.github.com/scalaone/azure-openai-proxy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253662789,"owners_count":21944131,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure-openai","azure-openai-proxy","azureopenai","chatgpt","gpt-35-turbo","gpt-4","gpt-4-32k","nextjs","nextjs13"],"created_at":"2024-08-03T21:00:44.432Z","updated_at":"2025-05-12T02:33:12.765Z","avatar_url":"https://github.com/scalaone.png","language":"TypeScript","funding_links":[],"categories":["Applications and Demos"],"sub_categories":["LLM (Large Language Model)"],"readme":"# Azure OpenAI Proxy\n\nEnglish | [简体中文](./README.zh-CN.md)\n\nAzure OpenAI Proxy is a tool that transforms OpenAI API requests into Azure OpenAI API requests, allowing OpenAI-compatible applications to seamlessly use Azure Open AI.\n\n## Prerequisites\n\nAn Azure OpenAI account is required to use Azure OpenAI Proxy.\n\n## Azure Deployment\n\n[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fscalaone%2Fazure-openai-proxy%2Fmain%2Fdeploy%2Fazure-deploy.json)\n\nRemember to:\n\n- Select the region that matches your Azure OpenAI resource for best performance.\n- If deployment fails because the 'proxywebapp' name is already taken, change the resource prefix and redeploy.\n- The deployed proxy app is part of a B1 pricing tier Azure web app plan, which can be modified in the Azure Portal after deployment.\n\n## Docker Deployment\n\nTo deploy using Docker, execute the following command:\n\n```bash\ndocker run -d -p 3000:3000 scalaone/azure-openai-proxy\n```\n\n## Local Execution and Testing\n\nFollow these steps:\n\n1. Install NodeJS 20.\n2. Clone the repository in the command line window.\n3. Run `npm install` to install the dependencies.\n4. Run `npm start` to start the application.\n5. Use the script below for testing. Replace `AZURE_RESOURCE_ID`, `AZURE_MODEL_DEPLOYMENT`, and `AZURE_API_KEY` before running. The default value for `AZURE_API_VERSION` is `2024-02-01` and is optional.\n\n\u003cdetails\u003e\n\u003csummary\u003eTest script\u003c/summary\u003e\n```bash\ncurl -X \"POST\" \"http://localhost:3000/v1/chat/completions\" \\\n-H 'Authorization: AZURE_RESOURCE_ID:AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION' \\\n-H 'Content-Type: application/json; charset=utf-8' \\\n-d $'{\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"You are an AI assistant that helps people find information.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"hi.\"\n    }\n  ],\n  \"temperature\": 1,\n  \"model\": \"gpt-3.5-turbo\",\n  \"stream\": false\n}'\n```\n\u003c/details\u003e\n\n## Tested Applications\n\nThe azure-openai-proxy has been tested and confirmed to work with the following applications:\n\n| Application Name                                                | Docker-compose File for E2E Test                                |\n| --------------------------------------------------------------- | --------------------------------------------------------------- |\n| [chatgpt-lite](https://github.com/blrchen/chatgpt-lite)         | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml)     |\n| [chatgpt-minimal](https://github.com/blrchen/chatgpt-minimal)   | [docker-compose.yml](./e2e/chatgpt-minimal/docker-compose.yml)  |\n| [chatgpt-next-web](https://github.com/Yidadaa/ChatGPT-Next-Web) | [docker-compose.yml](./e2e/chatgpt-next-web/docker-compose.yml) |\n| [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui)        | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml)       |\n| [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web)        | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml)      |\n\nTo test locally, follow these steps:\n\n1. Clone the repository in a command-line window.\n2. Update the `OPENAI_API_KEY` environment variable with `AZURE_RESOURCE_ID:AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY`. Alternatively, update the OPENAI_API_KEY value in the docker-compose.yml file directly.\n3. Navigate to the directory containing the `docker-compose.yml` file for the application you want to test.\n4. Execute the build command: `docker-compose build`.\n5. Start the service: `docker-compose up -d`.\n6. Access the application locally using the port defined in the docker-compose.yml file. For example, visit \u003chttp://localhost:3000\u003e.\n\n## FAQs\n\n\u003cdetails\u003e\n\u003csummary\u003eQ: What are `AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`, and `AZURE_API_KEY`?\u003c/summary\u003e\nA: These can be found in the Azure management portal. See the image below for reference:\n![resource-and-model](./docs/images/resource-and-model.jpg)\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eQ: How can I use gpt-4 and gpt-4-32k models?\u003c/summary\u003e\nA: To use gpt-4 and gpt-4-32k models, follow the key format below:\n`AZURE_RESOURCE_ID:gpt-3.5-turbo|AZURE_MODEL_DEPLOYMENT,gpt-4|AZURE_MODEL_DEPLOYMENT,gpt-4-32k|AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION`\n\u003c/details\u003e\n\n## Contributing\n\nWe welcome all PR submissions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalaone%2Fazure-openai-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscalaone%2Fazure-openai-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscalaone%2Fazure-openai-proxy/lists"}