Overview
InworldRealtimeLLMService provides real-time, multimodal conversation capabilities using Inworld’s Realtime API. It operates as a cascade STT/LLM/TTS pipeline under the hood with built-in semantic voice activity detection (VAD) for turn management, offering low-latency speech-to-speech interactions with integrated LLM processing and function calling.
Speech synthesis defaults to Realtime TTS-2 (inworld-tts-2). Realtime TTS-1.5-Max (inworld-tts-1.5-max) and Realtime TTS-1.5-Mini (inworld-tts-1.5-mini) remain available via the tts_model parameter.
Inworld Realtime API Reference
Pipecat’s API methods for Inworld Realtime integration
Example Implementation
Complete Inworld Realtime conversation example
Inworld Realtime Documentation
Official Inworld Realtime API documentation
Inworld Console
Access Inworld models and manage API keys
Installation
To use Inworld Realtime services, install the required dependencies:Prerequisites
Inworld Account Setup
Before using Inworld Realtime services, you need:- Inworld Account: Sign up at Inworld Studio
- API Key: Generate an Inworld API key from your account dashboard
- Model Access: Ensure access to Inworld Realtime models
- Usage Limits: Configure appropriate usage limits and billing
Required Environment Variables
INWORLD_API_KEY: Your Inworld API key for authentication
Key Features
- Real-time Speech-to-Speech: Direct audio processing with low latency
- Cascade Pipeline: Integrated STT → LLM → TTS processing
- Semantic VAD: Advanced semantic voice activity detection for natural turn-taking
- Multilingual Support: Support for multiple languages via STT model selection
- Function Calling: Seamless support for external functions and tool integration
- Multiple Voice Options: Various voice personalities available
- WebSocket Support: Real-time bidirectional audio streaming
- Streaming Transcription: Real-time user speech transcription
Configuration
InworldRealtimeLLMService
str
required
Inworld API key for authentication.
str
default:"openai/gpt-4.1-mini"
LLM model to use (e.g. “openai/gpt-4.1-mini”). Can be any supported model or
an Inworld Router. Shorthand
for
session_properties.model.str
default:"Clive"
Voice ID for TTS output (e.g. “Sarah”, “Clive”). Shorthand for
session_properties.audio.output.voice.str
default:"inworld-tts-2"
TTS model to use. Defaults to Realtime TTS-2 (
inworld-tts-2). Other options:
Realtime TTS-1.5-Max (inworld-tts-1.5-max), Realtime TTS-1.5-Mini
(inworld-tts-1.5-mini). Shorthand for
session_properties.audio.output.model.str
default:"inworld/inworld-stt-1"
STT model for input transcription (e.g. “inworld/inworld-stt-1”). Defaults to
"inworld/inworld-stt-1"; pass stt_model= to override. Shorthand for
session_properties.audio.input.transcription.model.str
default:"wss://api.inworld.ai/api/v1/realtime/session"
WebSocket base URL for the Inworld Realtime API. Override for custom
deployments.
Literal['basic', 'bearer']
default:"basic"
Authentication type.
"basic" for server-side API key auth, "bearer" for
client-side JWT auth.bool
default:"False"
Whether to start with audio input paused.
Settings
Runtime-configurable settings passed via thesettings constructor argument using InworldRealtimeLLMService.Settings(...). model, system_instruction, and session_properties can be updated mid-conversation with LLMUpdateSettingsFrame. See Service Settings for details.
NOT_GIVEN and None values are omitted, letting the service use its own
defaults. Only parameters that are explicitly set are included.SessionProperties
AudioConfiguration
Theaudio field in SessionProperties accepts an AudioConfiguration with input and output sub-configurations:
AudioInput (audio.input):
AudioOutput (
audio.output):
Inworld PCM audio supports sample rates: 8000, 16000, 24000, 32000, 44100, and 48000 Hz.
TurnDetection
Usage
Basic Setup
With Model and Voice Configuration
With Full Session Configuration
Updating Settings at Runtime
For partial updates, prefer the top-level fields (model, system_instruction).
They are synced into session_properties automatically, so you don’t need to
resend a full SessionProperties config:
voice, send a complete SessionProperties (it
replaces the stored config wholesale). Copy the current one and change the fields
you need:
Methods
set_audio_input_paused()
True) or resumes (False) sending input audio to the model.
Notes
- Audio format auto-configuration: The service sets PCM input and output rates to the pipeline’s sample rates, replacing any configured rate, and uses PCM where no format is set.
- Semantic VAD by default: The service uses semantic VAD (
"semantic_vad") by default for more natural turn detection. When VAD is enabled, the server handles speech detection and turn management automatically. - Cascade architecture: The service operates as an integrated STT → LLM → TTS pipeline on the server side, simplifying client-side implementation.
- Audio before setup: User audio is dropped until the service receives its first context (for example, from an
LLMRunFramequeued when the client connects) and the session is set up. - G.711 formats: PCMU and PCMA are fixed at 8000 Hz. The service passes audio through without converting it, and pipeline audio frames are 16-bit PCM, so use
PCMAudioFormat; for telephony, the transport’s serializer converts to and from G.711. - System instruction precedence: The
system_instructionfrom service settings takes precedence over an initial system message in the LLM context. A warning is logged when both are set. - Settings replacement: When providing
session_propertiesinsettings, it replaces all defaults wholesale, so provide a completeSessionPropertiesconfiguration in that case.voice,tts_model, andstt_modelhave no effect then. Use the constructor shortcuts (llm_model,voice,tts_model,stt_model) for simpler configuration. - Function calling limitations: Functions registered with
cancel_on_interruption=Falseare not reliably supported by Inworld Realtime. The service logs an error and pushes anErrorFrameif async tool messages are detected. Usecancel_on_interruption=True(the default) or consider another LLM service if your tool needs async semantics. Streamed intermediate tool results (FunctionCallResultProperties(is_final=False)) are also not supported.