Skip to main content
LibreChat is joining ClickHouse to power the open-source Agentic Data Stack 🎉 Learn more
LibreChat

Struktur Objek Azure OpenAI

Mengintegrasikan Azure OpenAI Service dengan aplikasi Anda memungkinkan Anda untuk memanfaatkan beberapa deployment dan model wilayah yang dihosting oleh Azure OpenAI secara mulus. Bagian ini merinci cara mengonfigurasi endpoint Azure OpenAI untuk kebutuhan Anda.

Untuk panduan terperinci mengenai pengaturan konfigurasi Azure OpenAI, klik di sini

Contoh Konfigurasi

endpoints:
  azureOpenAI:
    titleModel: "gpt-4-turbo"
    groups:
      - group: "my-westus" # arbitrary name
        apiKey: "${WESTUS_API_KEY}"
        instanceName: "actual-instance-name" # name of the resource group or instance
        version: "2023-12-01-preview"
        # baseURL: https://prod.example.com
        # additionalHeaders:
        #   X-Custom-Header: value
        models:
          gpt-4-vision-preview:
            deploymentName: gpt-4-vision-preview
            version: "2024-02-15-preview"
          gpt-3.5-turbo:
            deploymentName: gpt-35-turbo
          gpt-3.5-turbo-1106:
            deploymentName: gpt-35-turbo-1106
          gpt-4:
            deploymentName: gpt-4
          gpt-4-1106-preview:
            deploymentName: gpt-4-1106-preview
      - group: "my-eastus"
        apiKey: "${EASTUS_API_KEY}"
        instanceName: "actual-eastus-instance-name"
        deploymentName: gpt-4-turbo
        version: "2024-02-15-preview"
        baseURL: "https://gateway.ai.cloudflare.com/v1/cloudflareId/azure/azure-openai/${INSTANCE_NAME}/${DEPLOYMENT_NAME}" # uses env variables
        additionalHeaders:
          X-Custom-Header: value
        models:
          gpt-4-turbo: true

Catatan: Azure OpenAI endpoint mendukung semua Shared Endpoint Settings, termasuk streamRate, titleModel, titleMethod, titlePrompt, titlePromptTemplate, dan titleEndpoint.

assistants

Kunci:

KeyTypeDescriptionExample
assistantsBooleanMengaktifkan atau menonaktifkan asisten untuk endpoint Azure OpenAI. Jika diatur ke `true`, akan mengaktifkan asisten yang terkait dengan endpoint ini.Choose one, either the official OpenAI API or Azure OpenAI API for assistants, not both.

Default: Tidak ditentukan

Contoh:

assistants: true

groups

Kunci:

KeyTypeDescriptionExample
groupsArrayKonfigurasi untuk grup model berdasarkan lokasi geografis atau tujuan. Setiap item dalam array `groups` mengonfigurasi sekumpulan model di bawah pengelompokan tertentu, sering kali berdasarkan wilayah geografis atau konfigurasi yang berbeda.

Default: Tidak ditentukan

Catatan: Lihat contoh di atas.

Struktur Objek Grup

Setiap item di bawah groups merupakan bagian dari daftar catatan, masing-masing dengan kolom berikut:

group

Kunci:

KeyTypeDescriptionExample
groupStringPengenal untuk sekelompok model.

Wajib: ya

Contoh:

"group": "my-westus"

apiKey

Kunci:

KeyTypeDescriptionExample
apiKeyStringKunci API untuk mengakses Azure OpenAI Service.It's highly recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Wajib: ya

Contoh:

apiKey: "${WESTUS_API_KEY}"

instanceName

Kunci:

KeyTypeDescriptionExample
instanceNameStringNama instance Azure. **Mendukung kedua format domain**: `.openai.azure.com` (lama) dan `.cognitiveservices.azure.com` (baru). Anda dapat menentukan domain lengkap (contoh: `my-instance.cognitiveservices.azure.com`) atau hanya nama instance (contoh: `my-instance`) untuk kompatibilitas mundur dengan format `.openai.azure.com` yang lama.It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Wajib: ya

Contoh:

# Using just the instance name (legacy format applied)
instanceName: "my-westus"
# OR using the full domain (new format)
instanceName: "my-westus.cognitiveservices.azure.com"

version

Kunci:

KeyTypeDescriptionExample
versionStringVersi API.It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Default: Tidak ditentukan

Contoh:

version: "2023-12-01-preview"

baseURL

Kunci:

KeyTypeDescriptionExample
baseURLStringURL dasar untuk Azure OpenAI Service.It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Default: Tidak ditentukan

Contoh:

baseURL: "https://prod.example.com"

additionalHeaders

Kunci:

KeyTypeDescriptionExample
additionalHeadersDictionaryHeader tambahan untuk permintaan API. Semua nilai header harus berupa string.It's recommended to use a custom env. variable reference for the values of field, as shown in the example. `api-key` header value is sent on every request.

Default: Tidak ditentukan

Contoh:

additionalHeaders:
  X-Custom-Header: ${YOUR_SECRET_CUSTOM_VARIABLE}

serverless

Kunci:

KeyTypeDescriptionExample
serverlessBooleanMenunjukkan penggunaan endpoint inferensi serverless untuk chat completions Azure OpenAI. Jika diatur ke `true`, menentukan bahwa grup tersebut dikonfigurasi untuk menggunakan endpoint inferensi serverless sebagai model "Models as a Service" Azure.More info [here](../ai_endpoints/azure.mdx#serverless-inference-endpoints)

Default: Tidak ditentukan

Contoh:

serverless: true

addParams

Kunci:

KeyTypeDescriptionExample
addParamsObject/DictionaryMenambahkan parameter tambahan ke permintaan. Berguna untuk menentukan opsi khusus API.

Default: Tidak ditentukan

Contoh:

addParams:
  safe_prompt: true

dropParams

Kunci:

KeyTypeDescriptionExample
dropParamsArray/List of StringsMenghapus parameter default dari permintaan. Mengecualikan parameter default yang ditentukan.Default parameters are the standard request parameters LibreChat sends to the Azure OpenAI API.

Default: Tidak ditentukan

Contoh:

dropParams: ["stop", "user", "frequency_penalty", "presence_penalty"]

models

Kunci:

KeyTypeDescriptionExample
modelsKonfigurasi untuk model individu dalam sebuah grup. Mengonfigurasi pengaturan untuk setiap model, termasuk nama deployment dan versi.Model configurations can adopt the group's deployment name and/or version when configured as a boolean (set to `true`) or an object for detailed settings of either of those fields.

Default: Tidak ditentukan

Contoh:

models:
  gpt-4-vision-preview: 
    deploymentName: "arbitrary-deployment-name"
    version: "2024-02-15-preview"

Bagaimana panduan ini?