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

Azure OpenAI Objectstructuur

Door Azure OpenAI Service te integreren met uw applicatie kunt u naadloos gebruikmaken van meerdere implementaties en regiomodellen die door Azure OpenAI worden gehost. Dit gedeelte beschrijft hoe u het Azure OpenAI endpoint configureert voor uw behoeften.

Voor een gedetailleerde handleiding over het instellen van Azure OpenAI-configuraties, klik hier

Voorbeeldconfiguratie

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

Let op: Het Azure OpenAI endpoint ondersteunt alle Shared Endpoint Settings, inclusief streamRate, titleModel, titleMethod, titlePrompt, titlePromptTemplate en titleEndpoint.

assistants

Sleutel:

KeyTypeDescriptionExample
assistantsBooleanSchakelt assistants in of uit voor het Azure OpenAI endpoint. Indien ingesteld op `true`, worden assistants die aan dit endpoint zijn gekoppeld geactiveerd.Choose one, either the official OpenAI API or Azure OpenAI API for assistants, not both.

Standaard: Niet gespecificeerd

Voorbeeld:

assistants: true

groups

Sleutel:

KeyTypeDescriptionExample
groupsArrayConfiguratie voor groepen modellen op geografische locatie of doel. Elk item in de `groups` array configureert een set modellen onder een bepaalde groepering, vaak per geografische regio of specifieke configuratie.

Standaard: Niet gespecificeerd

Let op: Zie voorbeeld hierboven.

Groepsobjectstructuur

Elk item onder groups maakt deel uit van een lijst met records, elk met de volgende velden:

group

Sleutel:

KeyTypeDescriptionExample
groupStringIdentificatie voor een groep modellen.

Vereist: ja

Voorbeeld:

"group": "my-westus"

apiKey

Sleutel:

KeyTypeDescriptionExample
apiKeyStringDe API-sleutel voor toegang tot de Azure OpenAI Service.It's highly recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Vereist: ja

Voorbeeld:

apiKey: "${WESTUS_API_KEY}"

instanceName

Sleutel:

KeyTypeDescriptionExample
instanceNameStringNaam van de Azure-instantie. **Ondersteunt beide domeinformaten**: `.openai.azure.com` (verouderd) en `.cognitiveservices.azure.com` (nieuw). U kunt het volledige domein opgeven (bijv. `my-instance.cognitiveservices.azure.com`) of alleen de instantienaam (bijv. `my-instance`) voor achterwaartse compatibiliteit met het verouderde `.openai.azure.com`-formaat.It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Vereist: ja

Voorbeeld:

# 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

Sleutel:

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

Standaard: Niet gespecificeerd

Voorbeeld:

version: "2023-12-01-preview"

baseURL

Sleutel:

KeyTypeDescriptionExample
baseURLStringDe basis-URL voor de Azure OpenAI Service.It's recommended to use a custom env. variable reference for this field, i.e. `${YOUR_VARIABLE}`

Standaard: Niet gespecificeerd

Voorbeeld:

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

additionalHeaders

Sleutel:

KeyTypeDescriptionExample
additionalHeadersDictionaryAanvullende headers voor API-verzoeken. Alle headerwaarden moeten strings zijn.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.

Standaard: Niet gespecificeerd

Voorbeeld:

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

serverless

Sleutel:

KeyTypeDescriptionExample
serverlessBooleanGeeft het gebruik van een serverless inference endpoint aan voor Azure OpenAI chat-aanvullingen. Indien ingesteld op `true`, specificeert dit dat de groep is geconfigureerd om serverless inference endpoints te gebruiken als een Azure "Models as a Service" model.More info [here](../ai_endpoints/azure.mdx#serverless-inference-endpoints)

Standaard: Niet gespecificeerd

Voorbeeld:

serverless: true

addParams

Sleutel:

KeyTypeDescriptionExample
addParamsObject/DictionaryVoegt extra parameters toe aan verzoeken. Handig voor het specificeren van API-specifieke opties.

Standaard: Niet gespecificeerd

Voorbeeld:

addParams:
  safe_prompt: true

dropParams

Sleutel:

KeyTypeDescriptionExample
dropParamsArray/List of StringsVerwijdert standaardparameters uit verzoeken. Sluit opgegeven standaardparameters uit.Default parameters are the standard request parameters LibreChat sends to the Azure OpenAI API.

Standaard: Niet gespecificeerd

Voorbeeld:

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

models

Sleutel:

KeyTypeDescriptionExample
modelsConfiguratie voor individuele modellen binnen een groep. Configureert instellingen voor elk model, inclusief implementatienaam en versie.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.

Standaard: Niet gespecificeerd

Voorbeeld:

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

Hoe is deze gids?