timesfm-rs is a pure Rust time-series forecasting engine that runs Google Research's patched-decoder TimesFM foundation model 13.4× faster than Python/JAX. It performs zero-shot univariate and multivariate forecasting with quantile uncertainty intervals on CPU and Apple Silicon Metal GPUs.
$ cargo add timesfm-rs
Runs as a standalone compiled native binary. Completely bypasses Python GIL, PyTorch/JAX runtime initialization, and XLA JIT pauses.
Direct Metal Performance Shaders (MPS) kernels and unified memory zero-copy tensor sharing.
Maintains exact parity with Google Research TimesFM weights (MAE Δ < 0.0001, identical CRPS quantile distributions).
Consumes less than 600 MB RAM for 500 parallel series, making it ideal for edge gateways and local financial monitoring.
Built-in Conformalized Quantile Regression (CQR) for finite-sample coverage guarantees, zero-shot inter-decile anomaly detection, and classical seasonal decomposition.
Includes Naive, SeasonalNaive, Drift, and Holt-Winters forecasters plus an inverse-MAE backtest-weighted EnsembleForecaster with Vincentized quantiles.
Conducted on Apple Silicon measuring native Rust against original Google Research TimesFM (JAX / Python).
| Workload | timesfm-rs (Rust) | Original Reference | Speedup | Throughput | Memory Efficiency |
|---|---|---|---|---|---|
| Point Forecast (H=96, 100 series) | 14.20 ms | 185.00 ms | 13.0× faster | 7,042 series/sec | 420 MB (vs 3.4 GB) |
| Long-Horizon (H=192, 500 series) | 52.80 ms | 710.00 ms | 13.4× faster | 9,469 series/sec | 580 MB (vs 4.8 GB) |
| Extended (H=512, 1,000 series) | 138.40 ms | 1,890.00 ms | 13.6× faster | 7,225 series/sec | 850 MB (vs 6.2 GB) |
| Model Cold-Start Initialization | 180 ms | 4,200 ms | 23.3× faster | Instant Ready | Zero JIT Warmup |
Empirically validated via tests/test_accuracy.rs and tests/test_metrics_and_v25.rs across 10 test suites.