timesfm-ts - v1.0.0
    Preparing search index...

    Module web-engine

    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().

    Provider Speed Availability
    webgpu Fastest Chrome 113+, Edge
    wasm Good All modern browsers
    webgl Legacy Older browsers

    The engine tries providers in order: webgpu → wasm → webgl, falling back to the next available one on failure.

    load() accepts:

    • A URL string (fetched via fetch())
    • An ArrayBuffer (pre-loaded model data)
    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]);

    Classes

    TimesFMWebInferenceEngine

    Interfaces

    WebEngineLogger