Skip to content
1 min read · 98 words

Type Alias: CreateLiteRtLmEngine ​

ts
type CreateLiteRtLmEngine = (input: {
  engineSettings: EngineSettings;
  onInitProgress?: (report: LiteRtLmInitProgressReport) => void;
}) => Promise<LiteRtLmEngine>;

Defined in: src/batteries/llm/litert_lm/types.ts:115

Factory that loads a .litertlm model and resolves a ready-to-use LiteRtLmEngine.

Parameters ​

ParameterType
input{ engineSettings: EngineSettings; onInitProgress?: (report: LiteRtLmInitProgressReport) => void; }
input.engineSettingsEngineSettings
input.onInitProgress?(report: LiteRtLmInitProgressReport) => void

Returns ​

Promise<LiteRtLmEngine>

Remarks ​

The default factory (when this option is omitted) dynamically imports @litert-lm/core and calls Engine.create(engineSettings). Supply a custom factory to control the WebGPU/worker setup, to inject a pre-warmed engine, or to mock the engine in tests without WebGPU.