adorable-bear-14321
02/17/2026, 11:22 AMtall-airline-16756
02/17/2026, 11:22 AMtall-airline-16756
02/17/2026, 11:23 AMrealtime.with_azure.
You control the Azure model by setting the azure_deployment parameter when creating the RealtimeModel. That value should be the name of the deployment you created in your Azure OpenAI resource (for example, a deployment using a GPT-4o-based realtime-capable model).
Example (Python):
from livekit.plugins import openai
session = AgentSession(
llm=openai.realtime.RealtimeModel.with_azure(
azure_deployment="<your-deployment-name>", # e.g., "gpt-4o-realtime"
azure_endpoint="wss://<your-endpoint>.<http://openai.azure.com/|openai.azure.com/>",
api_key="<your-api-key>",
api_version="2024-10-01-preview",
),
)
Key points to check:
• Deployment name: Use the exact deployment name you created in Azure — that’s what azure_deployment should match.
• Model capability: Make sure the Azure deployment uses a model version that supports Realtime/Realtime audio (for example, a GPT-4o realtime-compatible deployment).
• Endpoint & version: Use your Azure realtime WebSocket endpoint and the matching API version (example above shows 2024-10-01-preview).
If you’d like, tell me:
• the deployment name you want to switch to (or the model name), and
• whether you’re using the Python example above or another SDK/language,
and I’ll give the exact code snippet or show how to change any other realtime options (voice, modalities, or turn_detection) to match that deployment.
Sources: Azure OpenAI Realtime API and LiveKit | LiveKit Documentation