Skip to content

feat(xai): support model selection in realtime, default to grok-voice-think-fast-1.0#1327

Merged
toubatbrian merged 1 commit intolivekit:mainfrom
Hormold:xai/realtime-model-selection
Apr 28, 2026
Merged

feat(xai): support model selection in realtime, default to grok-voice-think-fast-1.0#1327
toubatbrian merged 1 commit intolivekit:mainfrom
Hormold:xai/realtime-model-selection

Conversation

@Hormold
Copy link
Copy Markdown
Contributor

@Hormold Hormold commented Apr 27, 2026

Port of livekit/agents#5548 to JS.

x.ai deprecated grok-voice-fast-1.0 and recommends grok-voice-think-fast-1.0 as the new flagship voice model, selectable via the model query param on the realtime websocket (see https://docs.x.ai/developers/model-capabilities/audio/voice-agent). This patch updates the default model in xai.realtime.RealtimeModel to grok-voice-think-fast-1.0, exposes a GrokRealtimeModels literal with both the new and legacy ids, and types the model option as GrokRealtimeModels | string. The parent OpenAI realtime client already forwards model as a ws query param so the resulting URL matches the x.ai docs exactly.

Summary

  • Add GrokRealtimeModels type ('grok-voice-think-fast-1.0' | 'grok-voice-fast-1.0')
  • Default RealtimeModel model to grok-voice-think-fast-1.0
  • Type RealtimeModelOptions.model as GrokRealtimeModels | string

Test plan

  • pnpm --filter @livekit/agents-plugin-xai build succeeds
  • pnpm --filter @livekit/agents-plugin-xai lint clean (only pre-existing warnings in _utils.ts)
  • pnpm format:check passes
  • Manual smoke: instantiating RealtimeModel with no args resolves to grok-voice-think-fast-1.0; passing model: 'grok-voice-fast-1.0' is accepted and forwarded; arbitrary string still accepted via string fallback

🤖 Generated with Claude Code

…-think-fast-1.0

x.ai deprecated grok-voice-fast-1.0 and recommends grok-voice-think-fast-1.0
as the new flagship voice model, selectable via the model query param on the
realtime websocket. The parent OpenAI realtime client already forwards model
as a ws query param, so the resulting URL matches the x.ai docs exactly.

Adds a GrokRealtimeModels literal with both the new and legacy ids,
updates the default to grok-voice-think-fast-1.0, and types the model
option as GrokRealtimeModels | string.

Port of livekit/agents#5548.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 27, 2026

🦋 Changeset detected

Latest commit: 494858a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 26 packages
Name Type
@livekit/agents-plugin-xai Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-assemblyai Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-cerebras Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-google Patch
@livekit/agents-plugin-hedra Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-lemonslice Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-mistral Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-phonic Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-runway Patch
@livekit/agents-plugin-sarvam Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-trugen Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@toubatbrian toubatbrian merged commit 5fc0acd into livekit:main Apr 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants