Skip to main content

API Reference

All types use the ERP_ / UERP_ / FERP_ prefix and are Blueprint-accessible.

UERP_LLMComponent

The Blueprint-friendly entry point. Add it to an NPC or controller.

MemberKindDescription
SystemPromptproperty FStringPersona / instructions
GenerationConfigproperty FERP_LLMGenerationConfigSampling params
bAutoInitializeproperty boolCreate context on BeginPlay
SendMessage(UserMessage)function → boolAdd user message + generate
PushText(Text)functionPipeline sink (same as SendMessage)
GenerateContinuation()function → boolContinue without new input
ClearHistory()functionReset conversation (keeps system prompt)
AddMessage(Message)functionPre-load a FERP_LLMMessage
SetSystemPromptRuntime(Text)functionChange persona at runtime
IsLLMReady()pure → boolBackend loaded?
OnGenerationCompleteevent FERP_LLMResultFull result + metrics
OnTextevent FStringGenerated reply text — for chaining
OnTokenGeneratedevent FStringPer-token (when streaming)

FERP_LLMGenerationConfig

FieldTypeDefault
MaxTokensint32256
Temperaturefloat0.7
TopPfloat0.9
TopKint3240
RepetitionPenaltyfloat1.1
StopSequencesTArray<FString>
bEnableStreamingboolfalse

FERP_LLMMessage / FERP_LLMResult

FERP_LLMMessage = { Role (System/User/Assistant), Content, Metadata }. FERP_LLMResult = { GeneratedText, TokensGenerated, bCompleted, StopReason, ProcessingTimeMs, TokensPerSecond }.

UERP_LLMSubsystem

GameInstanceSubsystem owning the shared model.

MemberDescription
InitializeBackend(Config)boolLoad the GGUF model
IsBackendInitialized()boolReady state
GetModelInfo()FStringLoaded model description
GetMaxContextLength()int32Context window size
CountTokens(Text)int32Tokenize for budgeting

IERP_LLMBackend

Implement to add a custom inference engine, then select Custom in settings. UERP_LlamaCppBackend is the bundled implementation.