Compare 5 state-of-the-art foundation models for time series forecasting — entirely client-side. No server. No Python. No install.
time-lm is a zero-install browser tool that runs five time-series foundation models locally on your device using ONNX Runtime Web and Transformers.js. Upload a CSV, pick a column, and get forecasts from all five models side by side — with error metrics, trend indicators, and a full comparison table.
All computation happens inside your browser tab. Your data never leaves your machine.
- 5 foundation models compared side by side in a single run
- Upload any CSV — date/time and numeric columns are auto-detected
- 3 built-in demo datasets (Sales, Traffic, Crypto) — no file needed to start
- Adjustable forecast horizon — 5 to 96 steps ahead
- Automatic RMSE backtesting on a held-out test slice for each model
- Uncertainty bands (p10/p90) where available
- Export to CSV — history + all model forecasts in one file
- Model weight caching — second runs are instant (browser Cache API)
- Progressive rendering — chart updates as each model finishes
- Fully offline after first load — weights are cached locally
- Private by design — zero data leaves the browser
| Model | Author | Year | Size | Engine | Notes |
|---|---|---|---|---|---|
| TimesFM 2.5 | Google Research | 2024 | ~1 GB | ONNX (WASM) | General-purpose; strongest on trends and seasonality |
| Chronos-2 | Amazon / Hugging Face | 2025 | ~130 MB | ONNX (WASM) | T5-based; native quantile output (p10/p50/p90) |
| Moirai | Salesforce AI | 2024 | ~0.5 MB | Transformers.js | PatchTST proxy until official ONNX export is available |
| Granite TTM | IBM | 2024 | ~0.2 MB | Transformers.js | Tiny Time Mixer; fastest startup, good for quick checks |
| TiRex | NX-AI | 2025 | ~140 MB | ONNX (WASM) | xLSTM architecture; strong on long, complex series |
First-run note: TimesFM downloads ~1 GB on first use. All other models are under 150 MB. Weights are cached in the browser after the first download — subsequent runs start in seconds.
open index.html
Drag the file into any modern browser. That's it.
Fork this repo, go to Settings → Pages, set source to the main branch root. Your app will be live at https://<your-username>.github.io/time-lm/.
The official hosted demo is available at timelm.ree.kz.
# Python
python -m http.server 8080
# Node.js
npx serve .Then open http://localhost:8080.
- Load data — drop a CSV file onto the upload zone, or click one of the three demo dataset buttons (Sales / Traffic / Crypto).
- Choose target column — the app auto-selects the most variable numeric column. Override via the dropdown.
- Set horizon — drag the slider to set how many future steps to predict (default: 30).
- Select models — uncheck any models you don't need (disabling TimesFM saves significant download time).
- Run forecast — click Run forecast. Models load and execute sequentially; the chart updates as each one finishes.
- Inspect results — compare RMSE, trend direction, and final predicted value in the comparison table.
- Export — click Download CSV to get history + all forecasts in a single file.
The app accepts any CSV with a header row. It auto-detects:
- Date/time column — ISO dates (
2024-01-15), times (14:00), or any label-like string in the first column. - Numeric target column — any column with at least 8 finite numeric values (commas in numbers are stripped automatically).
Minimum: 8 rows of numeric data.
Date,Sales
2024-01-01,142
2024-01-02,138
2024-01-03,155
...Browser
└── index.html (single file, ~1 700 lines)
├── UI: Tailwind CSS · Chart.js · Lucide icons
├── CSV parsing: PapaParse
├── ONNX inference: onnxruntime-web (WASM worker)
│ ├── TimesFM 2.5 (pdufour/timesfm-2.5-200m-transformers-onnx)
│ ├── Chronos-2 (kashif/chronos-2-onnx)
│ └── TiRex (NX-AI/TiRex)
└── Transformers.js
├── Moirai proxy (onnx-community/granite-timeseries-patchtst)
└── Granite TTM (onnx-community/granite-timeseries-patchtsmixer)
Inference pipeline (per model):
- History is extracted from the CSV and normalised.
- Context window is padded/truncated to the model's expected input length.
- ONNX session runs in a WASM worker (non-blocking).
- Output is de-normalised and appended to the chart.
- A backtest RMSE is computed on a held-out tail slice (≤16 points) to rank models.
Hybrid decomposition (Moirai / Granite TTM): PatchTST and PatchTSMixer were trained on ETTh1 electricity data, so raw inference on arbitrary series produces artefacts. The app applies OLS trend + peak-to-peak seasonal decomposition first, feeds only the residuals to the neural model, and recombines — limiting the neural contribution to ±30% to keep the statistical base dominant.
Statistical fallback:
If a model's ONNX weights cannot be loaded (e.g. Chronos-2 Gather-op type mismatch in some browser/WASM combinations), the app transparently falls back to a linear-trend + seasonal ETS model and marks the result ETS fallback in the status column.
| Browser | Status |
|---|---|
| Chrome / Edge 113+ | Fully supported |
| Firefox 115+ | Supported |
| Safari 17+ | Supported (WASM SIMD required) |
| Mobile Chrome | Supported (desktop mode recommended for large models) |
WebGPU acceleration is not yet enabled; all inference runs on the CPU via WASM.
| Library | Version | Purpose |
|---|---|---|
| Tailwind CSS | CDN | UI layout and styling |
| Chart.js | CDN | Time-series chart |
| PapaParse | 5.4.1 | CSV parsing |
| Lucide | 0.469.0 | Icons |
| jQuery | 3.7.1 | DOM utilities |
| onnxruntime-web | 1.26.0 | ONNX inference in WASM |
| Transformers.js | 3.8.1 | Hugging Face model loader |
All loaded from public CDNs. No npm, no bundler, no build step.
- WebGPU execution provider for GPU-accelerated inference
- Multi-variate forecasting (multiple target columns)
- Additional models: Lag-Llama, Moirai-MoE (when official ONNX is available)
- Forecast confidence interval visualisation on the chart
- PWA / offline-first manifest
Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.
Good first issues:
- Add a new ONNX-exportable foundation model
- Improve mobile layout
- Add WebGPU support via
ort.env.wasm.proxy = false+ WebGPU EP
MIT — use it, fork it, ship it.
This project stands on the shoulders of:
- TimesFM — Google Research
- Chronos — Amazon Science
- Moirai — Salesforce AI Research
- Granite Time Series — IBM Research
- TiRex — NX-AI
- ONNX Runtime Web — Microsoft
- Transformers.js — Hugging Face