跳至主要內容

Azure OpenAI

總覽

屬性詳細資訊
說明Azure OpenAI Service 提供 REST API 存取 OpenAI 強大的語言模型,包括 o1、o1-mini、GPT-5、GPT-4o、GPT-4o mini、GPT-4 Turbo with Vision、GPT-4、GPT-3.5-Turbo,以及 Embeddings 模型系列。也透過 Azure Foundry 支援 Claude 模型。
LiteLLM 提供者路由azure/, azure/o_series/, azure/gpt5_series/, azure/claude-*(透過 Azure Foundry 的 Claude 模型)
支援的操作/chat/completions, /responses, /completions, /embeddings, /audio/speech, /audio/transcriptions, /fine_tuning, /batches, /files, /images, /anthropic/v1/messages
提供者文件連結Azure OpenAI ↗, Azure Foundry Claude ↗

API 金鑰、參數

api_key、api_base、api_version 等可以直接傳遞給 litellm.completion - 請參見此處,或將其設為 litellm.api_key 參數,請參見此處

import os
os.environ["AZURE_API_KEY"] = "" # "my-azure-api-key"
os.environ["AZURE_API_BASE"] = "" # "https://example-endpoint.openai.azure.com"
os.environ["AZURE_API_VERSION"] = "" # "2023-05-15"

# optional
os.environ["AZURE_AD_TOKEN"] = ""
os.environ["AZURE_API_TYPE"] = ""
Azure Foundry Claude Models

Azure 也透過 Azure Foundry 支援 Claude 模型。請使用 azure/claude-* 模型名稱(例如 azure/claude-sonnet-4-5)並搭配 Azure 驗證。詳情請參見 Azure Anthropic 文件

使用方式 - LiteLLM Python SDK

在 Colab 中開啟

Completion - 使用 .env 變數

from litellm import completion

## set ENV variables
os.environ["AZURE_API_KEY"] = ""
os.environ["AZURE_API_BASE"] = ""
os.environ["AZURE_API_VERSION"] = ""

# azure call
response = completion(
model = "azure/<your_deployment_name>",
messages = [{ "content": "Hello, how are you?","role": "user"}]
)

Completion - 使用 api_key、api_base、api_version

import litellm

# azure call
response = litellm.completion(
model = "azure/<your deployment name>", # model = azure/<your deployment name>
api_base = "", # azure api base
api_version = "", # azure api version
api_key = "", # azure api key
messages = [{"role": "user", "content": "good morning"}],
)

Completion - 使用 azure_ad_token、api_base、api_version

import litellm

# azure call
response = litellm.completion(
model = "azure/<your deployment name>", # model = azure/<your deployment name>
api_base = "", # azure api base
api_version = "", # azure api version
azure_ad_token="", # azure_ad_token
messages = [{"role": "user", "content": "good morning"}],
)

使用方式 - LiteLLM Proxy Server

以下說明如何使用 LiteLLM Proxy Server 呼叫 Azure OpenAI 模型

1. 將金鑰儲存在您的環境中

export AZURE_API_KEY=""

2. 啟動 proxy

model_list:
- model_name: gpt-3.5-turbo
litellm_params:
model: azure/chatgpt-v-2
api_base: https://openai-gpt-4-test-v-1.openai.azure.com/
api_version: "2023-05-15"
api_key: os.environ/AZURE_API_KEY # The `os.environ/` prefix tells litellm to read this from the env.

3. 測試它

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data ' {
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "what llm are you"
}
]
}
'

設定 API 版本

您可以透過以下方式在 proxy config.yaml 中設定 Azure OpenAI 的 api_version

選項 1:每個模型的設定

config.yaml
model_list:
- model_name: gpt-4
litellm_params:
model: azure/my-gpt4-deployment
api_base: https://your-resource.openai.azure.com/
api_version: "2024-08-01-preview" # Set version per model
api_key: os.environ/AZURE_API_KEY

Azure OpenAI Chat Completion 模型

提示

