Skip to main content

Configuration

Quick start

New to LLMAI? Use Configuration quick-start for a minimal setup guide, then return here for the full reference.

The LLMAI plugin exposes the OpenAI Realtime API over WebSocket. OpenAI, Grok (xAI), and LocalAI are provider profiles on the same session model—ConnectToAI, voice, VAD, and function calling share one configuration shape. Most Project Settings are identical across profiles; only authentication and a few profile-specific fields differ.

Compare capability differences (not setup steps) on the Providers comparison table. Enable the plugin first—see Installation on your projects.

Project Settings UI labels match the tables below (Edit → Project Settings → Plugins → LLMAI).

Where configuration lives

LocationPersists?Typical use
Project Settings (Config/DefaultGame.ini)Yes (disk)Team defaults, API keys in dev, model/voice lists
Plugin DefaultGame.iniShipped with pluginFab defaults; fills gaps on fresh projects
Blueprint SetDefault* / connect dialogSession/process only (unless bPersistToProjectConfig=true)Demo UI, runtime overrides
ConnectToAI parametersPer connection onlyExplicit session overrides
Environment variablesExternal to projectCI, secrets, headless builds
Console CVars (llmai.debug.*)Runtime onlyTroubleshooting verbosity

All defaults live under Edit → Project Settings → Plugins → LLMAI. The Terminal connection dialog and ConnectToAI can override provider, model, voice, and instructions for an individual session—see the Terminal demo.

Per-component voice and audio tuning (for example VoiceThreshold, mic gating) is configured on the Details panel of ULLMAIClientComponent, not in Project Settings. See Component instance properties.

Settings priority

Configuration resolves through separate tracks depending on what you are setting. Do not assume one global priority order applies to API keys, models, and debug logging.

flowchart TD
subgraph iniLoad [INI at engine startup]
UEAuto[UE LoadConfig]
ProjectINI[Project DefaultGame.ini]
PluginINI[Plugin DefaultGame.ini merge fill-empty]
UEAuto --> ProjectINI --> PluginINI
end

subgraph connectModel [Model at ConnectToAI]
ConnectArg[Connect parameter if non-empty]
RuntimeOverlay[Runtime overlay SetDefault]
ProjectCDO[Project Settings CDO]
EnvModel[Environment variable]
ConnectArg --> RuntimeOverlay --> ProjectCDO --> EnvModel
end

subgraph connectKey [API key at ConnectToAI]
ProjectKey[Project Settings APIKey]
EnvKey[Environment variable]
CmdKey[Command line flag]
ProjectKey --> EnvKey --> CmdKey
end

INI and Project Settings loading (startup)

At module startup, provider defaults load in this order:

  1. UE automatic LoadConfig() on ULLMAISettings
  2. Manual parse of {Project}/Config/DefaultGame.ini when nested arrays fail or key fields are empty
  3. Plugin INI mergePlugins/LLMAI/Config/DefaultGame.ini is always merged into still-empty provider fields

Project Settings override plugin defaults for fields you customize. If your project INI defines OpenAI but not Grok, Grok voices and models are filled from the plugin INI automatically.

Fresh projects

If {Project}/Config/ is missing or incomplete, voice and model lists come from the plugin INI after merge. On a fresh project you should see OpenAI and Grok voice dropdowns populated without manual INI editing.

Session settings at connect (model, voice, instructions)

When ConnectToOpenAI, ConnectToLocalAI, or ConnectToGrok is called with empty model or instructions, the plugin resolves values in this order:

PrioritySourceExample
1 (highest)Connect parameterConnectToAI Model pin or Terminal dialog selection
2Runtime overlaySetDefaultAIModel, SetDefaultInstructions, etc. (Blueprint library)
3Project SettingsPer-provider Model / Instructions in the editor
4 (lowest)Environment variableLLMAI_OPENAI_MODEL, OPENAI_MODEL, etc.

Voice follows the same overlay → Project Settings path. Grok also accepts an explicit Voice connect parameter; see Grok voice lock below.

Known model lists (dropdown validation) use overlay → Project Settings via GetKnownAIModels. At connect time, comma-separated environment variables can override the list for that component only:

ProviderEnvironment variables
OpenAILLMAI_OPENAI_MODELS, OPENAI_MODELS
LocalAILLMAI_LOCALAI_MODELS, LOCALAI_MODELS
GrokLLMAI_GROK_MODELS, GROK_MODELS

API keys (separate track)

API key discovery is separate from model/voice settings. The plugin uses the first non-empty key found in this order:

ProviderProject Settings fieldEnvironment variables (in order)Command line
OpenAIOpenAI Provider → API KeyLLMAI_OPENAI_API_KEY, OPENAI_API_KEY-OpenAIKey=
GrokGrok Provider → API KeyXAI_API_KEY, LLMAI_GROK_API_KEY, GROK_API_KEY-GrokKey= or -XAIKey=
LocalAILocalAI Provider → API Key (optional)LLMAI_LOCALAI_API_KEY, LOCALAI_API_KEY-LocalAIKey=
Security

Project Settings is recommended for local development. Use environment variables or command-line flags for CI and shipping workflows so secrets are not committed to source control. The plugin logs which source was used—it never logs key values.

Common misconception

If Project Settings contains a non-empty API key, environment variables are not used, even when set. To force env-based keys, leave the Project Settings API Key field empty.

LocalAI often runs without authentication; the Realtime Base URL is the critical connection setting. An optional API key is supported when your server requires it.

Debug settings (Project Settings vs CVars)

LayerBehavior
Project Settings → LLMAI | DebugApplied once at module startup
Console llmai.debug.* CVarsOverride at runtime; authority after init
Project Settings fieldInitializes CVar
Enable Verbose LoggingAll debug levels (equivalent to llmai.debug.EnableAll)
Save Audio Debug Filesllmai.debug.SaveAudioFiles
Log WebSocket Messagesllmai.debug.LogRawWebSocketData

Console commands such as llmai.debug.EnableAll control logging verbosity at runtime. They do not replace Project Settings for provider, model, or voice configuration. See Debug and logging.

Runtime Blueprint settings (v2.2)

Blueprint functions SetDefaultAIModel, SetDefaultAIVoice, SetDefaultInstructions, SetDefaultAIProvider, SetKnownAIModels, and SetKnownAIVoices write to a process-wide runtime overlay by default:

  • Affects GetDefault* reads and connect fallbacks
  • Does not write to disk unless you pass bPersistToProjectConfig=true
  • When bPersistToProjectConfig=true, the overlay merges into Project Settings and saves Config/DefaultGame.ini

The Terminal connect dialog uses these at runtime. Pass bPersist=true where you want demo choices to persist across editor sessions.

Use GetProviderCapabilities and IsProviderFeatureSupported to hide UI options a provider does not support—for example, OpenAI GA ignores session temperature, so a temperature slider should be disabled when OpenAI is selected. See Providers comparison.

Project Settings catalog

The following tables mirror Edit → Project Settings → Plugins → LLMAI in v2.2.

LLMAI | AI

SettingPurpose
Default AI ProviderOpenAI, LocalAI, or Grok when connect does not specify a provider

Per-provider settings (OpenAI, LocalAI, Grok)

Each provider subsection uses the same category groups. Field names below match the editor.

Authentication

SettingOpenAILocalAIGrok
API KeyRequiredOptionalRequired

Models

SettingPurpose
ModelDefault Realtime model for this provider
Transcription ModelSpeech-to-text model (default: whisper-1)
Known ModelsList of models shown in UI dropdowns and used for validation

Voice

SettingPurpose
Realtime VoiceDefault voice ID for Realtime sessions
Known VoicesVoice entries (Name, Id, Description) for UI dropdowns
TTS Model (LocalAI only)Optional TTS backend (chatterbox, kokoro-tts, etc.)

