chronos-forecasting

amazon-scienceApache-2.0活跃维护

把时间序列当成语言来建模的预训练预测模型,基于 Transformer 架构,可直接用于零样本或微调预测,省去从零训练的成本。

Chronos: Pretrained Models for Time Series Forecasting

v2.3.2发布于 2026-09-08 14:06 UTC6,282star +9 / 7 天769fork同步于 2026-11-10 11:34 UTC

怎么上手

由 README 提炼,执行前请确认
pip install chronos-forecasting
pip install 'pandas[pyarrow]'
硬件要求按 README 说明

README 未给出显存或 CPU 要求;示例用 device_map="cuda" 加载模型,说明可跑 GPU,但未列厂商型号。模型最小 8M、最大 710M 参数,CPU 推理可行性 README 未说明。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

亚马逊开源的预训练时间序列预测模型库,零样本即可对单变量、多变量序列做概率预测

把时间序列当成语言来建模的预训练预测模型,基于 Transformer 架构,可直接用于零样本或微调预测,省去从零训练的成本。

核心能力

  • Chronos-2 支持单变量、多变量及带协变量的零样本预测
  • Chronos-Bolt 用分块编码加直接多步解码,比同尺寸原版快至多 250 倍
  • 提供 8M 到 710M 多种尺寸预训练权重,按需选精度与速度
  • predict_df 直接吃 pandas DataFrame,输出分位数概率预测区间
  • 附 fev 基准包与 SageMaker、AutoGluon-Cloud 部署路径

容易踩的坑

首次运行会从 HuggingFace 下载预训练权重(如 amazon/chronos-2),需联网且占磁盘;示例读 parquet 需额外装 pandas[pyarrow],画图需 matplotlib;Chronos-2 与 Chronos-Bolt、原版 Chronos 的 Pipeline 类不同,别混用加载方式。

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本v2.3.2
  1. v2.3.2最新正式版2026-09-08 · 2026-09-08 14:06 UTC

    What's Changed

    New Contributors

    Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.3.1...v2.3.2

  2. v2.3.12026-07-02 · 2026-07-02 08:22 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.3.0...v2.3.1

  3. v2.3.02.3.02026-06-18 · 2026-06-18 11:30 UTC
    查看更新说明

    What's Changed

    🚀 Highlights

    • New cloud deployment guide: run Chronos-2 on AWS in 3 lines of code
    • Fine-tuning with Chronos2Pipeline.fit() now supports larger-than-memory datasets
    • New efficient preprocessing module chronos.chronos2.preprocess resulting in up to 20x faster input preprocessing for Chronos-2
    • Support for transformers>=5 and pandas>=3

    ❗Deprecations & breaking changes

    • When providing inputs to Chronos2Pipeline as a list[dict], all dictionaries must share the same schema (same number of target dimensions and same covariate keys). To forecast inputs with different schemas, loop over them and call the model once per schema.
      # ❌ Different covariate keys across items — no longer allowed
      pipeline.predict([
          {"target": [...], "past_covariates": {"price": [...], "promo": [...]}},
          {"target": [...], "past_covariates": {"price": [...]}},
      ])
      
      # ❌ Mixed univariate and multivariate targets — no longer allowed
      pipeline.predict([
          {"target": np.zeros(100)},       # shape (history_length,)
          {"target": np.zeros((3, 100))},  # shape (n_variates, history_length)
      ])
      
    • Following methods have been deprecated. Please use chronos.chronos2.preprocess.from_* and helpers from chronos.df_utils instead.
      • Input preparation methods in chronos.chronos2.dataset:.
        • Chronos2Dataset.convert_inputs
        • validate_and_prepare_single_dict_task
        • convert_list_of_tensors_input_to_list_of_dicts_input
        • convert_tensor_input_to_list_of_dicts_input
        • convert_fev_window_to_list_of_dicts_input
      • DataFrame utilities in chronos.df_utils:
        • convert_df_input_to_list_of_dicts_input
        • validate_df_inputs
    • Removed dependency on scikit-learn

    ✨ New features

    🐛 Bugfixes & improvements

    📚 Documentation

    New Contributors

  4. v2.2.22.2.22025-12-17 · 2025-12-17 18:13 UTC
    查看更新说明
  5. v2.2.12.2.12025-12-16 · 2025-12-16 12:08 UTC
    查看更新说明

    What's Changed

    Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.2.0...v2.2.1

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Chronos: Pretrained Models for Time Series Forecasting

    preprint preprint huggingface huggingface fev aws faq License: MIT

    🚀 News

    • 5 Jun 2026: ☁️ Deploy Chronos-2 to AWS with AutoGluon-Cloud — real-time, serverless, or batch inference in 3 lines of code, pandas DataFrames in, forecasts out. See the new deployment guide.
    • 30 Dec 2025: 🧠 Deploy Chronos-2 to AWS with Amazon SageMaker JumpStart — production-ready real-time endpoints on CPU or GPU, ready to integrate into your existing AWS workflows. See the deployment tutorial.
    • 20 Oct 2025: 🚀 Chronos-2 released. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 achieves the best performance on fev-bench, GIFT-Eval and Chronos Benchmark II amongst pretrained models. Check out this notebook to get started with Chronos-2.
    • 12 Dec 2024: 📊 We released fev, a lightweight package for benchmarking time series forecasting models based on the Hugging Face datasets library.
    • 26 Nov 2024: ⚡️ Chronos-Bolt models released on HuggingFace. Chronos-Bolt models are more accurate (5% lower error), up to 250x faster and 20x more memory efficient than the original Chronos models of the same size!
    • 13 Mar 2024: 🚀 Chronos paper and inference code released.

    ✨ Introduction

    This package provides an interface to the Chronos family of pretrained time series forecasting models. The following model types are supported.

    • Chronos-2: Our latest model with significantly enhanced capabilities. It offers zero-shot support for univariate, multivariate, and covariate-informed forecasting tasks. Chronos-2 delivers state-of-the-art zero-shot performance across multiple benchmarks (including fev-bench and GIFT-Eval), with the largest improvements observed on tasks that include exogenous features. It also achieves a win rate of over 90% against Chronos-Bolt in head-to-head comparisons. To learn more about Chronos, check out the technical report.
    • Chronos-Bolt: A patch-based variant of Chronos. It chunks the historical time series context into patches of multiple observations, which are then input into the encoder. The decoder then uses these representations to directly generate quantile forecasts across multiple future steps—a method known as direct multi-step forecasting. Chronos-Bolt models are up to 250 times faster and 20 times more memory-efficient than the original Chronos models of the same size. To learn more about Chronos-Bolt, check out this blog post.
    • Chronos: The original Chronos family which is based on language model architectures. A time series is transformed into a sequence of tokens via scaling and quantization, and a language model is trained on these tokens using the cross-entropy loss. Once trained, probabilistic forecasts are obtained by sampling multiple future trajectories given the historical context. To learn more about Chronos, check out the publication.

    Available Models

    Model IDParameters
    amazon/chronos-2120M
    autogluon/chronos-2-synth120M
    autogluon/chronos-2-small28M
    amazon/chronos-bolt-tiny9M
    amazon/chronos-bolt-mini21M
    amazon/chronos-bolt-small48M
    amazon/chronos-bolt-base205M
    amazon/chronos-t5-tiny8M
    amazon/chronos-t5-mini20M
    amazon/chronos-t5-small46M
    amazon/chronos-t5-base200M
    amazon/chronos-t5-large710M

    📈 Usage

    To perform inference with Chronos, the easiest way is to install this package through pip:

    pip install chronos-forecasting
    

    [!TIP] For production use, we recommend deploying Chronos-2 to Amazon SageMaker. Two options:

    • AutoGluon-Cloud (recommended) — high-level Python API. Pandas DataFrames in, forecasts out. Real-time, serverless, and batch inference out of the box.
    • SageMaker JumpStart — production-ready real-time endpoints on CPU or GPU, ready to integrate into your existing AWS workflows.

    Forecasting

    A minimal example showing how to perform forecasting using Chronos-2:

    import pandas as pd  # requires: pip install 'pandas[pyarrow]'
    from chronos import Chronos2Pipeline
    
    pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda")
    
    # Load historical target values and past values of covariates
    context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
    
    # (Optional) Load future values of covariates
    test_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet")
    future_df = test_df.drop(columns="target")
    
    # Generate predictions with covariates
    pred_df = pipeline.predict_df(
        context_df,
        future_df=future_df,
        prediction_length=24,  # Number of steps to forecast
        quantile_levels=[0.1, 0.5, 0.9],  # Quantile for probabilistic forecast
        id_column="id",  # Column identifying different time series
        timestamp_column="timestamp",  # Column with datetime information
        target="target",  # Column(s) with time series values to predict
    )
    

    We can now visualize the forecast:

    import matplotlib.pyplot as plt  # requires: pip install matplotlib
    
    ts_context = context_df.set_index("timestamp")["target"].tail(256)
    ts_pred = pred_df.set_index("timestamp")
    ts_ground_truth = test_df.set_index("timestamp")["target"]
    
    ts_context.plot(label="historical data", color="xkcd:azure", figsize=(12, 3))
    ts_ground_truth.plot(label="future data (ground truth)", color="xkcd:grass green")
    ts_pred["predictions"].plot(label="forecast", color="xkcd:violet")
    plt.fill_between(
        ts_pred.index,
        ts_pred["0.1"],
        ts_pred["0.9"],
        alpha=0.7,
        label="prediction interval",
        color="xkcd:light lavender",
    )
    plt.legend()
    

    Example Notebooks

    📝 Citation

    If you find Chronos models useful for your research, please consider citing the associated papers:

    @article{ansari2024chronos,
      title={Chronos: Learning the Language of Time Series},
      author={Ansari, Abdul Fatir and Stella, Lorenzo and Turkmen, Caner and Zhang, Xiyuan, and Mercado, Pedro and Shen, Huibin and Shchur, Oleksandr and Rangapuram, Syama Syndar and Pineda Arango, Sebastian and Kapoor, Shubham and Zschiegner, Jasper and Maddix, Danielle C. and Mahoney, Michael W. and Torkkola, Kari and Gordon Wilson, Andrew and Bohlke-Schneider, Michael and Wang, Yuyang},
      journal={Transactions on Machine Learning Research},
      issn={2835-8856},
      year={2024},
      url={https://openreview.net/forum?id=gerNCVqqtR}
    }
    
    @article{ansari2025chronos2,
      title        = {Chronos-2: From Univariate to Universal Forecasting},
      author       = {Abdul Fatir Ansari and Oleksandr Shchur and Jaris Küken and Andreas Auer and Boran Han and Pedro Mercado and Syama Sundar Rangapuram and Huibin Shen and Lorenzo Stella and Xiyuan Zhang and Mononito Goswami and Shubham Kapoor and Danielle C. Maddix and Pablo Guerron and Tony Hu and Junming Yin and Nick Erickson and Prateek Mutalik Desai and Hao Wang and Huzefa Rangwala and George Karypis and Yuyang Wang and Michael Bohlke-Schneider},
      journal      = {arXiv preprint arXiv:2510.15821},
      year         = {2025},
      url          = {https://arxiv.org/abs/2510.15821}
    }
    

    🛡️ Security

    See CONTRIBUTING for more information.

    📃 License

    This project is licensed under the Apache-2.0 License.