zlanqing/codex-claude-academic-skills/timesfm-forecasting
Claude Code and agent skill by zlanqing/codex-claude-academic-skills
- community
Checking that the SKILL.md file is still in the repository.
Zero-shot time series forecasting with Google's TimesFM foundation model. Use for any univariate time series (sales, sensors, energy, vitals, weather) without training a custom model. Supports CSV/DataFrame/array inputs with point forecasts and prediction intervals. Includes a preflight system checker script to verify RAM/GPU before first use.
Install
npx vskill@latest install zlanqing/codex-claude-academic-skills/timesfm-forecastingSKILL.md
The same SKILL.md was published earlier as freedomintelligence/openclaw-medical-skills/timesfm-forecasting.
TimesFM Forecasting
Overview
TimesFM (Time Series Foundation Model) is a pretrained decoder-only foundation model developed by Google Research for time-series forecasting. It works zero-shot — feed it any univariate time series and it returns point forecasts with calibrated quantile prediction intervals, no training required.
This skill wraps TimesFM for safe, agent-friendly local inference. It includes a mandatory preflight system checker that verifies RAM, GPU memory, and disk space before the model is ever loaded so the agent never crashes a user's machine.
Key numbers: TimesFM 2.5 uses 200M parameters (~800 MB on disk, ~1.5 GB in RAM onCPU, ~1 GB VRAM on GPU). The archived v1/v2 500M-parameter model needs ~32 GB RAM.Always run the system checker first.
When to Use This Skill
Use this skill when:
- Forecasting any univariate time series (sales, demand, sensor, vitals, price, weather)
- You need zero-shot forecasting without training a custom model
- You want probabilistic forecasts with calibrated prediction intervals (quantiles)
- You have time series of any length (the model handles 1–16,384 context points)
- You need to batch-forecast hundreds or thousands of series efficiently
- You want a foundation model approach instead of hand-tuning ARIMA/ETS parameters
Do not use this skill when:
- You need classical statistical models with coefficient interpretation → use
statsmodels - You need time series classification or clustering → use
aeon - You need multivariate vector autoregression or Granger causality → use
statsmodels - Your data is tabular (not temporal) → use
scikit-learn
Note on Anomaly Detection: TimesFM does not have built-in anomaly detection, but you canuse the quantile forecasts as prediction intervals — values outside the 90% CI (q10–q90)are statistically unusual. See theexamples/anomaly-detection/directory for a full example.
⚠️ Mandatory Preflight: System Requirements Check
CRITICAL — ALWAYS run the system checker before loading the model for the first time.
This script checks:
- Available RAM — warns if below 4 GB, blocks if below 2 GB
- GPU availability — detects CUDA/MPS devices and VRAM
- Disk space — verifies room for the ~800 MB model download
- Python version — requires 3.10+
- Existing installation — checks if
timesfmandtorchare installed
Note: Model weights are NOT stored in this repository. TimesFM weights (~800 MB)download on-demand from HuggingFace on first use and cache in~/.cache/huggingface/.The preflight checker ensures sufficient resources before any download begins.
Hardware Requirements by Model Version
| Model | Parameters | RAM (CPU) | VRAM (GPU) | Disk | Context | |
|---|---|---|---|---|---|---|
| TimesFM 2.5 (recommended) | 200M | ≥ 4 GB | ≥ 2 GB | ~800 MB | up to 16,384 | |
| TimesFM 2.0 (archived) | 500M | ≥ 16 GB | ≥ 8 GB | ~2 GB | up to 2,048 | |
| TimesFM 1.0 (archived) | 200M | ≥ 8 GB | ≥ 4 GB | ~800 MB | up to 2,048 |
Recommendation: Always use TimesFM 2.5 unless you have a specific reason to use anolder checkpoint. It is smaller, faster, and supports 8× longer context.
🔧 Installation
Step 1: Verify System (always first)
Step 2: Install TimesFM
Step 3: Install PyTorch for Your Hardware
Step 4: Verify Installation
🎯 Quick Start
Minimal Example (5 Lines)
Forecast from CSV
Forecast with Covariates (XReg)
TimesFM 2.5+ supports exogenous variables through forecast_with_covariates(). Requires timesfm[xreg].
| Covariate Type | Description | Example | |
|---|---|---|---|
dynamic_numerical | Time-varying numeric | price, temperature, promotion spend | |
dynamic_categorical | Time-varying categorical | holiday flag, day of week | |
static_numerical | Per-series numeric | store size, account age | |
static_categorical | Per-series categorical | store type, region, product category |
XReg Modes:
"xreg + timesfm"(default): TimesFM forecasts first, then XReg adjusts residuals"timesfm + xreg": XReg fits first, then TimesFM forecasts residuals
Seeexamples/covariates-forecasting/for a complete example with synthetic retail data.
Anomaly Detection (via Quantile Intervals)
TimesFM does not have built-in anomaly detection, but the quantile forecasts naturally provide prediction intervals that can detect anomalies:
| Severity | Condition | Interpretation | |
|---|---|---|---|
| Normal | Inside 80% CI | Expected behavior | |
| Warning | Outside 80% CI | Unusual but possible | |
| Critical | Outside 90% CI | Statistically rare (< 10% probability) |
Seeexamples/anomaly-detection/for a complete example with visualization.
📊 Understanding the Output
Quantile Forecast Structure
TimesFM returns (point_forecast, quantile_forecast):
- `point_forecast`: shape
(batch, horizon)— the median (0.5 quantile) - `quantile_forecast`: shape
(batch, horizon, 10)— ten slices:
| Index | Quantile | Use | |
|---|---|---|---|
| 0 | Mean | Average prediction | |
| 1 | 0.1 | Lower bound of 80% PI | |
| 2 | 0.2 | Lower bound of 60% PI | |
| 3 | 0.3 | — | |
| 4 | 0.4 | — | |
| 5 | 0.5 | Median (= `point_forecast`) | |
| 6 | 0.6 | — | |
| 7 | 0.7 | — | |
| 8 | 0.8 | Upper bound of 60% PI | |
| 9 | 0.9 | Upper bound of 80% PI |
Extracting Prediction Intervals
🔧 ForecastConfig Reference
All forecasting behavior is controlled by timesfm.ForecastConfig:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingscientific-toolkit-skill/references/scientific-skills/timesfm-forecasting/SKILL.md
Popularity
- Repository stars
- 1,141
- Repository forks
- 90
- 7-day trend score
- 35
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/zlanqing/codex-claude-academic-skills/timesfm-forecasting)