timesfm
Forecast time series data using Google's TimesFM foundation model with zero-shot prediction. Use when: forecasting sales or demand, predicting server metrics, financial time series analysis, anomaly detection without training custom models.
What this skill does
# TimesFM
## Overview
TimesFM is a 200M-parameter foundation model by Google Research, pretrained on 100 billion real-world time points. It performs zero-shot forecasting across domains — no fine-tuning required. Feed it historical data, get predictions immediately.
## Instructions
### Installation
```bash
pip install timesfm
```
### Basic Forecasting
```python
import timesfm
import numpy as np
# Initialize model
tfm = timesfm.TimesFm(
hparams=timesfm.TimesFmHparams(
per_core_batch_size=32,
horizon_len=30,
),
checkpoint=timesfm.TimesFmCheckpoint(
huggingface_repo_id="google/timesfm-2.0-200m-pytorch",
),
)
# Your historical data (e.g., daily sales for 1 year)
history = np.array([120, 135, 128, 142, 155, 148, 160, ...])
# Forecast next 30 days
forecasts = tfm.forecast([history], freq=[1])
predictions = forecasts[0] # shape: (30,)
```
### Frequency Parameter
Set `freq` to match your data granularity:
- `0`: High frequency (seconds/minutes)
- `1`: Daily
- `2`: Weekly/Monthly
### Multi-Series Forecasting
```python
# Forecast multiple product categories at once
series = [sales_electronics, sales_clothing, sales_food]
forecasts = tfm.forecast(series, freq=[1, 1, 1])
# Returns list of 3 forecast arrays
```
## Examples
**Example 1: Demand forecasting**
Input: 365 days of daily product sales data.
Output: 30-day forecast with the model capturing weekly seasonality and growth trend automatically.
```python
history = load_csv("daily_sales.csv")["quantity"].values
forecast = tfm.forecast([history], freq=[1])[0]
print(f"Next 7 days: {forecast[:7]}")
# Next 7 days: [182, 175, 190, 168, 195, 201, 178]
```
**Example 2: Server metrics anomaly detection**
Input: 720 hours (30 days) of CPU utilization.
Output: Forecast next 24 hours. Flag if actual exceeds forecast by 2x standard deviation.
```python
cpu_history = get_metrics("cpu_percent", days=30)
forecast = tfm.forecast([cpu_history], freq=[0])[0]
threshold = forecast.mean() + 2 * forecast.std()
```
## Guidelines
- Provide at least 3x the forecast horizon as history (forecasting 30 days? give 90+ days history)
- TimesFM works best on data with clear patterns (seasonality, trends)
- For noisy data, smooth with rolling average before feeding to the model
- Compare against a naive baseline (last period's values) to validate improvement
- The model runs on CPU; GPU speeds up batch processing of many series
Related in Sales & CRM
process-mapper
IncludedUse when a BizOps lead, COO, or process-improvement owner needs to document an end-to-end business process (procurement, employee onboarding, incident handoff, customer-onboarding, claims adjudication) in BPMN-style notation, measure cycle times by stage, surface where work spends most of its time waiting vs. being worked, and quantify the gap between processing time and total elapsed time. Pairs Lean / Six Sigma / Theory-of-Constraints canon with deterministic stdlib-only Python tools to produce a process map, a ranked bottleneck list (with severity + root-cause hypothesis), and a cycle-time analysis (P50, P90, value-add ratio, Little's-Law throughput). Distinct from sales-pipeline, system-reliability (SLO), and strategic-OKR work — this is tactical process documentation for internal operations.
payment-integration
IncludedIntegrate payments with SePay (VietQR), Polar, Stripe, Paddle (MoR subscriptions), Creem.io (licensing). Checkout, webhooks, subscriptions, QR codes, multi-provider orders.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.
customer-success-manager
IncludedMonitors customer health, predicts churn risk, and identifies expansion opportunities using weighted scoring models for SaaS customer success
sales-engineer
IncludedAnalyzes RFP/RFI responses for coverage gaps, builds competitive feature comparison matrices, and plans proof-of-concept (POC) engagements for pre-sales engineering. Use when responding to RFPs, bids, or proposal requests; comparing product features against competitors; planning or scoring a customer POC or sales demo; preparing a technical proposal; or performing win/loss competitor analysis. Handles tasks described as 'RFP response', 'bid response', 'proposal response', 'competitor comparison', 'feature matrix', 'POC planning', 'sales demo prep', or 'pre-sales engineering'.