Documentation index · Browse by responsibility
Look up only what you need
This page is a lookup entry, not a beginner reading list. If you have not produced your first answer yet, begin with the visual quick start.
Complete structure tree
LiteRT-LM Unreal
├── Scenario APIs
│ ├── Quick Start / Single Conversation
│ ├── Conversations / Multiple
│ ├── Conversations / Memory
│ ├── Conversations / Tools
│ ├── Conversations / Actor Component
│ └── MCP / Gateway + Routing + Schema
├── Runtime services
│ ├── Shared strict-GPU model
│ ├── Serial inference queue
│ ├── Runtime status and readiness
│ └── Detailed JSONL diagnostics
├── Model lifecycle
│ ├── Project Settings model path
│ ├── Lazy initialization on first conversation
│ └── Async model download helpers
├── Development surfaces
│ ├── Blueprint nodes and UObject events
│ ├── Unreal C++ UObject API
│ └── Native SDK: C ABI + C++ convenience/RAII
├── Platforms
│ ├── Win64
│ └── Android
└── Demo scenarios
└── Multi-conversation Werewolf game
Conversation system
Beginner facade
Quick Chat
Create Quick Chat creates one underlying Agent automatically. Use Ask Once or Ask Streaming, bind On Answer, and keep the object alive. Escape to the Agent later with Get Conversation.
Full scenario object
Agent
Create Conversation (Advanced) or Runtime Create Agent creates an independent conversation with its own prompt, tools, memory, and request state. Use one Agent for each role that must remember independently.
| Capability | Quick Chat | Agent |
|---|---|---|
| Creation | System prompt or configured Agent | Full Agent config |
| Final-only answer | Ask Once | Ask and ignore chunks |
| Streaming | Ask Streaming | On Text Chunk |
| Advanced memory/tools | Via Get Conversation | Directly available |
| Recommended lifetime | One per chat surface | One per independent role |
Memory, correction, and tools
Memory API
An Agent stores canonical JSON message memory. It supports append, replace, delete, clear, import/export, message count, named save/load snapshots, and Reject Last Response. Memory changes are rejected while mutation would conflict with an outstanding request.
Tool API
Declare OpenAI-compatible tools in ToolDeclarationsJson. The model returns structured Tool Calls in the final result; game code validates and executes them. Use Submit Tool Result when the model must continue after seeing the result, or Append Tool Result to Memory when game code consumes the action immediately.
Small helpers
Try Get Tool String Argument and Try Get Tool Integer Argument read validated fields from a tool call’s Arguments JSON. Precise and reasoned decision option factories reduce repeated sampling setup.
MCP Gateway
Use Create MCP Gateway when the model-visible tools need external MCP routing. The Gateway owns one underlying Agent, emits On Tool Call, and waits for your transport/game subsystem to call Submit MCP Result.
| Change | API | Conversation impact |
|---|---|---|
| Route a tool to another server | Set Tool Route, Set Default Server Route | Hot routing change; model history/KV is preserved. |
| Remove a route | Remove Tool Route | Routing registry changes only. |
| Change model-visible tool schema | Rebuild Tool Schema | Recreates the native conversation and replays canonical history; rejected while calls are pending. |
| Transport cancelled outstanding work | Discard Pending Tool Calls | Forgets dispatches; it does not cancel a remote server for you. |
Actor Component workflow
Add LiteRT-LM Component when the conversation naturally belongs to an Actor. Configure AgentConfig in Details. BeginPlay creates one Agent, component events forward Agent events, and EndPlay retires the conversation.
Runtime, project settings, and diagnostics
ULiteRtLmSubsystem is an Engine Subsystem. It owns the process-wide model, queue, all active Agents, and runtime status. Blueprint can obtain it with Get LiteRT-LM Runtime.
| Area | Controls / reads | When users care |
|---|---|---|
| Model | Model Path, native conversation options, optional preload | Before first run and during packaging |
| Context | Max context tokens | When memory/context size must be bounded |
| Sampling | Temperature, Top P, Top K, random/fixed seed | Default behavior for normal asks |
| Observability | Metrics, runtime state, readiness, diagnostics path | Loading UI and performance/error investigation |
| Detailed diagnostics | Project default or runtime enable/disable | Temporarily inspect complete-context JSONL; disable when not needed |
Model delivery
The model must exist at the resolved runtime path. Choose one product strategy:
- Ship the model with your product: include it in a staged non-asset directory and configure a path that resolves in the package.
- Download on first run: use the async
Download LiteRT-LM Modelnode (or the Gemma 4 E2B convenience node), verify hash when provided, then persist the resulting path. - Developer-local model: useful for Editor iteration, but do not assume the same absolute path exists on another machine or Android device.
Shipping: Win64 and Android
The plugin declares Win64 and Android runtime support. A successful Editor test is not a target-device test. Before release:
- Confirm the platform binaries and model are present in the staged build.
- Log the final model path and runtime status.
- Run one minimal Quick Chat request before opening a large gameplay scene.
- On Android, capture Logcat and the plugin diagnostics path for startup crashes; do not classify a crash as “out of VRAM” without the device log.
- Test first-load memory usage, cancellation, background/resume, and a second request in the same conversation.
Public C++ header directory
| Header | Primary responsibility |
|---|---|
LiteRtLmUnrealApi.h | Shared enums, structs, request/result types, delegates, config. |
LiteRtLmBlueprintLibrary.h | Scenario factories, runtime lookup, bulk conversation and JSON helpers. |
LiteRtLmQuickChat.h | Beginner single-conversation facade. |
LiteRtLmAgent.h | Full conversation, memory, tools, state, events, lifecycle. |
LiteRtLmSubsystem.h | Shared engine runtime, C++ CreateAgent overloads, status, diagnostics. |
LiteRtLmMcpGateway.h | MCP conversation, routes, pending calls, schema rebuild. |
LiteRtLmComponent.h | Actor-owned Agent convenience component. |
LiteRtLmModelDownloader.h | Async model download Blueprint actions. |
LiteRtLmProjectSettings.h | Config-backed project defaults. |
LiteRtLmNativeSdk.h | Stable native C ABI plus C++ convenience/RAII surface. |
Reference library
Use these after a scenario is working: