TimesFM Web Inference Engine — browser-compatible ONNX inference via onnxruntime-web (WASM / WebGPU / WebGL).
Implements the IInferenceEngine interface from @agentix-e/timesfm-core so it can be injected into TimesFMModel.fromPretrained().
IInferenceEngine
TimesFMModel.fromPretrained()
webgpu
wasm
webgl
The engine tries providers in order: webgpu → wasm → webgl, falling back to the next available one on failure.
load() accepts:
load()
fetch()
ArrayBuffer
import { TimesFMModel, createForecastConfig } from '@agentix-e/timesfm-core';import { TimesFMWebInferenceEngine } from '@agentix-e/timesfm-web';const engine = new TimesFMWebInferenceEngine(config);await engine.load('/models/timesfm-2.5.onnx');const model = await TimesFMModel.fromPretrained({ modelPath: '/models/timesfm-2.5.onnx', engine,});model.compile(createForecastConfig({ maxContext: 512, maxHorizon: 128 }));const result = await model.forecast(24, [inputData]); Copy
import { TimesFMModel, createForecastConfig } from '@agentix-e/timesfm-core';import { TimesFMWebInferenceEngine } from '@agentix-e/timesfm-web';const engine = new TimesFMWebInferenceEngine(config);await engine.load('/models/timesfm-2.5.onnx');const model = await TimesFMModel.fromPretrained({ modelPath: '/models/timesfm-2.5.onnx', engine,});model.compile(createForecastConfig({ maxContext: 512, maxHorizon: 128 }));const result = await model.forecast(24, [inputData]);
TimesFM Web Inference Engine — browser-compatible ONNX inference via onnxruntime-web (WASM / WebGPU / WebGL).
Implements the
IInferenceEngineinterface from @agentix-e/timesfm-core so it can be injected intoTimesFMModel.fromPretrained().Execution Providers
webgpuwasmwebglThe engine tries providers in order: webgpu → wasm → webgl, falling back to the next available one on failure.
Model Loading
load()accepts:fetch())ArrayBuffer(pre-loaded model data)Usage