Skip to content
2 min read · 452 words

@nhtio/adk/batteries/llm/litert_lm/types ​

Types for the LiteRT-LM adapter — options, engine/conversation aliases, and the LiteRT wire shapes re-exported from @litert-lm/core.

Remarks ​

The published @litert-lm/core JS guide lags the library. The shapes below mirror the installed package's type declarations (the source of truth), which expose tool use, channels ("thinking"), sampler controls, and multimodality that the public docs omit. Verify against the installed .d.ts when upgrading — the dependency is young and volatile.

Interfaces ​

InterfaceDescription
LiteRtLmAdapterOptionsConfiguration for the in-browser LiteRT-LM adapter.
LiteRtSamplerParametersOptionSampler-parameters option shape (the type field accepts the numeric SamplerType value).

Type Aliases ​

Type AliasDescription
BackendInference-backend enum value: CPU, GPU, etc.
CreateLiteRtLmEngineFactory that loads a .litertlm model and resolves a ready-to-use LiteRtLmEngine.
LiteRtConversationConfigConfiguration for an LiteRtLmConversation.
LiteRtEngineSettingsEngine-construction settings ({ model, backend?, mainExecutorSettings? }).
LiteRtLlmExecutorSettingsPer-executor settings (context length, backend config, sampler backend).
LiteRtLmChatEngineAlias of LiteRtLmEngine.
LiteRtLmConversationA live LiteRT conversation created from an engine for one dispatch.
LiteRtLmDescriptionLikeThe description envelope a joi schema produces, consumed by the JSON-schema converter.
LiteRtLmEngineThe LiteRT-LM engine instance the adapter drives.
LiteRtLmInitProgressReportProgress report emitted while a LiteRT model loads. Provider-opaque; passed through verbatim.
LiteRtLmJsonSchemaThe JSON-schema-shaped value used for a tool's parameters field (re-export for convenience).
LiteRtMessageA message in a LiteRT conversation: { role, content?, channels?, tool_calls? }.
LiteRtMessageContentItemAn item in a message's content array ({ type, text?, path?, tool_response? }).
LiteRtMessageLikeA string or LiteRtMessage.
LiteRtPrefaceInitial messages, tools, and context the conversation begins with.
LiteRtSamplerParametersSampler configuration ({ type, k, p, temperature, seed }).
LiteRtSessionConfigPer-session generation configuration (sampler, modality flags, output limits).
LiteRtToolA tool definition exposed to the model ({ name, description?, parameters? }).
LiteRtToolCallA tool call predicted by the model ({ type, function: { name, arguments } }).
LiteRtToolCallFunctionThe function payload of a LiteRtToolCall ({ name, arguments: object }).
LiteRtToolParametersParameters for a LiteRtTool, following JSON Schema.
LiteRtToolResponseValueA tool response value fed back to the model.
SamplerTypeSampler-type enum value: TOP_K, TOP_P, GREEDY.

References ​

DescriptionLike ​

Re-exports DescriptionLike


JsonSchema ​

Re-exports JsonSchema


LiteRtLmBucketOrder ​

Renames and re-exports ChatCompletionsBucketOrder


LiteRtLmHelpers ​

Renames and re-exports ChatCompletionsHelpers


UnsupportedMediaPolicy ​

Re-exports UnsupportedMediaPolicy