我們支援所有 Azure 模型,只要在送出 litellm 請求時將 model=azure/<your deployment name> 設為前綴即可

模型名稱函式呼叫
o1-miniresponse = completion(model="azure/<your deployment name>", messages=messages)
o1-previewresponse = completion(model="azure/<your deployment name>", messages=messages)
gpt-5response = completion(model="azure/<your deployment name>", messages=messages)
gpt-4o-minicompletion('azure/<your deployment name>', messages)
gpt-4ocompletion('azure/<your deployment name>', messages)
gpt-4completion('azure/<your deployment name>', messages)
gpt-4-0314completion('azure/<your deployment name>', messages)
gpt-4-0613completion('azure/<your deployment name>', messages)
gpt-4-32kcompletion('azure/<your deployment name>', messages)
gpt-4-32k-0314completion('azure/<your deployment name>', messages)
gpt-4-32k-0613completion('azure/<your deployment name>', messages)
gpt-4-1106-previewcompletion('azure/<your deployment name>', messages)
gpt-4-0125-previewcompletion('azure/<your deployment name>', messages)
gpt-3.5-turbocompletion('azure/<your deployment name>', messages)
gpt-3.5-turbo-0301completion('azure/<your deployment name>', messages)
gpt-3.5-turbo-0613completion('azure/<your deployment name>', messages)
gpt-3.5-turbo-16kcompletion('azure/<your deployment name>', messages)
gpt-3.5-turbo-16k-0613completion('azure/<your deployment name>', messages)

Azure OpenAI Vision 模型

模型名稱函式呼叫
gpt-4-visioncompletion(model="azure/<your deployment name>", messages=messages)
gpt-4ocompletion('azure/<your deployment name>', messages)

使用方式

import os 
from litellm import completion

os.environ["AZURE_API_KEY"] = "your-api-key"

# azure call
response = completion(
model = "azure/<your deployment name>",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "What’s in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://awsmp-logos.s3.amazonaws.com/seller-xw5kijmvmzasy/c233c9ade2ccb5491072ae232c814942.png"
}
}
]
}
],
)

使用方式 - 搭配 Azure Vision 增強功能

注意:Azure 需要將 base_url 設定為 /extensions

範例

base_url=https://gpt-4-vision-resource.openai.azure.com/openai/deployments/gpt-4-vision/extensions
# base_url="{azure_endpoint}/openai/deployments/{azure_deployment}/extensions"

使用方式

import os 
from litellm import completion

os.environ["AZURE_API_KEY"] = "your-api-key"

# azure call
response = completion(
model="azure/gpt-4-vision",
timeout=5,
messages=[
{
"role": "user",
"content": [
{"type": "text", "text": "Whats in this image?"},
{
"type": "image_url",
"image_url": {
"url": "https://avatars.githubusercontent.com/u/29436595?v=4"
},
},
],
}
],
base_url="https://gpt-4-vision-resource.openai.azure.com/openai/deployments/gpt-4-vision/extensions",
api_key=os.getenv("AZURE_VISION_API_KEY"),
enhancements={"ocr": {"enabled": True}, "grounding": {"enabled": True}},
dataSources=[
{
"type": "AzureComputerVision",
"parameters": {
"endpoint": "https://gpt-4-vision-enhancement.cognitiveservices.azure.com/",
"key": os.environ["AZURE_VISION_ENHANCE_KEY"],
},
}
],
)

O-Series 模型

LiteLLM 支援 Azure OpenAI O-Series 模型。

LiteLLM 會將任何模型名稱中包含 o1o3 的部署名稱,路由到 O-Series 轉換 邏輯。

若要明確設定,請將 model 設為 azure/o_series/<your-deployment-name>

自動路由

import litellm

litellm.completion(model="azure/my-o3-deployment", messages=[{"role": "user", "content": "Hello, world!"}]) # 👈 Note: 'o3' in the deployment name

明確路由

import litellm

litellm.completion(model="azure/o_series/my-random-deployment-name", messages=[{"role": "user", "content": "Hello, world!"}]) # 👈 Note: 'o_series/' in the deployment name

