├── .github └── workflows │ └── docker-publish.yml ├── .gitignore ├── .prettierignore ├── .prettierrc ├── .vscode └── launch.json ├── Dockerfile ├── LICENSE ├── README.md ├── README.zh-CN.md ├── app └── v1 │ ├── chat │ └── completions │ │ └── route.ts │ └── models │ └── route.ts ├── deploy └── azure-deploy.json ├── docs └── images │ └── resource-and-model.jpg ├── e2e ├── chatbot-ui │ └── docker-compose.yml ├── chatgpt-lite │ └── docker-compose.yml ├── chatgpt-minimal │ └── docker-compose.yml ├── chatgpt-next-web │ └── docker-compose.yml └── chatgpt-web │ └── docker-compose.yml ├── next.config.js ├── package-lock.json ├── package.json └── tsconfig.json /.github/workflows/docker-publish.yml: -------------------------------------------------------------------------------- 1 | name: Build and Push Docker Image 2 | 3 | on: 4 | push: 5 | branches: 6 | - main 7 | 8 | env: 9 | DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} 10 | DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} 11 | IMAGE_NAME: scalaone/azure-openai-proxy 12 | 13 | jobs: 14 | build-and-push-image: 15 | runs-on: ubuntu-latest 16 | steps: 17 | - name: Checkout 18 | uses: actions/checkout@v4 19 | - name: Set up Docker Buildx 20 | uses: docker/setup-buildx-action@v3 21 | - name: Log in to Docker Hub 22 | uses: docker/login-action@v3 23 | with: 24 | username: ${{ secrets.DOCKER_USERNAME }} 25 | password: ${{ secrets.DOCKER_PASSWORD }} 26 | - name: Build and push 27 | id: docker_build 28 | uses: docker/build-push-action@v5 29 | with: 30 | context: . 31 | push: true 32 | tags: ${{ env.IMAGE_NAME }}:1.${{ github.run_number }},${{ env.IMAGE_NAME }}:latest 33 | 34 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | .yarn/install-state.gz 8 | 9 | # testing 10 | /coverage 11 | 12 | # next.js 13 | /.next/ 14 | /out/ 15 | 16 | # production 17 | /build 18 | 19 | # misc 20 | .DS_Store 21 | *.pem 22 | 23 | # debug 24 | npm-debug.log* 25 | yarn-debug.log* 26 | yarn-error.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # typescript 35 | *.tsbuildinfo 36 | next-env.d.ts 37 | 38 | # JetBrains 39 | .idea/ -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | .next 2 | node_modules -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 100, 3 | "tabWidth": 2, 4 | "useTabs": false, 5 | "semi": false, 6 | "singleQuote": true, 7 | "quoteProps": "as-needed", 8 | "jsxSingleQuote": false, 9 | "trailingComma": "none", 10 | "bracketSpacing": true, 11 | "bracketSameLine": false, 12 | "arrowParens": "always", 13 | "rangeStart": 0, 14 | "requirePragma": false, 15 | "insertPragma": false, 16 | "proseWrap": "preserve", 17 | "htmlWhitespaceSensitivity": "css", 18 | "endOfLine": "lf" 19 | } 20 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "node", 6 | "request": "launch", 7 | "name": "website", 8 | "cwd": "${workspaceFolder}", 9 | "runtimeExecutable": "npm", 10 | "runtimeArgs": ["run", "dev"], 11 | "autoAttachChildProcesses": true, 12 | "stopOnEntry": true, 13 | "skipFiles": ["/**"] 14 | } 15 | ] 16 | } -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # This Dockerfile is generated based on sample in the following document 2 | # https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile 3 | 4 | FROM node:20-alpine AS base 5 | 6 | # Install dependencies only when needed 7 | FROM base AS deps 8 | # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed. 9 | RUN apk add --no-cache libc6-compat 10 | WORKDIR /app 11 | 12 | # Install dependencies based on the preferred package manager 13 | COPY package.json package-lock.json* ./ 14 | RUN npm ci 15 | 16 | # Rebuild the source code only when needed 17 | FROM base AS builder 18 | WORKDIR /app 19 | COPY --from=deps /app/node_modules ./node_modules 20 | COPY . . 21 | RUN npm run build 22 | 23 | # Production image, copy all the files and run next 24 | FROM base AS runner 25 | WORKDIR /app 26 | 27 | ENV NODE_ENV production 28 | 29 | RUN addgroup --system --gid 1001 nodejs 30 | RUN adduser --system --uid 1001 nextjs 31 | 32 | # Set the correct permission for prerender cache 33 | RUN mkdir .next 34 | RUN chown nextjs:nodejs .next 35 | 36 | # Automatically leverage output traces to reduce image size 37 | # https://nextjs.org/docs/advanced-features/output-file-tracing 38 | COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ 39 | COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static 40 | 41 | USER nextjs 42 | 43 | EXPOSE 3000 44 | 45 | ENV PORT 3000 46 | 47 | # server.js is created by next build from the standalone output 48 | # https://nextjs.org/docs/pages/api-reference/next-config-js/output 49 | CMD HOSTNAME="0.0.0.0" node server.js -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 scalaone 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure OpenAI Proxy 2 | 3 | English | [简体中文](./README.zh-CN.md) 4 | 5 | Azure 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. 6 | 7 | ## Prerequisites 8 | 9 | An Azure OpenAI account is required to use Azure OpenAI Proxy. 10 | 11 | ## Azure Deployment 12 | 13 | [![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) 14 | 15 | Remember to: 16 | 17 | - Select the region that matches your Azure OpenAI resource for best performance. 18 | - If deployment fails because the 'proxywebapp' name is already taken, change the resource prefix and redeploy. 19 | - 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. 20 | 21 | ## Docker Deployment 22 | 23 | To deploy using Docker, execute the following command: 24 | 25 | ```bash 26 | docker run -d -p 3000:3000 scalaone/azure-openai-proxy 27 | ``` 28 | 29 | ## Local Execution and Testing 30 | 31 | Follow these steps: 32 | 33 | 1. Install NodeJS 20. 34 | 2. Clone the repository in the command line window. 35 | 3. Run `npm install` to install the dependencies. 36 | 4. Run `npm start` to start the application. 37 | 5. 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. 38 | 39 |
40 | Test script 41 | ```bash 42 | curl -X "POST" "http://localhost:3000/v1/chat/completions" \ 43 | -H 'Authorization: AZURE_RESOURCE_ID:AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION' \ 44 | -H 'Content-Type: application/json; charset=utf-8' \ 45 | -d $'{ 46 | "messages": [ 47 | { 48 | "role": "system", 49 | "content": "You are an AI assistant that helps people find information." 50 | }, 51 | { 52 | "role": "user", 53 | "content": "hi." 54 | } 55 | ], 56 | "temperature": 1, 57 | "model": "gpt-3.5-turbo", 58 | "stream": false 59 | }' 60 | ``` 61 |
62 | 63 | ## Tested Applications 64 | 65 | The azure-openai-proxy has been tested and confirmed to work with the following applications: 66 | 67 | | Application Name | Docker-compose File for E2E Test | 68 | | --------------------------------------------------------------- | --------------------------------------------------------------- | 69 | | [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) | 70 | | [chatgpt-minimal](https://github.com/blrchen/chatgpt-minimal) | [docker-compose.yml](./e2e/chatgpt-minimal/docker-compose.yml) | 71 | | [chatgpt-next-web](https://github.com/Yidadaa/ChatGPT-Next-Web) | [docker-compose.yml](./e2e/chatgpt-next-web/docker-compose.yml) | 72 | | [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) | 73 | | [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) | 74 | 75 | To test locally, follow these steps: 76 | 77 | 1. Clone the repository in a command-line window. 78 | 2. 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. 79 | 3. Navigate to the directory containing the `docker-compose.yml` file for the application you want to test. 80 | 4. Execute the build command: `docker-compose build`. 81 | 5. Start the service: `docker-compose up -d`. 82 | 6. Access the application locally using the port defined in the docker-compose.yml file. For example, visit . 83 | 84 | ## FAQs 85 | 86 |
87 | Q: What are `AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`, and `AZURE_API_KEY`? 88 | A: These can be found in the Azure management portal. See the image below for reference: 89 | ![resource-and-model](./docs/images/resource-and-model.jpg) 90 |
91 |
92 | Q: How can I use gpt-4 and gpt-4-32k models? 93 | A: To use gpt-4 and gpt-4-32k models, follow the key format below: 94 | `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` 95 |
96 | 97 | ## Contributing 98 | 99 | We welcome all PR submissions. 100 | -------------------------------------------------------------------------------- /README.zh-CN.md: -------------------------------------------------------------------------------- 1 | # Azure OpenAI Proxy 2 | 3 | [English](./README.md) | 简体中文 4 | 5 | Azure OpenAI Proxy 是一个 OpenAI API 的代理工具,能将 OpenAI API 请求转为 Azure OpenAI API 请求,从而让只支持 OpenAI 的应用程序无缝使用 Azure OpenAI。 6 | 7 | ## 使用条件 8 | 9 | 你需要有一个 Azure OpenAI 账户才能使用 Azure OpenAI Proxy。 10 | 11 | ## Azure 部署 12 | 13 | [![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) 14 | 15 | 请注意: 16 | 17 | - 选择与你的 Azure OpenAI 资源相匹配的区域以获得最佳性能。 18 | - 如果部署失败是因为 'proxywebapp' 名称已被占用,只需修改资源前缀再重新部署。 19 | - 已部署的代理应用位于 B1 定价层级的 Azure 网页应用计划下,你可以在部署后在 Azure 门户中进行更新。 20 | 21 | ## Docker 部署 22 | 23 | 要使用Docker进行部署,请执行以下命令: 24 | 25 | ```bash 26 | docker run -d -p 3000:3000 scalaone/azure-openai-proxy 27 | ``` 28 | 29 | ## 本地运行和测试 30 | 31 | 遵循以下步骤: 32 | 33 | 1. 安装 NodeJS 20。 34 | 2. 克隆代码到命令行窗口。 35 | 3. 运行 `npm install` 安装依赖项。 36 | 4. 运行 `npm start` 启动应用程序。 37 | 5. 运行下面脚本测试,运行前需要把`AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`,`AZURE_API_KEY`和`AZURE_API_VERSION`替换,`AZURE_API_VERSION`参数可选,默认是`2024-02-01`。 38 | 39 |
40 | 测试脚本 41 | ```bash 42 | curl -X "POST" "http://localhost:3000/v1/chat/completions" \ 43 | -H 'Authorization: AZURE_RESOURCE_ID:AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY:AZURE_API_VERSION' \ 44 | -H 'Content-Type: application/json; charset=utf-8' \ 45 | -d $'{ 46 | "messages": [ 47 | { 48 | "role": "system", 49 | "content": "You are an AI assistant that helps people find information." 50 | }, 51 | { 52 | "role": "user", 53 | "content": "hi." 54 | } 55 | ], 56 | "temperature": 1, 57 | "model": "gpt-3.5-turbo", 58 | "stream": false 59 | }' 60 | ``` 61 |
62 | 63 | ## 已测试应用 64 | 65 | 以下应用已经过测试,确认可以与 azure-openai-proxy 一起工作: 66 | 67 | | 应用名称 | E2E测试 Docker-compose 文件 | 68 | | --------------------------------------------------------------- | --------------------------------------------------------------- | 69 | | [chatgpt-lite](https://github.com/blrchen/chatgpt-lite) | [docker-compose.yml](./e2e/chatgpt-lite/docker-compose.yml) | 70 | | [chatgpt-minimal](https://github.com/blrchen/chatgpt-minimal) | [docker-compose.yml](./e2e/chatgpt-minimal/docker-compose.yml) | 71 | | [chatgpt-next-web](https://github.com/Yidadaa/ChatGPT-Next-Web) | [docker-compose.yml](./e2e/chatgpt-next-web/docker-compose.yml) | 72 | | [chatbot-ui](https://github.com/mckaywrigley/chatbot-ui) | [docker-compose.yml](./e2e/chatbot-ui/docker-compose.yml) | 73 | | [chatgpt-web](https://github.com/Chanzhaoyu/chatgpt-web) | [docker-compose.yml](./e2e/chatgpt-web/docker-compose.yml) | 74 | 75 | 要在本地运行测试,请按照以下步骤操作: 76 | 77 | 1. 在命令行窗口中克隆代码。 78 | 2. 更新环境变量`OPENAI_API_KEY`的值为`AZURE_RESOURCE_ID:AZURE_MODEL_DEPLOYMENT:AZURE_API_KEY`。或者,直接在`docker-compose.yml`文件中更新`OPENAI_API_KEY`值。 79 | 3. 导航到包含要测试的应用程序的`docker-compose.yml`文件所在的目录。 80 | 4. 执行构建命令:`docker-compose build`。 81 | 5. 启动服务:`docker-compose up -d`。 82 | 6. 根据`docker-compose.yml`文件中定义的公开端口,启动应用以在本地进行测试。例如,访问 。 83 | 84 | ## 常见问题 85 | 86 |
87 | Q:什么是`AZURE_RESOURCE_ID`,`AZURE_MODEL_DEPLOYMENT`,`AZURE_API_KEY` 88 | A: 可以在Azure的管理门户里查找,具体见下图标注 89 | ![resource-and-model](./docs/images/resource-and-model.jpg) 90 |
91 |
92 | Q: 如何使用gpt-4 and gpt-4-32k模型 93 | A: 要使用gpt-4 and gpt-4-32k模型,请使用下列格式的key: 94 | `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` 95 |
96 | 97 | ## 贡献代码方式 98 | 99 | 欢迎提交各种 PR。 100 | -------------------------------------------------------------------------------- /app/v1/chat/completions/route.ts: -------------------------------------------------------------------------------- 1 | import { NextRequest, NextResponse } from 'next/server' 2 | 3 | const DEFAULT_API_VERSION = '2024-02-01' 4 | const MAX_RETRY_COUNT = 3 5 | const RETRY_DELAY = 1000 6 | 7 | export async function POST(request: NextRequest) { 8 | const apiKey = request.headers.get('authorization')?.replace('Bearer ', '') 9 | if (!apiKey) { 10 | return NextResponse.json({ message: 'Unauthenticated' }, { status: 401 }) 11 | } 12 | const body = await request.json() 13 | 14 | let retryCount = 0 15 | while (true) { 16 | const response = await chat(apiKey, body) 17 | const status = response.status 18 | if (status < 300 || (status >= 400 && status < 500) || retryCount >= MAX_RETRY_COUNT) { 19 | return response 20 | } 21 | 22 | retryCount++ 23 | console.log(`Status is ${status}, Retry ${retryCount} times`) 24 | await delay(RETRY_DELAY) 25 | } 26 | } 27 | 28 | async function chat(apiKey: string, body: any) { 29 | const [resourceId, mapping, azureApiKey, apiVersion] = apiKey.split(':') 30 | const model = body['model'] 31 | 32 | let deploymentId 33 | if (mapping.includes('|')) { 34 | const modelMapping = Object.fromEntries(mapping.split(',').map((pair) => pair.split('|'))) 35 | deploymentId = modelMapping[model] || Object.values(modelMapping)[0] 36 | } else { 37 | deploymentId = mapping 38 | } 39 | 40 | let url = `https://${resourceId}.openai.azure.com/openai/deployments/${deploymentId}/chat/completions?api-version=${ 41 | apiVersion || DEFAULT_API_VERSION 42 | }` 43 | const response = await fetch(url, { 44 | method: 'POST', 45 | headers: { 46 | 'api-key': azureApiKey, 47 | 'Content-Type': 'application/json' 48 | }, 49 | body: JSON.stringify(body) 50 | }) 51 | console.log(`[${resourceId}][${deploymentId}] ${response.status} ${response.statusText}`) 52 | let resultStream: ReadableStream | undefined 53 | let isFirstEventData = true 54 | const status: number = await new Promise((resolve) => { 55 | const decoder = new TextDecoder() 56 | resultStream = new ReadableStream( 57 | { 58 | async pull(controller) { 59 | const reader = response.body!.getReader() 60 | 61 | while (true) { 62 | const { value, done } = await reader.read() 63 | if (done) { 64 | controller.close() 65 | } 66 | let data = decoder.decode(value, { stream: true }) 67 | if (isFirstEventData) { 68 | isFirstEventData = false 69 | if (shouldRetry(data)) { 70 | resolve(500) 71 | } else { 72 | resolve(response.status) 73 | } 74 | } 75 | controller.enqueue(value) 76 | } 77 | } 78 | }, 79 | { 80 | highWaterMark: 1, 81 | size(chunk) { 82 | return chunk.length 83 | } 84 | } 85 | ) 86 | }) 87 | return new Response(resultStream, { 88 | status: status, 89 | headers: response.headers 90 | }) 91 | } 92 | 93 | function delay(ms: number) { 94 | return new Promise((resolve) => setTimeout(resolve, ms)) 95 | } 96 | 97 | function shouldRetry(data: string) { 98 | let shouldRetry = false 99 | try { 100 | const json = data.startsWith('data: ') ? data.match(/^data: (.*?)$/m)?.[1] : data 101 | const jobject = JSON.parse(json!!) 102 | if ( 103 | jobject?.error?.message.startsWith('That model is currently overloaded with other requests') 104 | ) { 105 | shouldRetry = true 106 | } 107 | } catch (e) { 108 | console.error(`first event data string: ${data}`) 109 | console.error(`parse json error: ${e}`) 110 | } 111 | return shouldRetry 112 | } 113 | -------------------------------------------------------------------------------- /app/v1/models/route.ts: -------------------------------------------------------------------------------- 1 | import { NextResponse } from 'next/server' 2 | 3 | export async function GET() { 4 | const models = { 5 | object: 'list', 6 | data: [ 7 | { 8 | id: 'whisper-1', 9 | object: 'model', 10 | created: 1677532384, 11 | owned_by: 'openai-internal', 12 | permission: [ 13 | { 14 | id: 'modelperm-KlsZlfft3Gma8pI6A8rTnyjs', 15 | object: 'model_permission', 16 | created: 1683912666, 17 | allow_create_engine: false, 18 | allow_sampling: true, 19 | allow_logprobs: true, 20 | allow_search_indices: false, 21 | allow_view: true, 22 | allow_fine_tuning: false, 23 | organization: '*', 24 | group: null, 25 | is_blocking: false 26 | } 27 | ], 28 | root: 'whisper-1', 29 | parent: null 30 | }, 31 | { 32 | id: 'babbage', 33 | object: 'model', 34 | created: 1649358449, 35 | owned_by: 'openai', 36 | permission: [ 37 | { 38 | id: 'modelperm-49FUp5v084tBB49tC4z8LPH5', 39 | object: 'model_permission', 40 | created: 1669085501, 41 | allow_create_engine: false, 42 | allow_sampling: true, 43 | allow_logprobs: true, 44 | allow_search_indices: false, 45 | allow_view: true, 46 | allow_fine_tuning: false, 47 | organization: '*', 48 | group: null, 49 | is_blocking: false 50 | } 51 | ], 52 | root: 'babbage', 53 | parent: null 54 | }, 55 | { 56 | id: 'text-davinci-003', 57 | object: 'model', 58 | created: 1669599635, 59 | owned_by: 'openai-internal', 60 | permission: [ 61 | { 62 | id: 'modelperm-jepinXYt59ncUQrjQEIUEDyC', 63 | object: 'model_permission', 64 | created: 1688551385, 65 | allow_create_engine: false, 66 | allow_sampling: true, 67 | allow_logprobs: true, 68 | allow_search_indices: false, 69 | allow_view: true, 70 | allow_fine_tuning: false, 71 | organization: '*', 72 | group: null, 73 | is_blocking: false 74 | } 75 | ], 76 | root: 'text-davinci-003', 77 | parent: null 78 | }, 79 | { 80 | id: 'davinci', 81 | object: 'model', 82 | created: 1649359874, 83 | owned_by: 'openai', 84 | permission: [ 85 | { 86 | id: 'modelperm-U6ZwlyAd0LyMk4rcMdz33Yc3', 87 | object: 'model_permission', 88 | created: 1669066355, 89 | allow_create_engine: false, 90 | allow_sampling: true, 91 | allow_logprobs: true, 92 | allow_search_indices: false, 93 | allow_view: true, 94 | allow_fine_tuning: false, 95 | organization: '*', 96 | group: null, 97 | is_blocking: false 98 | } 99 | ], 100 | root: 'davinci', 101 | parent: null 102 | }, 103 | { 104 | id: 'text-davinci-edit-001', 105 | object: 'model', 106 | created: 1649809179, 107 | owned_by: 'openai', 108 | permission: [ 109 | { 110 | id: 'modelperm-otmQSS0hmabtVGHI9QB3bct3', 111 | object: 'model_permission', 112 | created: 1679934178, 113 | allow_create_engine: false, 114 | allow_sampling: true, 115 | allow_logprobs: true, 116 | allow_search_indices: false, 117 | allow_view: true, 118 | allow_fine_tuning: false, 119 | organization: '*', 120 | group: null, 121 | is_blocking: false 122 | } 123 | ], 124 | root: 'text-davinci-edit-001', 125 | parent: null 126 | }, 127 | { 128 | id: 'babbage-code-search-code', 129 | object: 'model', 130 | created: 1651172509, 131 | owned_by: 'openai-dev', 132 | permission: [ 133 | { 134 | id: 'modelperm-4qRnA3Hj8HIJbgo0cGbcmErn', 135 | object: 'model_permission', 136 | created: 1669085863, 137 | allow_create_engine: false, 138 | allow_sampling: true, 139 | allow_logprobs: true, 140 | allow_search_indices: true, 141 | allow_view: true, 142 | allow_fine_tuning: false, 143 | organization: '*', 144 | group: null, 145 | is_blocking: false 146 | } 147 | ], 148 | root: 'babbage-code-search-code', 149 | parent: null 150 | }, 151 | { 152 | id: 'text-similarity-babbage-001', 153 | object: 'model', 154 | created: 1651172505, 155 | owned_by: 'openai-dev', 156 | permission: [ 157 | { 158 | id: 'modelperm-48kcCHhfzvnfY84OtJf5m8Cz', 159 | object: 'model_permission', 160 | created: 1669081947, 161 | allow_create_engine: false, 162 | allow_sampling: true, 163 | allow_logprobs: true, 164 | allow_search_indices: true, 165 | allow_view: true, 166 | allow_fine_tuning: false, 167 | organization: '*', 168 | group: null, 169 | is_blocking: false 170 | } 171 | ], 172 | root: 'text-similarity-babbage-001', 173 | parent: null 174 | }, 175 | { 176 | id: 'code-davinci-edit-001', 177 | object: 'model', 178 | created: 1649880484, 179 | owned_by: 'openai', 180 | permission: [ 181 | { 182 | id: 'modelperm-Foe5Y4TvaKveYxt74oKMw8IB', 183 | object: 'model_permission', 184 | created: 1679934178, 185 | allow_create_engine: false, 186 | allow_sampling: true, 187 | allow_logprobs: true, 188 | allow_search_indices: false, 189 | allow_view: true, 190 | allow_fine_tuning: false, 191 | organization: '*', 192 | group: null, 193 | is_blocking: false 194 | } 195 | ], 196 | root: 'code-davinci-edit-001', 197 | parent: null 198 | }, 199 | { 200 | id: 'text-davinci-001', 201 | object: 'model', 202 | created: 1649364042, 203 | owned_by: 'openai', 204 | permission: [ 205 | { 206 | id: 'modelperm-MVM5NfoRjXkDve3uQW3YZDDt', 207 | object: 'model_permission', 208 | created: 1669066355, 209 | allow_create_engine: false, 210 | allow_sampling: true, 211 | allow_logprobs: true, 212 | allow_search_indices: false, 213 | allow_view: true, 214 | allow_fine_tuning: false, 215 | organization: '*', 216 | group: null, 217 | is_blocking: false 218 | } 219 | ], 220 | root: 'text-davinci-001', 221 | parent: null 222 | }, 223 | { 224 | id: 'gpt-4-0613', 225 | object: 'model', 226 | created: 1686588896, 227 | owned_by: 'openai', 228 | permission: [ 229 | { 230 | id: 'modelperm-qYdrB0mRc03lRQ2hT39jaoaZ', 231 | object: 'model_permission', 232 | created: 1688064550, 233 | allow_create_engine: false, 234 | allow_sampling: false, 235 | allow_logprobs: false, 236 | allow_search_indices: false, 237 | allow_view: false, 238 | allow_fine_tuning: false, 239 | organization: '*', 240 | group: null, 241 | is_blocking: false 242 | } 243 | ], 244 | root: 'gpt-4-0613', 245 | parent: null 246 | }, 247 | { 248 | id: 'ada', 249 | object: 'model', 250 | created: 1649357491, 251 | owned_by: 'openai', 252 | permission: [ 253 | { 254 | id: 'modelperm-u0nKN4ub7EVQudgMuvCuvDjc', 255 | object: 'model_permission', 256 | created: 1675997661, 257 | allow_create_engine: false, 258 | allow_sampling: true, 259 | allow_logprobs: true, 260 | allow_search_indices: false, 261 | allow_view: true, 262 | allow_fine_tuning: false, 263 | organization: '*', 264 | group: null, 265 | is_blocking: false 266 | } 267 | ], 268 | root: 'ada', 269 | parent: null 270 | }, 271 | { 272 | id: 'babbage-code-search-text', 273 | object: 'model', 274 | created: 1651172509, 275 | owned_by: 'openai-dev', 276 | permission: [ 277 | { 278 | id: 'modelperm-Lftf8H4ZPDxNxVs0hHPJBUoe', 279 | object: 'model_permission', 280 | created: 1669085863, 281 | allow_create_engine: false, 282 | allow_sampling: true, 283 | allow_logprobs: true, 284 | allow_search_indices: true, 285 | allow_view: true, 286 | allow_fine_tuning: false, 287 | organization: '*', 288 | group: null, 289 | is_blocking: false 290 | } 291 | ], 292 | root: 'babbage-code-search-text', 293 | parent: null 294 | }, 295 | { 296 | id: 'babbage-similarity', 297 | object: 'model', 298 | created: 1651172505, 299 | owned_by: 'openai-dev', 300 | permission: [ 301 | { 302 | id: 'modelperm-mS20lnPqhebTaFPrcCufyg7m', 303 | object: 'model_permission', 304 | created: 1669081947, 305 | allow_create_engine: false, 306 | allow_sampling: true, 307 | allow_logprobs: true, 308 | allow_search_indices: true, 309 | allow_view: true, 310 | allow_fine_tuning: false, 311 | organization: '*', 312 | group: null, 313 | is_blocking: false 314 | } 315 | ], 316 | root: 'babbage-similarity', 317 | parent: null 318 | }, 319 | { 320 | id: 'gpt-4', 321 | object: 'model', 322 | created: 1687882411, 323 | owned_by: 'openai', 324 | permission: [ 325 | { 326 | id: 'modelperm-diiQtZ5tUpybamu7FIVQlA9l', 327 | object: 'model_permission', 328 | created: 1688683976, 329 | allow_create_engine: false, 330 | allow_sampling: false, 331 | allow_logprobs: false, 332 | allow_search_indices: false, 333 | allow_view: false, 334 | allow_fine_tuning: false, 335 | organization: '*', 336 | group: null, 337 | is_blocking: false 338 | } 339 | ], 340 | root: 'gpt-4', 341 | parent: null 342 | }, 343 | { 344 | id: 'gpt-3.5-turbo-0613', 345 | object: 'model', 346 | created: 1686587434, 347 | owned_by: 'openai', 348 | permission: [ 349 | { 350 | id: 'modelperm-bpckooQK40TixMluAcpyCFgL', 351 | object: 'model_permission', 352 | created: 1688690348, 353 | allow_create_engine: false, 354 | allow_sampling: true, 355 | allow_logprobs: true, 356 | allow_search_indices: false, 357 | allow_view: true, 358 | allow_fine_tuning: false, 359 | organization: '*', 360 | group: null, 361 | is_blocking: false 362 | } 363 | ], 364 | root: 'gpt-3.5-turbo-0613', 365 | parent: null 366 | }, 367 | { 368 | id: 'gpt-3.5-turbo-16k-0613', 369 | object: 'model', 370 | created: 1685474247, 371 | owned_by: 'openai', 372 | permission: [ 373 | { 374 | id: 'modelperm-ZY0iXVEnYcuTmNTeVNoZLg0n', 375 | object: 'model_permission', 376 | created: 1688692724, 377 | allow_create_engine: false, 378 | allow_sampling: true, 379 | allow_logprobs: true, 380 | allow_search_indices: false, 381 | allow_view: true, 382 | allow_fine_tuning: false, 383 | organization: '*', 384 | group: null, 385 | is_blocking: false 386 | } 387 | ], 388 | root: 'gpt-3.5-turbo-16k-0613', 389 | parent: null 390 | }, 391 | { 392 | id: 'code-search-babbage-text-001', 393 | object: 'model', 394 | created: 1651172507, 395 | owned_by: 'openai-dev', 396 | permission: [ 397 | { 398 | id: 'modelperm-EC5ASz4NLChtEV1Cwkmrwm57', 399 | object: 'model_permission', 400 | created: 1669085863, 401 | allow_create_engine: false, 402 | allow_sampling: true, 403 | allow_logprobs: true, 404 | allow_search_indices: true, 405 | allow_view: true, 406 | allow_fine_tuning: false, 407 | organization: '*', 408 | group: null, 409 | is_blocking: false 410 | } 411 | ], 412 | root: 'code-search-babbage-text-001', 413 | parent: null 414 | }, 415 | { 416 | id: 'text-curie-001', 417 | object: 'model', 418 | created: 1649364043, 419 | owned_by: 'openai', 420 | permission: [ 421 | { 422 | id: 'modelperm-8InhPV3CZfN3F5QHKoJd4zRD', 423 | object: 'model_permission', 424 | created: 1679310997, 425 | allow_create_engine: false, 426 | allow_sampling: true, 427 | allow_logprobs: true, 428 | allow_search_indices: false, 429 | allow_view: true, 430 | allow_fine_tuning: false, 431 | organization: '*', 432 | group: null, 433 | is_blocking: false 434 | } 435 | ], 436 | root: 'text-curie-001', 437 | parent: null 438 | }, 439 | { 440 | id: 'gpt-3.5-turbo', 441 | object: 'model', 442 | created: 1677610602, 443 | owned_by: 'openai', 444 | permission: [ 445 | { 446 | id: 'modelperm-iazAzvOcSRf4lOkK4p5B6EP8', 447 | object: 'model_permission', 448 | created: 1688690441, 449 | allow_create_engine: false, 450 | allow_sampling: true, 451 | allow_logprobs: true, 452 | allow_search_indices: false, 453 | allow_view: true, 454 | allow_fine_tuning: false, 455 | organization: '*', 456 | group: null, 457 | is_blocking: false 458 | } 459 | ], 460 | root: 'gpt-3.5-turbo', 461 | parent: null 462 | }, 463 | { 464 | id: 'gpt-3.5-turbo-16k', 465 | object: 'model', 466 | created: 1683758102, 467 | owned_by: 'openai-internal', 468 | permission: [ 469 | { 470 | id: 'modelperm-incf1vHEBCbZnCddTGBKniux', 471 | object: 'model_permission', 472 | created: 1688692820, 473 | allow_create_engine: false, 474 | allow_sampling: true, 475 | allow_logprobs: true, 476 | allow_search_indices: false, 477 | allow_view: true, 478 | allow_fine_tuning: false, 479 | organization: '*', 480 | group: null, 481 | is_blocking: false 482 | } 483 | ], 484 | root: 'gpt-3.5-turbo-16k', 485 | parent: null 486 | }, 487 | { 488 | id: 'code-search-babbage-code-001', 489 | object: 'model', 490 | created: 1651172507, 491 | owned_by: 'openai-dev', 492 | permission: [ 493 | { 494 | id: 'modelperm-64LWHdlANgak2rHzc3K5Stt0', 495 | object: 'model_permission', 496 | created: 1669085864, 497 | allow_create_engine: false, 498 | allow_sampling: true, 499 | allow_logprobs: true, 500 | allow_search_indices: true, 501 | allow_view: true, 502 | allow_fine_tuning: false, 503 | organization: '*', 504 | group: null, 505 | is_blocking: false 506 | } 507 | ], 508 | root: 'code-search-babbage-code-001', 509 | parent: null 510 | }, 511 | { 512 | id: 'text-ada-001', 513 | object: 'model', 514 | created: 1649364042, 515 | owned_by: 'openai', 516 | permission: [ 517 | { 518 | id: 'modelperm-KN5dRBCEW4az6gwcGXkRkMwK', 519 | object: 'model_permission', 520 | created: 1669088497, 521 | allow_create_engine: false, 522 | allow_sampling: true, 523 | allow_logprobs: true, 524 | allow_search_indices: false, 525 | allow_view: true, 526 | allow_fine_tuning: false, 527 | organization: '*', 528 | group: null, 529 | is_blocking: false 530 | } 531 | ], 532 | root: 'text-ada-001', 533 | parent: null 534 | }, 535 | { 536 | id: 'text-similarity-ada-001', 537 | object: 'model', 538 | created: 1651172505, 539 | owned_by: 'openai-dev', 540 | permission: [ 541 | { 542 | id: 'modelperm-DdCqkqmORpqxqdg4TkFRAgmw', 543 | object: 'model_permission', 544 | created: 1669092759, 545 | allow_create_engine: false, 546 | allow_sampling: true, 547 | allow_logprobs: true, 548 | allow_search_indices: true, 549 | allow_view: true, 550 | allow_fine_tuning: false, 551 | organization: '*', 552 | group: null, 553 | is_blocking: false 554 | } 555 | ], 556 | root: 'text-similarity-ada-001', 557 | parent: null 558 | }, 559 | { 560 | id: 'curie-instruct-beta', 561 | object: 'model', 562 | created: 1649364042, 563 | owned_by: 'openai', 564 | permission: [ 565 | { 566 | id: 'modelperm-bsg59MlOi88CMf1MjnIKrT5a', 567 | object: 'model_permission', 568 | created: 1680267269, 569 | allow_create_engine: false, 570 | allow_sampling: true, 571 | allow_logprobs: true, 572 | allow_search_indices: false, 573 | allow_view: true, 574 | allow_fine_tuning: false, 575 | organization: '*', 576 | group: null, 577 | is_blocking: false 578 | } 579 | ], 580 | root: 'curie-instruct-beta', 581 | parent: null 582 | }, 583 | { 584 | id: 'gpt-3.5-turbo-0301', 585 | object: 'model', 586 | created: 1677649963, 587 | owned_by: 'openai', 588 | permission: [ 589 | { 590 | id: 'modelperm-v60zSOg6kSqrIjHyLT3wC4Io', 591 | object: 'model_permission', 592 | created: 1688063670, 593 | allow_create_engine: false, 594 | allow_sampling: true, 595 | allow_logprobs: true, 596 | allow_search_indices: false, 597 | allow_view: true, 598 | allow_fine_tuning: false, 599 | organization: '*', 600 | group: null, 601 | is_blocking: false 602 | } 603 | ], 604 | root: 'gpt-3.5-turbo-0301', 605 | parent: null 606 | }, 607 | { 608 | id: 'ada-code-search-code', 609 | object: 'model', 610 | created: 1651172505, 611 | owned_by: 'openai-dev', 612 | permission: [ 613 | { 614 | id: 'modelperm-wa8tg4Pi9QQNaWdjMTM8dkkx', 615 | object: 'model_permission', 616 | created: 1669087421, 617 | allow_create_engine: false, 618 | allow_sampling: true, 619 | allow_logprobs: true, 620 | allow_search_indices: true, 621 | allow_view: true, 622 | allow_fine_tuning: false, 623 | organization: '*', 624 | group: null, 625 | is_blocking: false 626 | } 627 | ], 628 | root: 'ada-code-search-code', 629 | parent: null 630 | }, 631 | { 632 | id: 'ada-similarity', 633 | object: 'model', 634 | created: 1651172507, 635 | owned_by: 'openai-dev', 636 | permission: [ 637 | { 638 | id: 'modelperm-LtSIwCEReeDcvGTmM13gv6Fg', 639 | object: 'model_permission', 640 | created: 1669092759, 641 | allow_create_engine: false, 642 | allow_sampling: true, 643 | allow_logprobs: true, 644 | allow_search_indices: true, 645 | allow_view: true, 646 | allow_fine_tuning: false, 647 | organization: '*', 648 | group: null, 649 | is_blocking: false 650 | } 651 | ], 652 | root: 'ada-similarity', 653 | parent: null 654 | }, 655 | { 656 | id: 'code-search-ada-text-001', 657 | object: 'model', 658 | created: 1651172507, 659 | owned_by: 'openai-dev', 660 | permission: [ 661 | { 662 | id: 'modelperm-JBssaJSmbgvJfTkX71y71k2J', 663 | object: 'model_permission', 664 | created: 1669087421, 665 | allow_create_engine: false, 666 | allow_sampling: true, 667 | allow_logprobs: true, 668 | allow_search_indices: true, 669 | allow_view: true, 670 | allow_fine_tuning: false, 671 | organization: '*', 672 | group: null, 673 | is_blocking: false 674 | } 675 | ], 676 | root: 'code-search-ada-text-001', 677 | parent: null 678 | }, 679 | { 680 | id: 'text-search-ada-query-001', 681 | object: 'model', 682 | created: 1651172505, 683 | owned_by: 'openai-dev', 684 | permission: [ 685 | { 686 | id: 'modelperm-1YiiBMYC8it0mpQCBK7t8uSP', 687 | object: 'model_permission', 688 | created: 1669092640, 689 | allow_create_engine: false, 690 | allow_sampling: true, 691 | allow_logprobs: true, 692 | allow_search_indices: true, 693 | allow_view: true, 694 | allow_fine_tuning: false, 695 | organization: '*', 696 | group: null, 697 | is_blocking: false 698 | } 699 | ], 700 | root: 'text-search-ada-query-001', 701 | parent: null 702 | }, 703 | { 704 | id: 'davinci-search-document', 705 | object: 'model', 706 | created: 1651172509, 707 | owned_by: 'openai-dev', 708 | permission: [ 709 | { 710 | id: 'modelperm-M43LVJQRGxz6ode34ctLrCaG', 711 | object: 'model_permission', 712 | created: 1669066355, 713 | allow_create_engine: false, 714 | allow_sampling: true, 715 | allow_logprobs: true, 716 | allow_search_indices: true, 717 | allow_view: true, 718 | allow_fine_tuning: false, 719 | organization: '*', 720 | group: null, 721 | is_blocking: false 722 | } 723 | ], 724 | root: 'davinci-search-document', 725 | parent: null 726 | }, 727 | { 728 | id: 'ada-code-search-text', 729 | object: 'model', 730 | created: 1651172510, 731 | owned_by: 'openai-dev', 732 | permission: [ 733 | { 734 | id: 'modelperm-kFc17wOI4d1FjZEaCqnk4Frg', 735 | object: 'model_permission', 736 | created: 1669087421, 737 | allow_create_engine: false, 738 | allow_sampling: true, 739 | allow_logprobs: true, 740 | allow_search_indices: true, 741 | allow_view: true, 742 | allow_fine_tuning: false, 743 | organization: '*', 744 | group: null, 745 | is_blocking: false 746 | } 747 | ], 748 | root: 'ada-code-search-text', 749 | parent: null 750 | }, 751 | { 752 | id: 'text-search-ada-doc-001', 753 | object: 'model', 754 | created: 1651172507, 755 | owned_by: 'openai-dev', 756 | permission: [ 757 | { 758 | id: 'modelperm-kbHvYouDlkD78ehcmMOGdKpK', 759 | object: 'model_permission', 760 | created: 1669092640, 761 | allow_create_engine: false, 762 | allow_sampling: true, 763 | allow_logprobs: true, 764 | allow_search_indices: true, 765 | allow_view: true, 766 | allow_fine_tuning: false, 767 | organization: '*', 768 | group: null, 769 | is_blocking: false 770 | } 771 | ], 772 | root: 'text-search-ada-doc-001', 773 | parent: null 774 | }, 775 | { 776 | id: 'davinci-instruct-beta', 777 | object: 'model', 778 | created: 1649364042, 779 | owned_by: 'openai', 780 | permission: [ 781 | { 782 | id: 'modelperm-k9kuMYlfd9nvFiJV2ug0NWws', 783 | object: 'model_permission', 784 | created: 1669066356, 785 | allow_create_engine: false, 786 | allow_sampling: true, 787 | allow_logprobs: true, 788 | allow_search_indices: false, 789 | allow_view: true, 790 | allow_fine_tuning: false, 791 | organization: '*', 792 | group: null, 793 | is_blocking: false 794 | } 795 | ], 796 | root: 'davinci-instruct-beta', 797 | parent: null 798 | }, 799 | { 800 | id: 'text-similarity-curie-001', 801 | object: 'model', 802 | created: 1651172507, 803 | owned_by: 'openai-dev', 804 | permission: [ 805 | { 806 | id: 'modelperm-6dgTTyXrZE7d53Licw4hYkvd', 807 | object: 'model_permission', 808 | created: 1669079883, 809 | allow_create_engine: false, 810 | allow_sampling: true, 811 | allow_logprobs: true, 812 | allow_search_indices: true, 813 | allow_view: true, 814 | allow_fine_tuning: false, 815 | organization: '*', 816 | group: null, 817 | is_blocking: false 818 | } 819 | ], 820 | root: 'text-similarity-curie-001', 821 | parent: null 822 | }, 823 | { 824 | id: 'code-search-ada-code-001', 825 | object: 'model', 826 | created: 1651172507, 827 | owned_by: 'openai-dev', 828 | permission: [ 829 | { 830 | id: 'modelperm-8soch45iiGvux5Fg1ORjdC4s', 831 | object: 'model_permission', 832 | created: 1669087421, 833 | allow_create_engine: false, 834 | allow_sampling: true, 835 | allow_logprobs: true, 836 | allow_search_indices: true, 837 | allow_view: true, 838 | allow_fine_tuning: false, 839 | organization: '*', 840 | group: null, 841 | is_blocking: false 842 | } 843 | ], 844 | root: 'code-search-ada-code-001', 845 | parent: null 846 | }, 847 | { 848 | id: 'ada-search-query', 849 | object: 'model', 850 | created: 1651172505, 851 | owned_by: 'openai-dev', 852 | permission: [ 853 | { 854 | id: 'modelperm-b753xmIzAUkluQ1L20eDZLtQ', 855 | object: 'model_permission', 856 | created: 1669092640, 857 | allow_create_engine: false, 858 | allow_sampling: true, 859 | allow_logprobs: true, 860 | allow_search_indices: true, 861 | allow_view: true, 862 | allow_fine_tuning: false, 863 | organization: '*', 864 | group: null, 865 | is_blocking: false 866 | } 867 | ], 868 | root: 'ada-search-query', 869 | parent: null 870 | }, 871 | { 872 | id: 'text-search-davinci-query-001', 873 | object: 'model', 874 | created: 1651172505, 875 | owned_by: 'openai-dev', 876 | permission: [ 877 | { 878 | id: 'modelperm-9McKbsEYSaDshU9M3bp6ejUb', 879 | object: 'model_permission', 880 | created: 1669066353, 881 | allow_create_engine: false, 882 | allow_sampling: true, 883 | allow_logprobs: true, 884 | allow_search_indices: true, 885 | allow_view: true, 886 | allow_fine_tuning: false, 887 | organization: '*', 888 | group: null, 889 | is_blocking: false 890 | } 891 | ], 892 | root: 'text-search-davinci-query-001', 893 | parent: null 894 | }, 895 | { 896 | id: 'curie-search-query', 897 | object: 'model', 898 | created: 1651172509, 899 | owned_by: 'openai-dev', 900 | permission: [ 901 | { 902 | id: 'modelperm-sIbfSwzVpVBtymQgOQSLBpxe', 903 | object: 'model_permission', 904 | created: 1677273417, 905 | allow_create_engine: false, 906 | allow_sampling: true, 907 | allow_logprobs: true, 908 | allow_search_indices: true, 909 | allow_view: true, 910 | allow_fine_tuning: false, 911 | organization: '*', 912 | group: null, 913 | is_blocking: false 914 | } 915 | ], 916 | root: 'curie-search-query', 917 | parent: null 918 | }, 919 | { 920 | id: 'davinci-search-query', 921 | object: 'model', 922 | created: 1651172505, 923 | owned_by: 'openai-dev', 924 | permission: [ 925 | { 926 | id: 'modelperm-lYkiTZMmJMWm8jvkPx2duyHE', 927 | object: 'model_permission', 928 | created: 1669066353, 929 | allow_create_engine: false, 930 | allow_sampling: true, 931 | allow_logprobs: true, 932 | allow_search_indices: true, 933 | allow_view: true, 934 | allow_fine_tuning: false, 935 | organization: '*', 936 | group: null, 937 | is_blocking: false 938 | } 939 | ], 940 | root: 'davinci-search-query', 941 | parent: null 942 | }, 943 | { 944 | id: 'babbage-search-document', 945 | object: 'model', 946 | created: 1651172510, 947 | owned_by: 'openai-dev', 948 | permission: [ 949 | { 950 | id: 'modelperm-5qFV9kxCRGKIXpBEP75chmp7', 951 | object: 'model_permission', 952 | created: 1669084981, 953 | allow_create_engine: false, 954 | allow_sampling: true, 955 | allow_logprobs: true, 956 | allow_search_indices: true, 957 | allow_view: true, 958 | allow_fine_tuning: false, 959 | organization: '*', 960 | group: null, 961 | is_blocking: false 962 | } 963 | ], 964 | root: 'babbage-search-document', 965 | parent: null 966 | }, 967 | { 968 | id: 'ada-search-document', 969 | object: 'model', 970 | created: 1651172507, 971 | owned_by: 'openai-dev', 972 | permission: [ 973 | { 974 | id: 'modelperm-8qUMuMAbo4EwedbGamV7e9hq', 975 | object: 'model_permission', 976 | created: 1669092640, 977 | allow_create_engine: false, 978 | allow_sampling: true, 979 | allow_logprobs: true, 980 | allow_search_indices: true, 981 | allow_view: true, 982 | allow_fine_tuning: false, 983 | organization: '*', 984 | group: null, 985 | is_blocking: false 986 | } 987 | ], 988 | root: 'ada-search-document', 989 | parent: null 990 | }, 991 | { 992 | id: 'text-search-curie-query-001', 993 | object: 'model', 994 | created: 1651172509, 995 | owned_by: 'openai-dev', 996 | permission: [ 997 | { 998 | id: 'modelperm-Iion0NCpsXPNtIkQ0owQLi7V', 999 | object: 'model_permission', 1000 | created: 1677273417, 1001 | allow_create_engine: false, 1002 | allow_sampling: true, 1003 | allow_logprobs: true, 1004 | allow_search_indices: true, 1005 | allow_view: true, 1006 | allow_fine_tuning: false, 1007 | organization: '*', 1008 | group: null, 1009 | is_blocking: false 1010 | } 1011 | ], 1012 | root: 'text-search-curie-query-001', 1013 | parent: null 1014 | }, 1015 | { 1016 | id: 'gpt-4-0314', 1017 | object: 'model', 1018 | created: 1687882410, 1019 | owned_by: 'openai', 1020 | permission: [ 1021 | { 1022 | id: 'modelperm-tzDBunpcuXprdwTTUepe3YIN', 1023 | object: 'model_permission', 1024 | created: 1688711426, 1025 | allow_create_engine: false, 1026 | allow_sampling: false, 1027 | allow_logprobs: false, 1028 | allow_search_indices: false, 1029 | allow_view: false, 1030 | allow_fine_tuning: false, 1031 | organization: '*', 1032 | group: null, 1033 | is_blocking: false 1034 | } 1035 | ], 1036 | root: 'gpt-4-0314', 1037 | parent: null 1038 | }, 1039 | { 1040 | id: 'text-search-babbage-doc-001', 1041 | object: 'model', 1042 | created: 1651172509, 1043 | owned_by: 'openai-dev', 1044 | permission: [ 1045 | { 1046 | id: 'modelperm-ao2r26P2Th7nhRFleHwy2gn5', 1047 | object: 'model_permission', 1048 | created: 1669084981, 1049 | allow_create_engine: false, 1050 | allow_sampling: true, 1051 | allow_logprobs: true, 1052 | allow_search_indices: true, 1053 | allow_view: true, 1054 | allow_fine_tuning: false, 1055 | organization: '*', 1056 | group: null, 1057 | is_blocking: false 1058 | } 1059 | ], 1060 | root: 'text-search-babbage-doc-001', 1061 | parent: null 1062 | }, 1063 | { 1064 | id: 'curie-search-document', 1065 | object: 'model', 1066 | created: 1651172508, 1067 | owned_by: 'openai-dev', 1068 | permission: [ 1069 | { 1070 | id: 'modelperm-LDsN5wW8eKVuh1OsyciHntE9', 1071 | object: 'model_permission', 1072 | created: 1677273417, 1073 | allow_create_engine: false, 1074 | allow_sampling: true, 1075 | allow_logprobs: true, 1076 | allow_search_indices: true, 1077 | allow_view: true, 1078 | allow_fine_tuning: false, 1079 | organization: '*', 1080 | group: null, 1081 | is_blocking: false 1082 | } 1083 | ], 1084 | root: 'curie-search-document', 1085 | parent: null 1086 | }, 1087 | { 1088 | id: 'text-search-curie-doc-001', 1089 | object: 'model', 1090 | created: 1651172509, 1091 | owned_by: 'openai-dev', 1092 | permission: [ 1093 | { 1094 | id: 'modelperm-taUGRSku7bQLa24SNIwYPEsi', 1095 | object: 'model_permission', 1096 | created: 1677273417, 1097 | allow_create_engine: false, 1098 | allow_sampling: true, 1099 | allow_logprobs: true, 1100 | allow_search_indices: true, 1101 | allow_view: true, 1102 | allow_fine_tuning: false, 1103 | organization: '*', 1104 | group: null, 1105 | is_blocking: false 1106 | } 1107 | ], 1108 | root: 'text-search-curie-doc-001', 1109 | parent: null 1110 | }, 1111 | { 1112 | id: 'babbage-search-query', 1113 | object: 'model', 1114 | created: 1651172509, 1115 | owned_by: 'openai-dev', 1116 | permission: [ 1117 | { 1118 | id: 'modelperm-wSs1hMXDKsrcErlbN8HmzlLE', 1119 | object: 'model_permission', 1120 | created: 1669084981, 1121 | allow_create_engine: false, 1122 | allow_sampling: true, 1123 | allow_logprobs: true, 1124 | allow_search_indices: true, 1125 | allow_view: true, 1126 | allow_fine_tuning: false, 1127 | organization: '*', 1128 | group: null, 1129 | is_blocking: false 1130 | } 1131 | ], 1132 | root: 'babbage-search-query', 1133 | parent: null 1134 | }, 1135 | { 1136 | id: 'text-babbage-001', 1137 | object: 'model', 1138 | created: 1649364043, 1139 | owned_by: 'openai', 1140 | permission: [ 1141 | { 1142 | id: 'modelperm-a3Ph5FIBbJxsoA4wvx7VYC7R', 1143 | object: 'model_permission', 1144 | created: 1675105935, 1145 | allow_create_engine: false, 1146 | allow_sampling: true, 1147 | allow_logprobs: true, 1148 | allow_search_indices: false, 1149 | allow_view: true, 1150 | allow_fine_tuning: false, 1151 | organization: '*', 1152 | group: null, 1153 | is_blocking: false 1154 | } 1155 | ], 1156 | root: 'text-babbage-001', 1157 | parent: null 1158 | }, 1159 | { 1160 | id: 'text-search-davinci-doc-001', 1161 | object: 'model', 1162 | created: 1651172505, 1163 | owned_by: 'openai-dev', 1164 | permission: [ 1165 | { 1166 | id: 'modelperm-qhSf1j2MJMujcu3t7cHnF1DN', 1167 | object: 'model_permission', 1168 | created: 1669066353, 1169 | allow_create_engine: false, 1170 | allow_sampling: true, 1171 | allow_logprobs: true, 1172 | allow_search_indices: true, 1173 | allow_view: true, 1174 | allow_fine_tuning: false, 1175 | organization: '*', 1176 | group: null, 1177 | is_blocking: false 1178 | } 1179 | ], 1180 | root: 'text-search-davinci-doc-001', 1181 | parent: null 1182 | }, 1183 | { 1184 | id: 'text-search-babbage-query-001', 1185 | object: 'model', 1186 | created: 1651172509, 1187 | owned_by: 'openai-dev', 1188 | permission: [ 1189 | { 1190 | id: 'modelperm-Kg70kkFxD93QQqsVe4Zw8vjc', 1191 | object: 'model_permission', 1192 | created: 1669084981, 1193 | allow_create_engine: false, 1194 | allow_sampling: true, 1195 | allow_logprobs: true, 1196 | allow_search_indices: true, 1197 | allow_view: true, 1198 | allow_fine_tuning: false, 1199 | organization: '*', 1200 | group: null, 1201 | is_blocking: false 1202 | } 1203 | ], 1204 | root: 'text-search-babbage-query-001', 1205 | parent: null 1206 | }, 1207 | { 1208 | id: 'curie-similarity', 1209 | object: 'model', 1210 | created: 1651172510, 1211 | owned_by: 'openai-dev', 1212 | permission: [ 1213 | { 1214 | id: 'modelperm-zhWKExSloaQiJgzjVHFmh2wR', 1215 | object: 'model_permission', 1216 | created: 1675106290, 1217 | allow_create_engine: false, 1218 | allow_sampling: true, 1219 | allow_logprobs: true, 1220 | allow_search_indices: true, 1221 | allow_view: true, 1222 | allow_fine_tuning: false, 1223 | organization: '*', 1224 | group: null, 1225 | is_blocking: false 1226 | } 1227 | ], 1228 | root: 'curie-similarity', 1229 | parent: null 1230 | }, 1231 | { 1232 | id: 'curie', 1233 | object: 'model', 1234 | created: 1649359874, 1235 | owned_by: 'openai', 1236 | permission: [ 1237 | { 1238 | id: 'modelperm-oPaljeveTjEIDbhDjzFiyf4V', 1239 | object: 'model_permission', 1240 | created: 1675106503, 1241 | allow_create_engine: false, 1242 | allow_sampling: true, 1243 | allow_logprobs: true, 1244 | allow_search_indices: false, 1245 | allow_view: true, 1246 | allow_fine_tuning: false, 1247 | organization: '*', 1248 | group: null, 1249 | is_blocking: false 1250 | } 1251 | ], 1252 | root: 'curie', 1253 | parent: null 1254 | }, 1255 | { 1256 | id: 'text-embedding-ada-002', 1257 | object: 'model', 1258 | created: 1671217299, 1259 | owned_by: 'openai-internal', 1260 | permission: [ 1261 | { 1262 | id: 'modelperm-3nA9lRH2BRk4nbMOp5RUC5Pl', 1263 | object: 'model_permission', 1264 | created: 1687981941, 1265 | allow_create_engine: false, 1266 | allow_sampling: true, 1267 | allow_logprobs: true, 1268 | allow_search_indices: true, 1269 | allow_view: true, 1270 | allow_fine_tuning: false, 1271 | organization: '*', 1272 | group: null, 1273 | is_blocking: false 1274 | } 1275 | ], 1276 | root: 'text-embedding-ada-002', 1277 | parent: null 1278 | }, 1279 | { 1280 | id: 'text-similarity-davinci-001', 1281 | object: 'model', 1282 | created: 1651172505, 1283 | owned_by: 'openai-dev', 1284 | permission: [ 1285 | { 1286 | id: 'modelperm-OvmcfYoq5V9SF9xTYw1Oz6Ue', 1287 | object: 'model_permission', 1288 | created: 1669066356, 1289 | allow_create_engine: false, 1290 | allow_sampling: true, 1291 | allow_logprobs: true, 1292 | allow_search_indices: true, 1293 | allow_view: true, 1294 | allow_fine_tuning: false, 1295 | organization: '*', 1296 | group: null, 1297 | is_blocking: false 1298 | } 1299 | ], 1300 | root: 'text-similarity-davinci-001', 1301 | parent: null 1302 | }, 1303 | { 1304 | id: 'text-davinci-002', 1305 | object: 'model', 1306 | created: 1649880484, 1307 | owned_by: 'openai', 1308 | permission: [ 1309 | { 1310 | id: 'modelperm-l4EU6QlN1HcS0so0jU16kyg8', 1311 | object: 'model_permission', 1312 | created: 1679355287, 1313 | allow_create_engine: false, 1314 | allow_sampling: true, 1315 | allow_logprobs: true, 1316 | allow_search_indices: false, 1317 | allow_view: true, 1318 | allow_fine_tuning: false, 1319 | organization: '*', 1320 | group: null, 1321 | is_blocking: false 1322 | } 1323 | ], 1324 | root: 'text-davinci-002', 1325 | parent: null 1326 | }, 1327 | { 1328 | id: 'davinci-similarity', 1329 | object: 'model', 1330 | created: 1651172509, 1331 | owned_by: 'openai-dev', 1332 | permission: [ 1333 | { 1334 | id: 'modelperm-lYYgng3LM0Y97HvB5CDc8no2', 1335 | object: 'model_permission', 1336 | created: 1669066353, 1337 | allow_create_engine: false, 1338 | allow_sampling: true, 1339 | allow_logprobs: true, 1340 | allow_search_indices: true, 1341 | allow_view: true, 1342 | allow_fine_tuning: false, 1343 | organization: '*', 1344 | group: null, 1345 | is_blocking: false 1346 | } 1347 | ], 1348 | root: 'davinci-similarity', 1349 | parent: null 1350 | } 1351 | ] 1352 | } 1353 | return NextResponse.json(models, { status: 200 }) 1354 | } 1355 | -------------------------------------------------------------------------------- /deploy/azure-deploy.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", 3 | "contentVersion": "1.0.0.0", 4 | "parameters": { 5 | "resourcePrefix": { 6 | "minLength": 3, 7 | "maxLength": 15, 8 | "type": "string", 9 | "metadata": { 10 | "description": "Resource prefix for all the resource provisioned. This should be an alphanumeric string. Note: please keep the `resourcePrefix` short, since some of the Azure resources need the full name to be less than 24 characters. It's recommended that to keep `resource_prefix` less than 15 characters." 11 | } 12 | } 13 | }, 14 | "variables": { 15 | "location": "[resourceGroup().location]", 16 | "tenantId": "[subscription().tenantId]", 17 | "webAppName": "[concat(parameters('resourcePrefix'),'webapp' )]", 18 | "webAppPlanName": "[concat(parameters('resourcePrefix'),'appplan' )]", 19 | "webAppPlanSku": "B1", 20 | "webAppAPIVersion": "2021-03-01", 21 | "preBuiltdockerImage": "scalaone/azure-openai-proxy:latest" 22 | }, 23 | "functions": [], 24 | "resources": [ 25 | { 26 | "type": "Microsoft.Web/serverfarms", 27 | "apiVersion": "[variables('webAppAPIVersion')]", 28 | "name": "[variables('webAppPlanName')]", 29 | "location": "[variables('location')]", 30 | "sku": { 31 | "name": "[variables('webAppPlanSku')]" 32 | }, 33 | "kind": "linux", 34 | "properties": { 35 | "reserved": true 36 | } 37 | }, 38 | { 39 | "type": "Microsoft.Web/sites", 40 | "apiVersion": "[variables('webAppAPIVersion')]", 41 | "name": "[variables('webAppName')]", 42 | "location": "[variables('location')]", 43 | "dependsOn": ["[resourceId('Microsoft.Web/serverfarms', variables('webAppPlanName'))]"], 44 | "kind": "app,linux,container", 45 | "identity": { 46 | "type": "SystemAssigned" 47 | }, 48 | "properties": { 49 | "name": "[variables('webAppName')]", 50 | "httpsOnly": "true", 51 | "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('webAppPlanName'))]", 52 | "siteConfig": { 53 | "linuxFxVersion": "[concat('DOCKER|', variables('preBuiltdockerImage'))]", 54 | "alwaysOn": true, 55 | "ftpsState": "Disabled", 56 | "appSettings": [ 57 | { 58 | "name": "WEBSITES_PORT", 59 | "value": "3000" 60 | }, 61 | { 62 | "name": "DOCKER_REGISTRY_SERVER_URL", 63 | "value": "https://index.docker.io/v1" 64 | }, 65 | { 66 | "name": "DOCKER_ENABLE_CI", 67 | "value": "true" 68 | } 69 | ] 70 | } 71 | } 72 | } 73 | ], 74 | "outputs": {} 75 | } 76 | -------------------------------------------------------------------------------- /docs/images/resource-and-model.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scalaone/azure-openai-proxy/40ca4869e8c304ca1fc973b9394a491f9db32b26/docs/images/resource-and-model.jpg -------------------------------------------------------------------------------- /e2e/chatbot-ui/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # ChatGPT UI application 5 | chatbot-ui: 6 | container_name: chatbot-ui 7 | image: ghcr.io/mckaywrigley/chatbot-ui:main 8 | ports: 9 | - 3000:3000 10 | environment: 11 | - OPENAI_API_KEY=${OPENAI_API_KEY} 12 | - OPENAI_API_HOST=http://azure-openai-proxy:3000 13 | depends_on: 14 | - azure-openai-proxy 15 | networks: 16 | - vnet 17 | restart: unless-stopped 18 | 19 | # Azure OpenAI Proxy service 20 | azure-openai-proxy: 21 | container_name: azure-openai-proxy 22 | build: 23 | context: ../.. 24 | networks: 25 | - vnet 26 | restart: unless-stopped 27 | 28 | networks: 29 | vnet: 30 | driver: bridge -------------------------------------------------------------------------------- /e2e/chatgpt-lite/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # ChatGPT UI application 5 | chatgpt-lite: 6 | container_name: chatgpt-lite 7 | image: blrchen/chatgpt-lite:main 8 | ports: 9 | - 3000:3000 10 | environment: 11 | OPENAI_API_KEY: ${OPENAI_API_KEY} 12 | OPENAI_API_BASE_URL: http://azure-openai-proxy:3000 13 | depends_on: 14 | - azure-openai-proxy 15 | networks: 16 | - vnet 17 | restart: unless-stopped 18 | 19 | # Azure OpenAI Proxy service 20 | azure-openai-proxy: 21 | container_name: azure-openai-proxy 22 | build: 23 | context: ../.. 24 | networks: 25 | - vnet 26 | restart: unless-stopped 27 | 28 | networks: 29 | vnet: 30 | driver: bridge -------------------------------------------------------------------------------- /e2e/chatgpt-minimal/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # ChatGPT UI application 5 | chatgpt-minimal: 6 | container_name: chatgpt-minimal 7 | image: blrchen/chatgpt-minimal:main 8 | ports: 9 | - 3000:3000 10 | environment: 11 | OPENAI_API_KEY: ${OPENAI_API_KEY} 12 | OPENAI_API_BASE_URL: http://azure-openai-proxy:3000 13 | depends_on: 14 | - azure-openai-proxy 15 | networks: 16 | - vnet 17 | restart: unless-stopped 18 | 19 | # Azure OpenAI Proxy service 20 | azure-openai-proxy: 21 | container_name: azure-openai-proxy 22 | build: 23 | context: ../.. 24 | networks: 25 | - vnet 26 | restart: unless-stopped 27 | 28 | networks: 29 | vnet: 30 | driver: bridge -------------------------------------------------------------------------------- /e2e/chatgpt-next-web/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # ChatGPT UI application 5 | chatgpt-next-web: 6 | container_name: chatgpt-next-web 7 | image: yidadaa/chatgpt-next-web:latest 8 | ports: 9 | - 3000:3000 10 | environment: 11 | - OPENAI_API_KEY=${OPENAI_API_KEY} 12 | - BASE_URL=http://azure-openai-proxy:3000 13 | depends_on: 14 | - azure-openai-proxy 15 | networks: 16 | - vnet 17 | restart: unless-stopped 18 | 19 | # Azure OpenAI Proxy service 20 | azure-openai-proxy: 21 | container_name: azure-openai-proxy 22 | build: 23 | context: ../.. 24 | dockerfile: Dockerfile 25 | networks: 26 | - vnet 27 | restart: unless-stopped 28 | 29 | # Networks configuration 30 | networks: 31 | vnet: 32 | driver: bridge -------------------------------------------------------------------------------- /e2e/chatgpt-web/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.8' 2 | 3 | services: 4 | # ChatGPT UI application 5 | chatgpt-web: 6 | container_name: chatgpt-web 7 | image: chenzhaoyu94/chatgpt-web 8 | ports: 9 | - 3002:3002 10 | environment: 11 | OPENAI_API_KEY: ${OPENAI_API_KEY} 12 | OPENAI_API_BASE_URL: http://azure-openai-proxy:3000 13 | # OPENAI_API_MODEL: gpt-4 14 | AUTH_SECRET_KEY: "" 15 | MAX_REQUEST_PER_HOUR: 1000 16 | TIMEOUT_MS: 60000 17 | depends_on: 18 | - azure-openai-proxy 19 | networks: 20 | - vnet 21 | restart: unless-stopped 22 | 23 | # Azure OpenAI Proxy service 24 | azure-openai-proxy: 25 | container_name: azure-openai-proxy 26 | build: 27 | context: ../.. 28 | networks: 29 | - vnet 30 | restart: unless-stopped 31 | 32 | networks: 33 | vnet: 34 | driver: bridge -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | output: 'standalone', 4 | reactStrictMode: true 5 | } 6 | 7 | module.exports = nextConfig 8 | -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "azure-openai-proxy", 3 | "version": "0.1.0", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "azure-openai-proxy", 9 | "version": "0.1.0", 10 | "dependencies": { 11 | "next": "^14.2.0", 12 | "react": "^18", 13 | "react-dom": "^18" 14 | }, 15 | "devDependencies": { 16 | "@types/node": "^20", 17 | "@types/react": "^18", 18 | "@types/react-dom": "^18", 19 | "prettier": "^3", 20 | "typescript": "^5" 21 | } 22 | }, 23 | "node_modules/@next/env": { 24 | "version": "14.2.14", 25 | "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.14.tgz", 26 | "integrity": "sha512-/0hWQfiaD5//LvGNgc8PjvyqV50vGK0cADYzaoOOGN8fxzBn3iAiaq3S0tCRnFBldq0LVveLcxCTi41ZoYgAgg==" 27 | }, 28 | "node_modules/@next/swc-darwin-arm64": { 29 | "version": "14.2.14", 30 | "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.2.14.tgz", 31 | "integrity": "sha512-bsxbSAUodM1cjYeA4o6y7sp9wslvwjSkWw57t8DtC8Zig8aG8V6r+Yc05/9mDzLKcybb6EN85k1rJDnMKBd9Gw==", 32 | "cpu": [ 33 | "arm64" 34 | ], 35 | "optional": true, 36 | "os": [ 37 | "darwin" 38 | ], 39 | "engines": { 40 | "node": ">= 10" 41 | } 42 | }, 43 | "node_modules/@next/swc-darwin-x64": { 44 | "version": "14.2.14", 45 | "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.2.14.tgz", 46 | "integrity": "sha512-cC9/I+0+SK5L1k9J8CInahduTVWGMXhQoXFeNvF0uNs3Bt1Ub0Azb8JzTU9vNCr0hnaMqiWu/Z0S1hfKc3+dww==", 47 | "cpu": [ 48 | "x64" 49 | ], 50 | "optional": true, 51 | "os": [ 52 | "darwin" 53 | ], 54 | "engines": { 55 | "node": ">= 10" 56 | } 57 | }, 58 | "node_modules/@next/swc-linux-arm64-gnu": { 59 | "version": "14.2.14", 60 | "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.2.14.tgz", 61 | "integrity": "sha512-RMLOdA2NU4O7w1PQ3Z9ft3PxD6Htl4uB2TJpocm+4jcllHySPkFaUIFacQ3Jekcg6w+LBaFvjSPthZHiPmiAUg==", 62 | "cpu": [ 63 | "arm64" 64 | ], 65 | "optional": true, 66 | "os": [ 67 | "linux" 68 | ], 69 | "engines": { 70 | "node": ">= 10" 71 | } 72 | }, 73 | "node_modules/@next/swc-linux-arm64-musl": { 74 | "version": "14.2.14", 75 | "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.2.14.tgz", 76 | "integrity": "sha512-WgLOA4hT9EIP7jhlkPnvz49iSOMdZgDJVvbpb8WWzJv5wBD07M2wdJXLkDYIpZmCFfo/wPqFsFR4JS4V9KkQ2A==", 77 | "cpu": [ 78 | "arm64" 79 | ], 80 | "optional": true, 81 | "os": [ 82 | "linux" 83 | ], 84 | "engines": { 85 | "node": ">= 10" 86 | } 87 | }, 88 | "node_modules/@next/swc-linux-x64-gnu": { 89 | "version": "14.2.14", 90 | "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.2.14.tgz", 91 | "integrity": "sha512-lbn7svjUps1kmCettV/R9oAvEW+eUI0lo0LJNFOXoQM5NGNxloAyFRNByYeZKL3+1bF5YE0h0irIJfzXBq9Y6w==", 92 | "cpu": [ 93 | "x64" 94 | ], 95 | "optional": true, 96 | "os": [ 97 | "linux" 98 | ], 99 | "engines": { 100 | "node": ">= 10" 101 | } 102 | }, 103 | "node_modules/@next/swc-linux-x64-musl": { 104 | "version": "14.2.14", 105 | "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.2.14.tgz", 106 | "integrity": "sha512-7TcQCvLQ/hKfQRgjxMN4TZ2BRB0P7HwrGAYL+p+m3u3XcKTraUFerVbV3jkNZNwDeQDa8zdxkKkw2els/S5onQ==", 107 | "cpu": [ 108 | "x64" 109 | ], 110 | "optional": true, 111 | "os": [ 112 | "linux" 113 | ], 114 | "engines": { 115 | "node": ">= 10" 116 | } 117 | }, 118 | "node_modules/@next/swc-win32-arm64-msvc": { 119 | "version": "14.2.14", 120 | "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.2.14.tgz", 121 | "integrity": "sha512-8i0Ou5XjTLEje0oj0JiI0Xo9L/93ghFtAUYZ24jARSeTMXLUx8yFIdhS55mTExq5Tj4/dC2fJuaT4e3ySvXU1A==", 122 | "cpu": [ 123 | "arm64" 124 | ], 125 | "optional": true, 126 | "os": [ 127 | "win32" 128 | ], 129 | "engines": { 130 | "node": ">= 10" 131 | } 132 | }, 133 | "node_modules/@next/swc-win32-ia32-msvc": { 134 | "version": "14.2.14", 135 | "resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.2.14.tgz", 136 | "integrity": "sha512-2u2XcSaDEOj+96eXpyjHjtVPLhkAFw2nlaz83EPeuK4obF+HmtDJHqgR1dZB7Gb6V/d55FL26/lYVd0TwMgcOQ==", 137 | "cpu": [ 138 | "ia32" 139 | ], 140 | "optional": true, 141 | "os": [ 142 | "win32" 143 | ], 144 | "engines": { 145 | "node": ">= 10" 146 | } 147 | }, 148 | "node_modules/@next/swc-win32-x64-msvc": { 149 | "version": "14.2.14", 150 | "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.2.14.tgz", 151 | "integrity": "sha512-MZom+OvZ1NZxuRovKt1ApevjiUJTcU2PmdJKL66xUPaJeRywnbGGRWUlaAOwunD6dX+pm83vj979NTC8QXjGWg==", 152 | "cpu": [ 153 | "x64" 154 | ], 155 | "optional": true, 156 | "os": [ 157 | "win32" 158 | ], 159 | "engines": { 160 | "node": ">= 10" 161 | } 162 | }, 163 | "node_modules/@swc/counter": { 164 | "version": "0.1.3", 165 | "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", 166 | "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==" 167 | }, 168 | "node_modules/@swc/helpers": { 169 | "version": "0.5.5", 170 | "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.5.tgz", 171 | "integrity": "sha512-KGYxvIOXcceOAbEk4bi/dVLEK9z8sZ0uBB3Il5b1rhfClSpcX0yfRO0KmTkqR2cnQDymwLB+25ZyMzICg/cm/A==", 172 | "dependencies": { 173 | "@swc/counter": "^0.1.3", 174 | "tslib": "^2.4.0" 175 | } 176 | }, 177 | "node_modules/@types/node": { 178 | "version": "20.16.10", 179 | "resolved": "https://registry.npmjs.org/@types/node/-/node-20.16.10.tgz", 180 | "integrity": "sha512-vQUKgWTjEIRFCvK6CyriPH3MZYiYlNy0fKiEYHWbcoWLEgs4opurGGKlebrTLqdSMIbXImH6XExNiIyNUv3WpA==", 181 | "dev": true, 182 | "dependencies": { 183 | "undici-types": "~6.19.2" 184 | } 185 | }, 186 | "node_modules/@types/prop-types": { 187 | "version": "15.7.13", 188 | "resolved": "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.13.tgz", 189 | "integrity": "sha512-hCZTSvwbzWGvhqxp/RqVqwU999pBf2vp7hzIjiYOsl8wqOmUxkQ6ddw1cV3l8811+kdUFus/q4d1Y3E3SyEifA==", 190 | "dev": true 191 | }, 192 | "node_modules/@types/react": { 193 | "version": "18.3.11", 194 | "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.11.tgz", 195 | "integrity": "sha512-r6QZ069rFTjrEYgFdOck1gK7FLVsgJE7tTz0pQBczlBNUhBNk0MQH4UbnFSwjpQLMkLzgqvBBa+qGpLje16eTQ==", 196 | "dev": true, 197 | "dependencies": { 198 | "@types/prop-types": "*", 199 | "csstype": "^3.0.2" 200 | } 201 | }, 202 | "node_modules/@types/react-dom": { 203 | "version": "18.3.0", 204 | "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.3.0.tgz", 205 | "integrity": "sha512-EhwApuTmMBmXuFOikhQLIBUn6uFg81SwLMOAUgodJF14SOBOCMdU04gDoYi0WOJJHD144TL32z4yDqCW3dnkQg==", 206 | "dev": true, 207 | "dependencies": { 208 | "@types/react": "*" 209 | } 210 | }, 211 | "node_modules/busboy": { 212 | "version": "1.6.0", 213 | "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", 214 | "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", 215 | "dependencies": { 216 | "streamsearch": "^1.1.0" 217 | }, 218 | "engines": { 219 | "node": ">=10.16.0" 220 | } 221 | }, 222 | "node_modules/caniuse-lite": { 223 | "version": "1.0.30001667", 224 | "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001667.tgz", 225 | "integrity": "sha512-7LTwJjcRkzKFmtqGsibMeuXmvFDfZq/nzIjnmgCGzKKRVzjD72selLDK1oPF/Oxzmt4fNcPvTDvGqSDG4tCALw==", 226 | "funding": [ 227 | { 228 | "type": "opencollective", 229 | "url": "https://opencollective.com/browserslist" 230 | }, 231 | { 232 | "type": "tidelift", 233 | "url": "https://tidelift.com/funding/github/npm/caniuse-lite" 234 | }, 235 | { 236 | "type": "github", 237 | "url": "https://github.com/sponsors/ai" 238 | } 239 | ] 240 | }, 241 | "node_modules/client-only": { 242 | "version": "0.0.1", 243 | "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", 244 | "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==" 245 | }, 246 | "node_modules/csstype": { 247 | "version": "3.1.3", 248 | "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", 249 | "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==", 250 | "dev": true 251 | }, 252 | "node_modules/graceful-fs": { 253 | "version": "4.2.11", 254 | "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", 255 | "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==" 256 | }, 257 | "node_modules/js-tokens": { 258 | "version": "4.0.0", 259 | "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", 260 | "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" 261 | }, 262 | "node_modules/loose-envify": { 263 | "version": "1.4.0", 264 | "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", 265 | "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", 266 | "dependencies": { 267 | "js-tokens": "^3.0.0 || ^4.0.0" 268 | }, 269 | "bin": { 270 | "loose-envify": "cli.js" 271 | } 272 | }, 273 | "node_modules/nanoid": { 274 | "version": "3.3.7", 275 | "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", 276 | "integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==", 277 | "funding": [ 278 | { 279 | "type": "github", 280 | "url": "https://github.com/sponsors/ai" 281 | } 282 | ], 283 | "bin": { 284 | "nanoid": "bin/nanoid.cjs" 285 | }, 286 | "engines": { 287 | "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" 288 | } 289 | }, 290 | "node_modules/next": { 291 | "version": "14.2.14", 292 | "resolved": "https://registry.npmjs.org/next/-/next-14.2.14.tgz", 293 | "integrity": "sha512-Q1coZG17MW0Ly5x76shJ4dkC23woLAhhnDnw+DfTc7EpZSGuWrlsZ3bZaO8t6u1Yu8FVfhkqJE+U8GC7E0GLPQ==", 294 | "dependencies": { 295 | "@next/env": "14.2.14", 296 | "@swc/helpers": "0.5.5", 297 | "busboy": "1.6.0", 298 | "caniuse-lite": "^1.0.30001579", 299 | "graceful-fs": "^4.2.11", 300 | "postcss": "8.4.31", 301 | "styled-jsx": "5.1.1" 302 | }, 303 | "bin": { 304 | "next": "dist/bin/next" 305 | }, 306 | "engines": { 307 | "node": ">=18.17.0" 308 | }, 309 | "optionalDependencies": { 310 | "@next/swc-darwin-arm64": "14.2.14", 311 | "@next/swc-darwin-x64": "14.2.14", 312 | "@next/swc-linux-arm64-gnu": "14.2.14", 313 | "@next/swc-linux-arm64-musl": "14.2.14", 314 | "@next/swc-linux-x64-gnu": "14.2.14", 315 | "@next/swc-linux-x64-musl": "14.2.14", 316 | "@next/swc-win32-arm64-msvc": "14.2.14", 317 | "@next/swc-win32-ia32-msvc": "14.2.14", 318 | "@next/swc-win32-x64-msvc": "14.2.14" 319 | }, 320 | "peerDependencies": { 321 | "@opentelemetry/api": "^1.1.0", 322 | "@playwright/test": "^1.41.2", 323 | "react": "^18.2.0", 324 | "react-dom": "^18.2.0", 325 | "sass": "^1.3.0" 326 | }, 327 | "peerDependenciesMeta": { 328 | "@opentelemetry/api": { 329 | "optional": true 330 | }, 331 | "@playwright/test": { 332 | "optional": true 333 | }, 334 | "sass": { 335 | "optional": true 336 | } 337 | } 338 | }, 339 | "node_modules/picocolors": { 340 | "version": "1.1.0", 341 | "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", 342 | "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==" 343 | }, 344 | "node_modules/postcss": { 345 | "version": "8.4.31", 346 | "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", 347 | "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", 348 | "funding": [ 349 | { 350 | "type": "opencollective", 351 | "url": "https://opencollective.com/postcss/" 352 | }, 353 | { 354 | "type": "tidelift", 355 | "url": "https://tidelift.com/funding/github/npm/postcss" 356 | }, 357 | { 358 | "type": "github", 359 | "url": "https://github.com/sponsors/ai" 360 | } 361 | ], 362 | "dependencies": { 363 | "nanoid": "^3.3.6", 364 | "picocolors": "^1.0.0", 365 | "source-map-js": "^1.0.2" 366 | }, 367 | "engines": { 368 | "node": "^10 || ^12 || >=14" 369 | } 370 | }, 371 | "node_modules/prettier": { 372 | "version": "3.3.3", 373 | "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", 374 | "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", 375 | "dev": true, 376 | "bin": { 377 | "prettier": "bin/prettier.cjs" 378 | }, 379 | "engines": { 380 | "node": ">=14" 381 | }, 382 | "funding": { 383 | "url": "https://github.com/prettier/prettier?sponsor=1" 384 | } 385 | }, 386 | "node_modules/react": { 387 | "version": "18.3.1", 388 | "resolved": "https://registry.npmjs.org/react/-/react-18.3.1.tgz", 389 | "integrity": "sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==", 390 | "dependencies": { 391 | "loose-envify": "^1.1.0" 392 | }, 393 | "engines": { 394 | "node": ">=0.10.0" 395 | } 396 | }, 397 | "node_modules/react-dom": { 398 | "version": "18.3.1", 399 | "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", 400 | "integrity": "sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw==", 401 | "dependencies": { 402 | "loose-envify": "^1.1.0", 403 | "scheduler": "^0.23.2" 404 | }, 405 | "peerDependencies": { 406 | "react": "^18.3.1" 407 | } 408 | }, 409 | "node_modules/scheduler": { 410 | "version": "0.23.2", 411 | "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", 412 | "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", 413 | "dependencies": { 414 | "loose-envify": "^1.1.0" 415 | } 416 | }, 417 | "node_modules/source-map-js": { 418 | "version": "1.2.1", 419 | "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", 420 | "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", 421 | "engines": { 422 | "node": ">=0.10.0" 423 | } 424 | }, 425 | "node_modules/streamsearch": { 426 | "version": "1.1.0", 427 | "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", 428 | "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", 429 | "engines": { 430 | "node": ">=10.0.0" 431 | } 432 | }, 433 | "node_modules/styled-jsx": { 434 | "version": "5.1.1", 435 | "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz", 436 | "integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==", 437 | "dependencies": { 438 | "client-only": "0.0.1" 439 | }, 440 | "engines": { 441 | "node": ">= 12.0.0" 442 | }, 443 | "peerDependencies": { 444 | "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0" 445 | }, 446 | "peerDependenciesMeta": { 447 | "@babel/core": { 448 | "optional": true 449 | }, 450 | "babel-plugin-macros": { 451 | "optional": true 452 | } 453 | } 454 | }, 455 | "node_modules/tslib": { 456 | "version": "2.7.0", 457 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", 458 | "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" 459 | }, 460 | "node_modules/typescript": { 461 | "version": "5.6.2", 462 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.2.tgz", 463 | "integrity": "sha512-NW8ByodCSNCwZeghjN3o+JX5OFH0Ojg6sadjEKY4huZ52TqbJTJnDo5+Tw98lSy63NZvi4n+ez5m2u5d4PkZyw==", 464 | "dev": true, 465 | "bin": { 466 | "tsc": "bin/tsc", 467 | "tsserver": "bin/tsserver" 468 | }, 469 | "engines": { 470 | "node": ">=14.17" 471 | } 472 | }, 473 | "node_modules/undici-types": { 474 | "version": "6.19.8", 475 | "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", 476 | "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", 477 | "dev": true 478 | } 479 | } 480 | } 481 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "azure-openai-proxy", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint", 10 | "format": "prettier --write '**/*.{ts,tsx,js,json,md}'" 11 | }, 12 | "dependencies": { 13 | "next": "^14.2.0", 14 | "react": "^18", 15 | "react-dom": "^18" 16 | }, 17 | "devDependencies": { 18 | "@types/node": "^20", 19 | "@types/react": "^18", 20 | "@types/react-dom": "^18", 21 | "prettier": "^3", 22 | "typescript": "^5" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | --------------------------------------------------------------------------------