Instructions

SettingPurpose
InstructionsPer-provider system prompt (multi-line). There is no global instructions field—each provider has its own.

Connection

SettingOpenAILocalAIGrok
Realtime Base URLwss://api.openai.com/v1/realtimews://localhost:8080/v1/realtimewss://api.x.ai/v1/realtime
Header ValueDeprecated (ignored for GA)Optional

Audio Format

SettingPurpose
Realtime Output Sample RateTarget sample rate (24000 Hz recommended)
Input Audio FormatDefault: pcm16
Output Audio FormatDefault: pcm16
Audio Output Speed (LocalAI only)Playback speed multiplier

Timing

SettingPurpose
Voice Mode Start Timeout (s)Max wait for voice mode to become ready
Playback Buffer SecondsAudio playback buffering
Server VAD Wait MultiplierMultiplier for server-side VAD timing
Response Coalesce Delay (s)Delay before coalescing response chunks

Audio Streaming

SettingPurpose
Audio Send Interval (s)How often mic audio is sent to the server
Max Accumulated Audio Size (bytes)Cap on buffered input audio
Max Collected Response Size (bytes)Cap on buffered response audio

VAD (Voice Activity Detection)

SettingPurpose
VAD TypeSemantic VAD (OpenAI only) or Server VAD
VAD EagernessSemantic VAD only: Low, Medium, High, Auto
VAD ThresholdServer VAD sensitivity (0.1–1.0)
VAD Prefix Padding MsAudio padding before speech detection
VAD Silence Duration MsSilence duration before turn end

Grok Features (Grok only)

SettingPurpose
Enable SearchGrok live web/X search

LLMAI | Audio (shared)

SettingPurpose
Default Sample RateWASAPI capture default (actual rate comes from device)
Default ChannelsMono (1) or stereo (2)
Default Bits Per SampleBit depth for capture
Default Voice ThresholdMic activity threshold
Default Max Silence DurationSilence before end-of-turn
Default Audio Output DirectoryWhere debug WAV files are saved
Recognition Gain Boost MultiplierInput gain for speech recognition

LLMAI | Socket

SettingPurpose
WebSocket Message Memory Limit (bytes)Max incoming message size. Increase if you see WebSocket error 1009 (message too big). Default: 32 MB.

LLMAI | Audio Stream

SettingPurpose
Streaming Chunk Size (bytes)WASAPI capture chunk size
Streaming Worker Sleep (s)Background streaming thread sleep interval
SettingPurpose
Enable LiveLink By DefaultAuto-enable LiveLink on audio stream component
Default LiveLink Subject NameLiveLink subject for lip-sync (default: LLMAIAudio)

LLMAI | Debug

SettingPurpose
Enable Verbose LoggingEnable detailed logging at startup (see Debug settings)
Save Audio Debug FilesSave captured audio to disk for debugging
Log WebSocket MessagesLog raw WebSocket traffic
Max Content Preview LengthTruncate long log content previews
Max Result Preview LengthTruncate long function result previews

Environment variables and CLI flags

VariableProviderPurpose
LLMAI_OPENAI_API_KEY, OPENAI_API_KEYOpenAIAPI key fallback
LLMAI_OPENAI_MODEL, OPENAI_MODELOpenAIDefault model fallback
LLMAI_OPENAI_MODELS, OPENAI_MODELSOpenAIComma-separated Known Models override (per component at connect)
LLMAI_LOCALAI_API_KEY, LOCALAI_API_KEYLocalAIOptional API key
LLMAI_LOCALAI_MODEL, LOCALAI_MODELLocalAIDefault model fallback
LLMAI_LOCALAI_MODELS, LOCALAI_MODELSLocalAIKnown Models override
XAI_API_KEY, LLMAI_GROK_API_KEY, GROK_API_KEYGrokAPI key fallback
XAI_MODEL, LLMAI_GROK_MODEL, GROK_MODELGrokDefault model fallback
LLMAI_GROK_MODELS, GROK_MODELSGrokKnown Models override

Command-line flags: -OpenAIKey=, -LocalAIKey=, -GrokKey=, -XAIKey=

Upgrading after a plugin update

When you install a newer LLMAI plugin in a project that already had LLMAI configured, existing project INI values are kept. At startup the plugin merges Plugins/LLMAI/Config/DefaultGame.ini only into still-empty provider fields—it does not replace your current Model, KnownModels, or KnownVoices entries.

  1. Close Unreal Editor and back up {Project}/Config/DefaultGame.ini.
  2. Remove the entire [/Script/LLMAI.LLMAISettings] block from that file (from the [/Script/LLMAI.LLMAISettings] line through the end of all LLMAI provider lines—do not delete unrelated [...] sections elsewhere in the file).
  3. Install or copy the new plugin version, then open the project.
  4. On first launch, LLMAI settings are filled from the shipped plugin defaults—including default Model values and KnownModels / KnownVoices lists for OpenAI and Grok.
  5. Open Edit → Project Settings → Plugins → LLMAI and re-enter API keys, custom Instructions, LocalAI Realtime Base URL, and any other values you had before the reset.
What you lose when deleting the section

Deleting [/Script/LLMAI.LLMAISettings] clears all saved LLMAI Project Settings in that file—not only models. API keys stored in INI, custom instructions, debug toggles, and LocalAI URLs must be entered again after reset.

Upgrading from v2.1 to v2.2

After reset, shipped defaults include OpenAI model gpt-realtime-2 and Grok model grok-voice-think-fast-1.0, with KnownModels lists matching the v2.2 plugin INI. If you keep an old project INI without resetting, stale OpenAI preview model names may fail to connect under the GA Realtime API.

See Changelog — Upgrading from a previous version for why reset is needed and the v2.1 → v2.2 example; see Version 2.2 for full release notes.

INI customization

Project overrides live in {Project}/Config/DefaultGame.ini under [/Script/LLMAI.LLMAISettings]. Plugin defaults ship in Plugins/LLMAI/Config/DefaultGame.ini. Editing Project Settings in the editor writes the same INI section.

Minimal example (OpenAI block with correct property names):

[/Script/LLMAI.LLMAISettings]
DefaultAIProvider=OpenAI
OpenAI=(APIKey="",Model="gpt-realtime-2",RealtimeVoice="alloy",Instructions="You are a helpful assistant.",RealtimeBaseUrl="wss://api.openai.com/v1/realtime",KnownModels=("gpt-realtime-2","gpt-realtime-mini"),KnownVoices=((Name="Alloy",Id="alloy",Description="Neutral voice")))
Grok=(APIKey="",Model="grok-voice-think-fast-1.0",RealtimeVoice="Ara",RealtimeBaseUrl="wss://api.x.ai/v1/realtime",KnownModels=("grok-voice-think-fast-1.0","grok-voice-latest"),KnownVoices=((Name="Ara",Id="Ara")))

Use KnownModels and KnownVoices (not legacy names like KnownRealtimeModels). Voice entries use (Name="...",Id="...",Description="...") tuples.

Provider profiles

Configure the profile you plan to use. You only need one provider running for a given session, but you may fill in all three if you switch between them.

OpenAI

Authentication: API key required.

  1. Edit → Project Settings → Plugins → LLMAI → OpenAI Provider
  2. Enter API Key (or use env/CLI sources in API keys)
  3. Set Model (default: gpt-realtime-2) and Realtime Voice
  4. Optionally set Instructions for this provider

Default model for LLMAI v2.2 is gpt-realtime-2. OpenAI dropped preview Realtime models as of May 2026—see Providers — OpenAI.

OpenAI GA ignores session temperature in the Realtime API. Use GetProviderCapabilities if your UI exposes a temperature slider.

