TimeCopilot: How to Build a Forecasting Pipeline with Foundation Models and Anomaly Detection

TimeCopilot is a tool for building an end-to-end time series forecasting pipeline. It supports statistical, foundation, and GPU models, rolling cross-validation, and probabilistic forecasts with confidence intervals. A built-in LLM agent automatically selects the best model for the task and explains predictions in plain language. Anomalies are flagged automatically.

AI-processed from MarkTechPost; edited by Hamidun News
TimeCopilot: How to Build a Forecasting Pipeline with Foundation Models and Anomaly Detection
Source: MarkTechPost. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceMarkTechPost ↗
Editor-in-Chief
Key metric #1Loading and preparing panel data
Key metric #2Training models through rolling cross-validation
Evaluation using multiple metricsMAE, MAPE, RMSE

TimeCopilot — Python-library for building end-to-end time series forecasting pipelines. It combines classical statistical methods, foundation pretrained models, and an optional LLM-agent that automatically selects the best approach and explains the result. The library is aimed at analysts who need to quickly compare different approaches on real data without spending time on manual tuning of each model.

How the pipeline works

The authors demonstrate TimeCopilot on two datasets: a real airline passenger traffic dataset (classical benchmark) and a synthetic seasonal series with intentionally embedded anomalies. This choice allows for honest testing of the system — including on data where it is known in advance what exactly should be detected.

The workflow includes several stages:

  • Loading and preparing panel data
  • Training models through rolling cross-validation
  • Evaluation using multiple metrics: MAE, MAPE, RMSE
  • Generation of probabilistic forecasts with confidence intervals
  • Anomaly detection with visualization
  • Running an LLM-agent to select and explain the best model

Three classes of models

TimeCopilot supports three types of models that can be compared within a single experiment.

Statistical — classical methods: ARIMA, ETS, Theta and others. They are highly interpretable, work on small datasets with pronounced seasonality, and do not require GPU. They provide a reasonable baseline for almost any task.

Foundation — pretrained architectures for time series, trained on large corpora of data. This is an analog of language models for numerical sequences: they are capable of working out-of-the-box without retraining on a specific dataset.

GPU-accelerated — neural network models (for example, N-BEATS, TiDE) for large datasets with large forecasting horizons. They are connected optionally and are relevant when statistical methods are no longer sufficient.

Evaluation is conducted through rolling cross-validation with an expanding window: each model is trained on identical history and tested on the next horizon — this reveals true generalization ability rather than just fitting to training data.

Anomalies and uncertainty

Instead of a single "forecast line," TimeCopilot generates probabilistic predictions — a range of values with specified probability (80% or 95%). When planning inventory, load, or budget, this is practically useful: the organization sees pessimistic and optimistic corridors simultaneously.

In parallel with the forecast, a built-in anomaly detector works. On a synthetic series with artificial outliers, the system correctly separated normal behavior from non-standard. Anomaly flags are overlaid directly on the series visualization, which simplifies auditing and communication of results within the team.

LLM-agent explains the choice

The most unusual part is the optional LLM-agent. After evaluating all models, it studies the cross-validation results, selects the best model for a specific series, and generates a text explanation — why exactly this model is more accurate than others.

"The foundation model outperformed ARIMA due to nonlinear seasonality

with increasing amplitude" — this kind of explanation the agent generates automatically.

This is a step toward AutoML with auditable results: the analyst receives not just a recommendation, but a justification that can be included in a report or passed to a stakeholder without additional interpretation.

What this means

TimeCopilot lowers the barrier to entry for advanced forecasting: there is no need to manually tune dozens of models or interpret metrics independently — the LLM-agent takes on part of this work. For analytical teams working with business metrics, demand, or operational KPIs, this is a ready-made framework for a production-ready pipeline with human-readable justification for every decision.

Story

Key Questions Answered

How the pipeline works?

The authors demonstrate TimeCopilot on two datasets: a real airline passenger traffic dataset (classical benchmark) and a synthetic seasonal series with intentionally embedded anomalies. This choice allows for honest testing of the system — including on data where it is known in advance what exactly should be detected. The workflow includes several stages: Loading and preparing panel data Training models through rolling cross-validation Evaluation using multiple metrics: MAE, MAPE, RMSE Generation of probabilistic forecasts with confidence intervals Anomaly detection with v

What are the key details on Three classes of models?

TimeCopilot supports three types of models that can be compared within a single experiment. Statistical — classical methods: ARIMA, ETS, Theta and others. They are highly interpretable, work on small datasets with pronounced seasonality, and do not require GPU. They provide a reasonable baseline for almost any task. Foundation — pretrained architectures for time series, trained on large corpora of data. This is an analog of language models for numerical sequences: they are capable of working out-of-the-box without retraining on a specific dataset. GPU-accelerated — neural n

What are the key details on Anomalies and uncertainty?

Instead of a single "forecast line," TimeCopilot generates probabilistic predictions — a range of values with specified probability (80% or 95%). When planning inventory, load, or budget, this is practically useful: the organization sees pessimistic and optimistic corridors simultaneously. In parallel with the forecast, a built-in anomaly detector works. On a synthetic series with artificial outliers, the system correctly separated normal behavior from non-standard. Anomaly flags are overlaid directly on the series visualization, which simplifies auditing and communication

ZK
Zhemal Khamidun — CPO at Alpina Digital, product manager of AlpinaGPT. Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Autonomous AI Agents

Delegate Deep Research, Coding & Workflows to an AI Agent

Deploy autonomous multi-step execution with NomadNet Agent (agent.nomadnet.ai) — automated web research, data synthesis, code generation, and complex task orchestration.

Launch NomadNet Agent →NomadNet AI Platform
What do you think?
Loading comments…