@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
| Interface | Description |
|---|---|
| LiteRtLmAdapterOptions | Configuration for the in-browser LiteRT-LM adapter. |
| LiteRtSamplerParametersOption | Sampler-parameters option shape (the type field accepts the numeric SamplerType value). |
Type Aliases
| Type Alias | Description |
|---|---|
| Backend | Inference-backend enum value: CPU, GPU, etc. |
| CreateLiteRtLmEngine | Factory that loads a .litertlm model and resolves a ready-to-use LiteRtLmEngine. |
| LiteRtConversationConfig | Configuration for an LiteRtLmConversation. |
| LiteRtEngineSettings | Engine-construction settings ({ model, backend?, mainExecutorSettings? }). |
| LiteRtLlmExecutorSettings | Per-executor settings (context length, backend config, sampler backend). |
| LiteRtLmChatEngine | Alias of LiteRtLmEngine. |
| LiteRtLmConversation | A live LiteRT conversation created from an engine for one dispatch. |
| LiteRtLmDescriptionLike | The description envelope a joi schema produces, consumed by the JSON-schema converter. |
| LiteRtLmEngine | The LiteRT-LM engine instance the adapter drives. |
| LiteRtLmInitProgressReport | Progress report emitted while a LiteRT model loads. Provider-opaque; passed through verbatim. |
| LiteRtLmJsonSchema | The JSON-schema-shaped value used for a tool's parameters field (re-export for convenience). |
| LiteRtMessage | A message in a LiteRT conversation: { role, content?, channels?, tool_calls? }. |
| LiteRtMessageContentItem | An item in a message's content array ({ type, text?, path?, tool_response? }). |
| LiteRtMessageLike | A string or LiteRtMessage. |
| LiteRtPreface | Initial messages, tools, and context the conversation begins with. |
| LiteRtSamplerParameters | Sampler configuration ({ type, k, p, temperature, seed }). |
| LiteRtSessionConfig | Per-session generation configuration (sampler, modality flags, output limits). |
| LiteRtTool | A tool definition exposed to the model ({ name, description?, parameters? }). |
| LiteRtToolCall | A tool call predicted by the model ({ type, function: { name, arguments } }). |
| LiteRtToolCallFunction | The function payload of a LiteRtToolCall ({ name, arguments: object }). |
| LiteRtToolParameters | Parameters for a LiteRtTool, following JSON Schema. |
| LiteRtToolResponseValue | A tool response value fed back to the model. |
| SamplerType | Sampler-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