LLMService gRPC API

LLMService provides provider-agnostic LLM access for plugins. Provider plugins (OpenRouter, llama.cpp) register as backends. Core routes requests to the appropriate provider.

Proto file: plugin/grpc/protocol/llm.proto

Service Methods

MethodRequestResponseStreaming
ChatLLMChatRequestLLMChatResponseNo
StreamChatLLMChatRequestLLMChatChunkServer

Chat


StreamChat


Message Types

ChatMessage

FieldTypeDescription
rolestring-
contentstring-

LLMChatRequest

FieldTypeDescription
system_promptstringDeprecated: use messages field for new callers.
user_promptstringDeprecated: use messages field for new callers.
modelstring-
temperaturedouble-
max_tokensint32-
providerstring-
attachmentsAttachment-
messagesChatMessageMulti-turn conversation history. When populated, takes precedence over system_prompt/user_prompt which remain for single-turn callers.
priorityint32Queuing priority. Lower value = higher priority. 0 = interactive (user-initiated), 10 = background (generators, batch).

Attachment

FieldTypeDescription
mime_typestring-
datastring-
filenamestring-

LLMChatResponse

FieldTypeDescription
contentstring-
modelstring-
prompt_tokensint32-
completion_tokensint32-
total_tokensint32-

LLMChatChunk

Streaming: one chunk per generated token

FieldTypeDescription
tokenstring-
donebool-
modelstring-
prompt_tokensint32-
completion_tokensint32-
total_tokensint32-
signalTokenSignalProto-

TokenSignalProto

FieldTypeDescription
confidencefloat-
entropyfloat-
top_gapfloat-
top_kTokenCandidateProto-
full_distributionfloat-
sampler_stagesSamplerStageProto-

TokenCandidateProto

FieldTypeDescription
idint32-
textstring-
probfloat-

SamplerStageProto

Snapshot of token distribution after a sampler stage

FieldTypeDescription
namestring-
active_countint32-
top1_probfloat-
entropyfloat-
top_kTokenCandidateProto-

← Back to API Index