GPT-5 模型

屬性詳細資訊
說明Azure OpenAI GPT-5 models
LiteLLM 提供者路由azure/gpt5_series/<custom-name> or azure/gpt-5-deployment-name

LiteLLM 支援以下兩種方式使用 Azure GPT-5 模型:

  1. 明確路由:model = azure/gpt5_series/<deployment-name>。在此情況下,導入 litellm 的模型格式為 model=azure/gpt5_series/<deployment-name>
  2. 推斷路由(如果 azure 部署名稱中包含 gpt-5):model = azure/gpt-5-mini。在此情況下,導入 litellm 的模型格式為 model=azure/gpt-5-mini

明確路由

請使用 azure/gpt5_series/<deployment-name> 進行明確的 GPT-5 模型路由。

import litellm

response = litellm.completion(
model="azure/gpt5_series/my-gpt-5-deployment",
messages=[{"role": "user", "content": "Hello, world!"}]
)

推斷路由(部署名稱中包含 gpt-5)

如果您的 Azure 部署名稱包含 gpt-5,LiteLLM 會自動將其辨識為 GPT-5 模型。

import litellm

# Deployment name contains 'gpt-5' - automatically inferred
response = litellm.completion(
model="azure/my-gpt-5-deployment",
messages=[{"role": "user", "content": "Hello, world!"}]
)

Azure 音訊模型

from litellm import completion
import os

os.environ["AZURE_API_KEY"] = ""
os.environ["AZURE_API_BASE"] = ""
os.environ["AZURE_API_VERSION"] = ""

response = completion(
model="azure/azure-openai-4o-audio",
messages=[
{
"role": "user",
"content": "I want to try out speech to speech"
}
],
modalities=["text","audio"],
audio={"voice": "alloy", "format": "wav"}
)

print(response)

Azure Instruct 模型

請使用 model="azure_text/<your-deployment>"

模型名稱函式呼叫
gpt-3.5-turbo-instructresponse = completion(model="azure_text/<your deployment name>", messages=messages)
gpt-3.5-turbo-instruct-0914response = completion(model="azure_text/<your deployment name>", messages=messages)
import litellm

## set ENV variables
os.environ["AZURE_API_KEY"] = ""
os.environ["AZURE_API_BASE"] = ""
os.environ["AZURE_API_VERSION"] = ""

response = litellm.completion(
model="azure_text/<your-deployment-name",
messages=[{"role": "user", "content": "What is the weather like in Boston?"}]
)

print(response)

驗證

Entra ID - 使用 azure_ad_token

這是一個關於如何使用 Azure Active Directory Tokens - Microsoft Entra ID 來進行 litellm.completion() 呼叫的操作說明。

注意: 您可以遵循下方相同步驟,使用 Azure Active Directory Tokens 搭配 LiteLLM 來處理所有其他 Azure 端點(例如 chat、embeddings、image、audio 等)。

Step 1 - 下載 Azure CLI 安裝說明: https://learn.microsoft.com/en-us/cli/azure/install-azure-cli

brew update && brew install azure-cli

步驟 2 - 使用 az 登入

az login --output table

步驟 3 - 產生 azure ad token

az account get-access-token --resource https://cognitiveservices.azure.com

在這個步驟中,您應該會看到已產生一個 accessToken

{
"accessToken": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlHbW55RlBraGMzaE91UjIybXZTdmduTG83WSIsImtpZCI6IjlHbW55RlBraGMzaE91UjIybXZTdmduTG83WSJ9",
"expiresOn": "2023-11-14 15:50:46.000000",
"expires_on": 1700005846,
"subscription": "db38de1f-4bb3..",
"tenant": "bdfd79b3-8401-47..",
"tokenType": "Bearer"
}

步驟 4 - 使用 Azure AD token 進行 litellm.completion 請求

設定 azure_ad_token = accessToken(來自步驟 3)或設定 os.environ['AZURE_AD_TOKEN']

response = litellm.completion(
model = "azure/<your deployment name>", # model = azure/<your deployment name>
api_base = "", # azure api base
api_version = "", # azure api version
azure_ad_token="", # your accessToken from step 3
messages = [{"role": "user", "content": "good morning"}],
)

Entra ID - 使用 tenant_id、client_id、client_secret

以下是將 tenant_idclient_idclient_secret 設定到您的 litellm proxy config.yaml 的範例

model_list:
- model_name: gpt-3.5-turbo
litellm_params:
model: azure/chatgpt-v-2
api_base: https://openai-gpt-4-test-v-1.openai.azure.com/
api_version: "2023-05-15"
tenant_id: os.environ/AZURE_TENANT_ID
client_id: os.environ/AZURE_CLIENT_ID
client_secret: os.environ/AZURE_CLIENT_SECRET
azure_scope: os.environ/AZURE_SCOPE # defaults to "https://cognitiveservices.azure.com/.default"

測試它

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data ' {
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "what llm are you"
}
]
}
'

使用 tenant_idclient_idclient_secret 搭配 LiteLLM Proxy Server 的示範影片

Entra ID - 使用 client_id、username、password

以下是將 client_idazure_usernameazure_password 設定到您的 litellm proxy config.yaml 的範例

model_list:
- model_name: gpt-3.5-turbo
litellm_params:
model: azure/chatgpt-v-2
api_base: https://openai-gpt-4-test-v-1.openai.azure.com/
api_version: "2023-05-15"
client_id: os.environ/AZURE_CLIENT_ID
azure_username: os.environ/AZURE_USERNAME
azure_password: os.environ/AZURE_PASSWORD
azure_scope: os.environ/AZURE_SCOPE # defaults to "https://cognitiveservices.azure.com/.default"

測試它

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data ' {
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "user",
"content": "what llm are you"
}
]
}
'

Azure AD 權杖重新整理 - DefaultAzureCredential

如果您想在請求上使用 Azure DefaultAzureCredential 進行驗證,請使用此項。DefaultAzureCredential 會自動從多個來源探索並使用可用的 Azure 憑證。

選項 1:明確指定 DefaultAzureCredential(建議)

from litellm import completion
from azure.identity import DefaultAzureCredential, get_bearer_token_provider

# DefaultAzureCredential automatically discovers credentials from:
# - Environment variables (AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID)
# - Managed Identity (AKS, Azure VMs, etc.)
# - Azure CLI credentials
# - And other Azure identity sources
token_provider = get_bearer_token_provider(DefaultAzureCredential(), "https://cognitiveservices.azure.com/.default")

response = completion(
model = "azure/<your deployment name>", # model = azure/<your deployment name>
api_base = "", # azure api base
api_version = "", # azure api version
azure_ad_token_provider=token_provider,
messages = [{"role": "user", "content": "good morning"}],
)

選項 2:LiteLLM 自動回退到 DefaultAzureCredential

import litellm

# Enable automatic fallback to DefaultAzureCredential
litellm.enable_azure_ad_token_refresh = True

response = litellm.completion(
model = "azure/<your deployment name>",
api_base = "",
api_version = "",
messages = [{"role": "user", "content": "good morning"}],
)

Azure Batches API

屬性詳細資訊
說明Azure OpenAI Batches API
LiteLLM 上的 custom_llm_providerazure/
支援的操作/v1/batches/v1/files
Azure OpenAI Batches APIAzure OpenAI Batches API ↗
成本追蹤、記錄支援✅ LiteLLM 會記錄、追蹤 Batch API 請求的成本

快速開始

只要將 azure 環境變數加入您的環境中即可。

export AZURE_API_KEY=""
export AZURE_API_BASE=""

1. 上傳檔案

from openai import OpenAI

# Initialize the client
client = OpenAI(
base_url="http://localhost:4000",
api_key="your-api-key"
)

batch_input_file = client.files.create(
file=open("mydata.jsonl", "rb"),
purpose="batch",
extra_headers={"custom-llm-provider": "azure"}
)
file_id = batch_input_file.id

檔案格式範例

{"custom_id": "task-0", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was Microsoft founded?"}]}}
{"custom_id": "task-1", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was the first XBOX released?"}]}}
{"custom_id": "task-2", "method": "POST", "url": "/chat/completions", "body": {"model": "REPLACE-WITH-MODEL-DEPLOYMENT-NAME", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "What is Altair Basic?"}]}}

2. 建立 Batch 請求

batch = client.batches.create( # re use client from above
input_file_id=file_id,
endpoint="/v1/chat/completions",
completion_window="24h",
metadata={"description": "My batch job"},
extra_headers={"custom-llm-provider": "azure"}
)

3. 取得 Batch

retrieved_batch = client.batches.retrieve(
batch.id,
extra_headers={"custom-llm-provider": "azure"}
)

4. 取消 Batch

cancelled_batch = client.batches.cancel(
batch.id,
extra_headers={"custom-llm-provider": "azure"}
)

5. 列出 Batch

client.batches.list(extra_headers={"custom-llm-provider": "azure"})

健康檢查 Azure Batch models

[BETA] 對多個 Azure 部署進行負載平衡

在您的 config.yaml 中,設定 enable_loadbalancing_on_batch_endpoints: true

model_list:
- model_name: "batch-gpt-4o-mini"
litellm_params:
model: "azure/gpt-4o-mini"
api_key: os.environ/AZURE_API_KEY
api_base: os.environ/AZURE_API_BASE
model_info:
mode: batch

litellm_settings:
enable_loadbalancing_on_batch_endpoints: true # 👈 KEY CHANGE

注意:這可在 {PROXY_BASE_URL}/v1/files{PROXY_BASE_URL}/v1/batches 上運作。 注意:回應為 OpenAI 格式。

  1. 上傳檔案

只要在您的 .jsonl 中設定 model: batch-gpt-4o-mini 即可。

curl http://localhost:4000/v1/files \
-H "Authorization: Bearer sk-1234" \
-F purpose="batch" \
-F file="@mydata.jsonl"

檔案範例

注意:model 應該是您的 azure 部署名稱。

{"custom_id": "task-0", "method": "POST", "url": "/chat/completions", "body": {"model": "batch-gpt-4o-mini", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was Microsoft founded?"}]}}
{"custom_id": "task-1", "method": "POST", "url": "/chat/completions", "body": {"model": "batch-gpt-4o-mini", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "When was the first XBOX released?"}]}}
{"custom_id": "task-2", "method": "POST", "url": "/chat/completions", "body": {"model": "batch-gpt-4o-mini", "messages": [{"role": "system", "content": "You are an AI assistant that helps people find information."}, {"role": "user", "content": "What is Altair Basic?"}]}}

預期回應(相容 OpenAI)

{"id":"file-f0be81f654454113a922da60acb0eea6",...}
  1. 建立 batch
curl http://0.0.0.0:4000/v1/batches \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input_file_id": "file-f0be81f654454113a922da60acb0eea6",
"endpoint": "/v1/chat/completions",
"completion_window": "24h",
"model: "batch-gpt-4o-mini"
}'

預期回應:

{"id":"batch_94e43f0a-d805-477d-adf9-bbb9c50910ed",...}
  1. 取得 batch
curl http://0.0.0.0:4000/v1/batches/batch_94e43f0a-d805-477d-adf9-bbb9c50910ed \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json" \

預期回應:

{"id":"batch_94e43f0a-d805-477d-adf9-bbb9c50910ed",...}
  1. 列出 batch
curl http://0.0.0.0:4000/v1/batches?limit=2 \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-H "Content-Type: application/json"

預期回應:

{"data":[{"id":"batch_R3V...}

進階

Azure API 負載平衡

如果您要在多個 Azure/OpenAI 部署之間進行負載平衡,請使用此項。

Router 會透過選擇低於速率限制且已使用 token 數量最少的部署,來避免請求失敗。

在正式環境中,Router 會連接到 Redis 快取 以追蹤多個部署之間的使用量。

快速開始

uv add litellm
from litellm import Router

model_list = [{ # list of model deployments
"model_name": "gpt-3.5-turbo", # openai model name
"litellm_params": { # params for litellm completion/embedding call
"model": "azure/chatgpt-v-2",
"api_key": os.getenv("AZURE_API_KEY"),
"api_version": os.getenv("AZURE_API_VERSION"),
"api_base": os.getenv("AZURE_API_BASE")
},
"tpm": 240000,
"rpm": 1800
}, {
"model_name": "gpt-3.5-turbo", # openai model name
"litellm_params": { # params for litellm completion/embedding call
"model": "azure/chatgpt-functioncalling",
"api_key": os.getenv("AZURE_API_KEY"),
"api_version": os.getenv("AZURE_API_VERSION"),
"api_base": os.getenv("AZURE_API_BASE")
},
"tpm": 240000,
"rpm": 1800
}, {
"model_name": "gpt-3.5-turbo", # openai model name
"litellm_params": { # params for litellm completion/embedding call
"model": "gpt-3.5-turbo",
"api_key": os.getenv("OPENAI_API_KEY"),
},
"tpm": 1000000,
"rpm": 9000
}]

router = Router(model_list=model_list)

# openai.chat.completions.create replacement
response = router.completion(model="gpt-3.5-turbo",
messages=[{"role": "user", "content": "Hey, how's it going?"}]

print(response)

Redis 佇列

router = Router(model_list=model_list, 
redis_host=os.getenv("REDIS_HOST"),
redis_password=os.getenv("REDIS_PASSWORD"),
redis_port=os.getenv("REDIS_PORT"))

print(response)

工具呼叫 / Function Calling

請參閱 litellm 平行 function calling 的詳細逐步說明 這裡

# set Azure env variables
import os
import litellm
import json

os.environ['AZURE_API_KEY'] = "" # litellm reads AZURE_API_KEY from .env and sends the request
os.environ['AZURE_API_BASE'] = "https://openai-gpt-4-test-v-1.openai.azure.com/"
os.environ['AZURE_API_VERSION'] = "2023-07-01-preview"

tools = [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA",
},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]},
},
"required": ["location"],
},
},
}
]

response = litellm.completion(
model="azure/chatgpt-functioncalling", # model = azure/<your-azure-deployment-name>
messages=[{"role": "user", "content": "What's the weather like in San Francisco, Tokyo, and Paris?"}],
tools=tools,
tool_choice="auto", # auto is default, but we'll be explicit
)
print("\nLLM Response1:\n", response)
response_message = response.choices[0].message
tool_calls = response.choices[0].message.tool_calls
print("\nTool Choice:\n", tool_calls)

Azure OpenAI 模型的支出追蹤(PROXY)

設定 base model 以進行成本追蹤 azure image-gen 呼叫

影像生成

model_list: 
- model_name: dall-e-3
litellm_params:
model: azure/dall-e-3-test
api_version: 2023-06-01-preview
api_base: https://openai-gpt-4-test-v-1.openai.azure.com/
api_key: os.environ/AZURE_API_KEY
base_model: dall-e-3 # 👈 set dall-e-3 as base model
model_info:
mode: image_generation

聊天完成 / Embeddings

問題:當使用 azure/gpt-4-1106-preview 時,Azure 會在回應中回傳 gpt-4。這會導致成本追蹤不準確

解決方案 ✅:在您的 config 中設定 base_model,讓 litellm 使用正確的模型來計算 azure 成本

這裡取得 base model 名稱

含有 base_model 的範例設定

model_list:
- model_name: azure-gpt-3.5
litellm_params:
model: azure/chatgpt-v-2
api_base: os.environ/AZURE_API_BASE
api_key: os.environ/AZURE_API_KEY
api_version: "2023-07-01-preview"
model_info:
base_model: azure/gpt-4-1106-preview