From 492c9702ee4de57415e38e397691a5845001bb6d Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 1 May 2026 09:16:52 -0400 Subject: [PATCH 1/3] fix(xai/realtime): pass model as query param on connect xAI's Voice Agent API selects the model via the ?model= query parameter on the WebSocket URL; it cannot be changed later via session.update. The Grok Realtime service was setting the model in Settings but never including it in the connection URL, so every session silently fell back to the deprecated default grok-voice-fast-1.0. Append the model from Settings to the WebSocket URL on connect, and default to the recommended grok-voice-think-fast-1.0. --- src/pipecat/services/xai/realtime/llm.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pipecat/services/xai/realtime/llm.py b/src/pipecat/services/xai/realtime/llm.py index 448b5e339..64c8ebb59 100644 --- a/src/pipecat/services/xai/realtime/llm.py +++ b/src/pipecat/services/xai/realtime/llm.py @@ -17,6 +17,7 @@ from collections.abc import Mapping from dataclasses import dataclass, field from dataclasses import fields as dataclass_fields from typing import Any +from urllib.parse import quote from loguru import logger @@ -235,7 +236,7 @@ class GrokRealtimeLLMService(LLMService): """ # 1. Initialize default_settings with hardcoded defaults default_settings = self.Settings( - model=None, + model="grok-voice-think-fast-1.0", system_instruction=None, temperature=None, max_tokens=None, @@ -533,8 +534,13 @@ class GrokRealtimeLLMService(LLMService): if self._websocket: return + # Model is selected via query param at connection time; xAI does + # not support changing it via session.update. + model = assert_given(self._settings.model) + uri = f"{self.base_url}?model={quote(model, safe='')}" + self._websocket = await websocket_connect( - uri=self.base_url, + uri=uri, additional_headers={ "Authorization": f"Bearer {self.api_key}", }, From 7da94436f51a9cae576756c7b9bb3bfcefcab4a9 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 1 May 2026 09:18:34 -0400 Subject: [PATCH 2/3] Add changelog for #4401 --- changelog/4401.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/4401.fixed.md diff --git a/changelog/4401.fixed.md b/changelog/4401.fixed.md new file mode 100644 index 000000000..fafa0e476 --- /dev/null +++ b/changelog/4401.fixed.md @@ -0,0 +1 @@ +- Fixed `GrokRealtimeLLMService` ignoring the configured model. The model was stored in `Settings` but never sent to xAI, so every session silently fell back to the deprecated `grok-voice-fast-1.0`. The model is now passed via the `?model=` query parameter on the WebSocket URL as xAI's Voice Agent API requires, and the default has been updated to the recommended `grok-voice-think-fast-1.0`. From 440738f72769264981258591889124fe5744a94a Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Fri, 1 May 2026 09:19:27 -0400 Subject: [PATCH 3/3] Update changelog for #4401: split fix and default-model change --- changelog/4401.changed.md | 1 + changelog/4401.fixed.md | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/4401.changed.md diff --git a/changelog/4401.changed.md b/changelog/4401.changed.md new file mode 100644 index 000000000..dc413e566 --- /dev/null +++ b/changelog/4401.changed.md @@ -0,0 +1 @@ +- Changed the default model for `GrokRealtimeLLMService` to `grok-voice-think-fast-1.0`, xAI's recommended Voice Agent model. The previous default of `grok-voice-fast-1.0` has been deprecated by xAI and is being removed. diff --git a/changelog/4401.fixed.md b/changelog/4401.fixed.md index fafa0e476..f427ca42a 100644 --- a/changelog/4401.fixed.md +++ b/changelog/4401.fixed.md @@ -1 +1 @@ -- Fixed `GrokRealtimeLLMService` ignoring the configured model. The model was stored in `Settings` but never sent to xAI, so every session silently fell back to the deprecated `grok-voice-fast-1.0`. The model is now passed via the `?model=` query parameter on the WebSocket URL as xAI's Voice Agent API requires, and the default has been updated to the recommended `grok-voice-think-fast-1.0`. +- Fixed `GrokRealtimeLLMService` ignoring the configured model. The model was stored in `Settings` but never sent to xAI, so every session silently fell back to xAI's server-side default. The model is now passed via the `?model=` query parameter on the WebSocket URL as xAI's Voice Agent API requires.