Grok (xAI)

Authentication: API key required (from console.x.ai).

  1. Edit → Project Settings → Plugins → LLMAI → Grok Provider
  2. Enter API Key (or use env/CLI sources in API keys)
  3. Set Realtime Voice — Ara, Rex, Sal, Eve, or Leo
  4. Optionally set Model (default: grok-voice-think-fast-1.0) and Enable Search
warning

Grok locks the voice after the first session update. You must specify voice when connecting (via the Voice parameter or Project Settings default). It defaults to Ara if omitted and cannot be changed without reconnecting.

LocalAI

Authentication: Optional API key. Requires a running LocalAI Realtime server.

  1. Edit → Project Settings → Plugins → LLMAI
  2. Set Default AI Provider to LocalAI (optional if you always pass provider at connect)
  3. Under LocalAI Provider:
    • Realtime Base URL — e.g. ws://localhost:8080/v1/realtime (must use ws://, not http://)
    • Model — e.g. gpt-realtime
    • TTS Model — e.g. chatterbox (optional)
    • Transcription Model — e.g. whisper-1
    • Realtime Voice — TTS voice for output
    • Known Voices — define voices matching your TTS backend

Download, Docker, and server setup: LocalAI Realtime Endpoint. Return here for Unreal-side defaults after the server is running.

Where providers differ

Setup is largely shared; behavior differs at runtime. See the comparison table for full detail.

  • Voice mid-session: OpenAI and LocalAI allow changing voice without reconnecting; Grok does not.
  • VAD: OpenAI supports Semantic VAD and Server VAD; Grok and LocalAI use Server VAD only.
  • Session temperature: OpenAI GA ignores temperature; use GetProviderCapabilities to drive UI visibility.
  • Web search / MCP: Grok has native built-in search; OpenAI supports server-side MCP; LocalAI has no server-side MCP.
  • LocalAI-only fields: Realtime Base URL, TTS Model, Header Value, Audio Output Speed.

Verification

1. Plugin installed

  1. Create an Actor Blueprint
  2. Add Component → search for LLMAI Client Component
  3. If the component appears → installation succeeded
  4. If not → Installation troubleshooting

2. Realtime connection

  1. Add LLMAI Client Component to an Actor
  2. On Begin Play, call Connect to AI (or use Blueprint equivalent)
  3. Use your configured Default AI Provider, or pass provider explicitly
  4. Set Model to your profile default (e.g. gpt-realtime-2 for OpenAI)
  5. For Grok, always pass Voice (e.g. Ara)
  6. For LocalAI, ensure the server is running before connecting
  7. Play the level and check Output Log for AI Session Ready

3. Config merge (fresh or partial project)

On a project with OpenAI configured but no Grok INI block, confirm the Output Log shows Grok voices/models loaded from the plugin INI merge (e.g. Loaded PLUGIN Grok.KnownVoices: 5 entries).

4. Full setup (demos)

If you have the LLMAI demo content:

  1. Open Content/LLMAITerminal/Levels/LVL_LLMAITerminal.umap
  2. Play in editor and connect via the Terminal dialog
  3. Chat or enable voice mode to confirm end-to-end behavior

See the Demo guide for Terminal, Rocketeer, and Live Link walkthroughs.

Troubleshooting

Start with these checks:

  • Confirm the correct provider profile is selected and its auth is configured (API key or LocalAI Realtime Base URL).
  • API key in env but connection fails: check whether Project Settings already has a different (or empty-looking) key—Project Settings wins when non-empty.
  • Read the Output Log for connection errors; enable llmai.debug.EnableAll if you need more detail.
  • Cloud providers (OpenAI, Grok): verify API key, credits, network, and firewall/WebSocket access.
  • LocalAI: verify the server is running, the endpoint uses ws://, and the URL matches Project Settings.

For deeper help, use the dedicated references rather than duplicating them here: