Registry / ai-ml / livekit-plugins-xai

livekit-plugins-xai

JSON →
library1.6.1pypypiunverified

Plugin for the LiveKit Agents framework integrating xAI's Grok models for LLM and TTS inference. Current version 1.5.7, released as part of the livekit-agents monorepo with weekly releases.

pip install livekit-plugins-xai
INSTALL
IMPORT
SIG · LIVEKIT-PLUGINS-XA
L
livekit-plugins-xai
ai-mlpythonv1.6.1
Install
19.2s avg
Import
Disk
374MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.6.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
build_error
glibc
py 3.103.95 runs
installs and imports cleanly · install 19.2s · import 0.000s · 376MB
374MB installed
● package 374MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

LLM
from livekit.plugins.xai import LLM
from livekit.plugins.xai import LLM

Initialize xAI LLM and TTS with API key from environment variable XAI_API_KEY.

import os from livekit.plugins.xai import LLM, TTS # Ensure XAI_API_KEY is set in environment llm = LLM() tts = TTS() result = llm.chat([{"role": "user", "content": "Hello"}]) print(result) # TTS example audit = tts.synthesize("Hello from xAI") print(audio)
Debug
Known issues
gotchaThe xAI plugin inherits from the OpenAI plugin's LLM and TTS classes, but xAI does not support all OpenAI features (e.g., structured output, function calling). Errors may occur if those are used.
fix
Use only basic chat completion features; avoid function calling and response_format with JSON schema.
affects: >=1.0.0
breakingThe xAI plugin was previously part of the main livekit-agents package and imported from `livekit.plugins.xai` only after becoming a separate plugin. Users migrating from older livekit-agents must install `livekit-plugins-xai`.
fix
Run `pip install livekit-plugins-xai` and update imports to `from livekit.plugins.xai import ...`
affects: pre-1.0.0 vs >=1.0.0
deprecatedThe `livekit.plugins.xai.LLM.with_groq` alias from earlier beta is removed. Use `LLM()` directly.
fix
Replace `LLM.with_groq(...)` with `LLM(...)`.
affects: >=1.0.0
Upgrade
Version history
1.6.1latest on PyPI · released Jun 17, 2026
Audit
Dependencies
livekit-agentsrequiredCore framework dependency; plugin cannot be used without it
livekit-plugins-openaioptionalxAI plugin inherits from OpenAI plugin classes due to API compatibility
Agent activity
15 hits · last 30 days
node
14
OpenAI (training)
1
Resources
livekit-plugins-xai — pip install livekit-plugins-xai · libregistry