npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentix-e/timesfm-core

v1.0.0

Published

Core inference engine for TimesFM — zero-shot time series forecasting

Readme

@agentix-e/timesfm-core

Core inference engine for TimesFM — zero-shot time series forecasting powered by ONNX Runtime.

npm API Docs Benchmark Coverage

Overview

@agentix-e/timesfm-core is the heart of timesfm-ts — a production-grade Node.js/TypeScript implementation of Google Research's TimesFM 2.5 (200M parameter decoder-only transformer). It provides zero-shot univariate time-series forecasting with calibrated prediction intervals, no training required.

Architecture

Raw Series → [NaN Handler] → [Pad/Truncate] → [Patch Split] → [RevIN Norm]
→ [ONNX Runtime] → [RevIN Denorm] → [Flip Invariance] → [Quantile Calibration]
→ Forecasts

Installation

npm install @agentix-e/timesfm-core

Requires Node.js ≥ 22.

Quick Start

import { TimesFMModel, downloadModel, createForecastConfig } from '@agentix-e/timesfm-core';

// Auto-download model (~885 MB, first time only, cached thereafter)
const modelPath = await downloadModel();

const model = await TimesFMModel.fromPretrained({ modelPath });
model.compile(createForecastConfig({ maxContext: 1024, maxHorizon: 256 }));

const { pointForecast, quantileForecast } = await model.forecast(24, [
  new Float32Array([1, 2, 3 /* ... */]),
]);

console.log(pointForecast); // Shape: [1, 24]
console.log(quantileForecast); // Shape: [1, 24, 10]

await model.dispose();

API Documentation

📚 Full API reference: agentix-e.github.io/timesfm-ts/api/modules/timesfm-core.html

Key exports:

  • TimesFMModel — Main model class (fromPretrained, compile, forecast, forecastWithCovariates)
  • IInferenceEngine, RawModelOutput — Engine abstraction (implementations: @agentix-e/timesfm-node, @agentix-e/timesfm-web)
  • downloadModel / defaultModelPath / isModelCached — Model download & cache management
  • createForecastConfig / validateAndNormalizeConfig — Configuration builder
  • preprocess / postProcess — Preprocessing & postprocessing pipelines
  • decode — Autoregressive decode loop
  • mae, rmse, mape, smape, mase, r2Score — Evaluation metrics
  • Utility exports: cleanSeries, stripLeadingNaNs, linearInterpolateNaNs, computeStats, revin, revinBatch

Model Download

import { downloadModel } from '@agentix-e/timesfm-core';

// Default: ~/.cache/timesfm-ts/timesfm-2.5.onnx
const path = await downloadModel();

// With proxy (corporate network)
const path = await downloadModel({
  proxy: { url: 'http://proxy.company.com:8080', username: 'user', password: 'pass' },
  onProgress: (received, total, speed) => console.log(`${received}/${total} MB @ ${speed} MB/s`),
});

Proxy can also be configured via environment variables:

  • TIMESFM_PROXY_URL / TIMESFM_PROXY_USERNAME / TIMESFM_PROXY_PASSWORD
  • TIMESFM_PROXY_PASSWORD_FILE — read password from a file (Docker/K8s secrets)
  • Standard HTTPS_PROXY / HTTP_PROXY

License

Apache 2.0