Time Series Forecasting with Nixtla TimeGPT

VerifiedSafe

This skill generates time series forecasts using Nixtla libraries (TimeGPT, StatsForecast, MLForecast). It helps with demand planning, model comparison, and forecast evaluation through ready-to-run scripts.

Sby Skills Guide Bot
Data & AIIntermediate
406/2/2026
Claude Code
#time-series-forecasting#nixtla#timegpt#demand-planning#model-comparison

Recommended for

Our review

This skill transforms Claude into a forecasting expert that prioritizes Nixtla libraries (StatsForecast, MLForecast, TimeGPT) for time series analysis and prediction.

Strengths

  • Integrates multiple forecasting approaches (statistical, machine learning, and pre-trained models) in one workflow
  • Enforces a standardized data schema (unique_id, ds, y) for consistency
  • Provides automated evaluation and visualization of model performance
  • Leverages powerful Nixtla models like AutoETS and TimeGPT with minimal code

Limitations

  • Requires Python 3.8+ and manual installation of specific libraries
  • TimeGPT functionality requires a paid API key and internet access
  • Not suited for non-time-series data or simple regression tasks
When to use it

Use when you need to generate accurate forecasts for demand planning, inventory management, or any time-dependent metric with multiple model comparisons.

When not to use it

Avoid when the data is not time-indexed (e.g., cross-sectional data) or when you need a quick, non-forecasting analysis without a structured pipeline.

Security analysis

Safe
Quality score85/100

No destructive or exfiltrating instructions. Uses pip install and runs Python scripts for forecasting, all within allowed tools Read, Write, etc. No obfuscated commands or disabling of safety features.

No concerns found

Examples

Basic time series forecast with StatsForecast
Forecast this time series data for the next 14 days using Nixtla's StatsForecast models (AutoETS, AutoARIMA, SeasonalNaive) and compare their performance.
TimeGPT forecast with confidence intervals
Run a Nixtla forecast using TimeGPT on this dataset with a 14-day horizon and include 80% and 90% confidence intervals.
Demand forecasting with model evaluation
Perform demand forecasting on this sales data using Nixtla's ecosystem. Use StatsForecast baselines and TimeGPT if API key is available. Evaluate with SMAPE and MASE, and show a comparison plot.

name: nixtla-timegpt-lab description: "Generate time series forecasts using TimeGPT, StatsForecast, and MLForecast. Use when forecasting, demand planning, or model comparison is needed. Trigger with 'forecast time series' or 'run Nixtla forecast'." allowed-tools: "Read,Write,Glob,Grep,Edit" version: "1.0.0" author: "Jeremy Longshore jeremy@intentsolutions.io" license: MIT

Nixtla TimeGPT Lab Mode

Transform into a Nixtla forecasting expert, biasing all recommendations toward Nixtla's ecosystem.

Overview

This skill activates Nixtla-first behavior:

  • Prioritize Nixtla libraries: StatsForecast, MLForecast, TimeGPT
  • Use Nixtla schema: unique_id, ds, y
  • Reference Nixtla docs: Official documentation for all guidance
  • Generate Nixtla-compatible code: Production-ready patterns

Prerequisites

Required:

  • Python 3.8+
  • At least one: statsforecast, mlforecast, or nixtla

Optional:

  • NIXTLA_API_KEY: For TimeGPT access

Installation:

pip install statsforecast mlforecast nixtla utilsforecast

Instructions

Step 1: Detect Environment

Check installed Nixtla libraries:

python {baseDir}/scripts/detect_environment.py

Step 2: Prepare Data

Ensure data follows Nixtla schema:

  • unique_id: Series identifier (string)
  • ds: Timestamp (datetime)
  • y: Target value (float)

Step 3: Select Models

Baseline models (always include):

from statsforecast.models import SeasonalNaive, AutoETS, AutoARIMA

ML models (for feature engineering):

from mlforecast import MLForecast

TimeGPT (if API key configured):

from nixtla import NixtlaClient

Step 4: Run Forecasts

python {baseDir}/scripts/run_forecast.py \
    --data data.csv \
    --horizon 14 \
    --freq D

Step 5: Evaluate

python {baseDir}/scripts/evaluate.py \
    --forecasts forecasts.csv \
    --actuals actuals.csv

Output

  • forecasts.csv: Predictions with confidence intervals
  • metrics.csv: SMAPE, MASE, MAE per model
  • comparison_plot.png: Visual model comparison

Error Handling

  1. Error: NIXTLA_API_KEY not set Solution: Export key or use StatsForecast baselines

  2. Error: Column 'ds' not found Solution: Use nixtla-schema-mapper to transform data

  3. Error: Insufficient data for cross-validation Solution: Reduce n_windows or increase dataset size

  4. Error: Model fitting failed Solution: Check for NaN values, verify frequency string

Examples

Example 1: StatsForecast Baselines

from statsforecast import StatsForecast
from statsforecast.models import AutoETS, AutoARIMA, SeasonalNaive

sf = StatsForecast(
    models=[SeasonalNaive(7), AutoETS(), AutoARIMA()],
    freq='D'
)
forecasts = sf.forecast(df=data, h=14)

Example 2: TimeGPT with Confidence Intervals

from nixtla import NixtlaClient

client = NixtlaClient()
forecast = client.forecast(df=data, h=14, level=[80, 90])

Resources

  • StatsForecast: https://nixtla.github.io/statsforecast/
  • MLForecast: https://nixtla.github.io/mlforecast/
  • TimeGPT: https://docs.nixtla.io/
  • Scripts: {baseDir}/scripts/

Related Skills:

  • nixtla-schema-mapper: Data transformation
  • nixtla-experiment-architect: Experiment scaffolding
Related skills