首次运行会从 HuggingFace 下载预训练权重(如 amazon/chronos-2),需联网且占磁盘;示例读 parquet 需额外装 pandas[pyarrow],画图需 matplotlib;Chronos-2 与 Chronos-Bolt、原版 Chronos 的 Pipeline 类不同,别混用加载方式。
chronos-forecasting
amazon-scienceApache-2.0活跃维护把时间序列当成语言来建模的预训练预测模型,基于 Transformer 架构,可直接用于零样本或微调预测,省去从零训练的成本。
Chronos: Pretrained Models for Time Series Forecasting
pip install chronos-forecasting
pip install 'pandas[pyarrow]'README 未给出显存或 CPU 要求;示例用 device_map="cuda" 加载模型,说明可跑 GPU,但未列厂商型号。模型最小 8M、最大 710M 参数,CPU 推理可行性 README 未说明。
亚马逊开源的预训练时间序列预测模型库,零样本即可对单变量、多变量序列做概率预测
把时间序列当成语言来建模的预训练预测模型,基于 Transformer 架构,可直接用于零样本或微调预测,省去从零训练的成本。
核心能力
- Chronos-2 支持单变量、多变量及带协变量的零样本预测
- Chronos-Bolt 用分块编码加直接多步解码,比同尺寸原版快至多 250 倍
- 提供 8M 到 710M 多种尺寸预训练权重,按需选精度与速度
- predict_df 直接吃 pandas DataFrame,输出分位数概率预测区间
- 附 fev 基准包与 SageMaker、AutoGluon-Cloud 部署路径
容易踩的坑
- v2.3.2最新正式版2026-09-08 · 2026-09-08 14:06 UTC
What's Changed
- Pass import_allowlist when loading LoRA adapters with peft>=0.20 by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/524
- Handle missing is_decoder in Transformers 5 by @medisean in https://github.com/amazon-science/chronos-forecasting/pull/520
- Preserve precision when unscaling Chronos-2 and Chronos-Bolt forecasts by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/532
New Contributors
- @medisean made their first contribution in https://github.com/amazon-science/chronos-forecasting/pull/520
Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.3.1...v2.3.2
- v2.3.12026-07-02 · 2026-07-02 08:22 UTC
查看更新说明
What's Changed
- Fix training from a lazy dataset & add example with memmapped
datasets.Datasetby @shchur in https://github.com/amazon-science/chronos-forecasting/pull/515
Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.3.0...v2.3.1
- Fix training from a lazy dataset & add example with memmapped
- 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.preprocessresulting in up to 20x faster input preprocessing for Chronos-2 - Support for
transformers>=5andpandas>=3
❗Deprecations & breaking changes
- When providing inputs to
Chronos2Pipelineas alist[dict], all dictionaries must share the same schema (same number oftargetdimensions 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 fromchronos.df_utilsinstead.- Input preparation methods in
chronos.chronos2.dataset:.Chronos2Dataset.convert_inputsvalidate_and_prepare_single_dict_taskconvert_list_of_tensors_input_to_list_of_dicts_inputconvert_tensor_input_to_list_of_dicts_inputconvert_fev_window_to_list_of_dicts_input
- DataFrame utilities in
chronos.df_utils:convert_df_input_to_list_of_dicts_inputvalidate_df_inputs
- Input preparation methods in
- Removed dependency on
scikit-learn
✨ New features
- Add support for
transformers>=5.0by @kashif in https://github.com/amazon-science/chronos-forecasting/pull/416 - New module
chronos.chronos2.preprocesswith efficient preprocessing methods for Chronos-2 by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/466, https://github.com/amazon-science/chronos-forecasting/pull/493, https://github.com/amazon-science/chronos-forecasting/pull/506 - Public API of
Chronos2Pipelinenow accepts preprocessed data (e.g. backed by a memory-mapped Hugging Facedatasets.Dataset) by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/507, https://github.com/amazon-science/chronos-forecasting/pull/512
🐛 Bugfixes & improvements
- Allow explicitly passing the frequency to
pipeline.predict_dfby @shchur in https://github.com/amazon-science/chronos-forecasting/pull/449 - Fix
XDG_CACHE_HOMEtypo inboto_utilsby @shaun0927 in https://github.com/amazon-science/chronos-forecasting/pull/488 - Defer boto3 import and raise actionable
ImportErrorfor s3:// loads by @shaun0927 in https://github.com/amazon-science/chronos-forecasting/pull/489 - Fix pip install command for chronos-forecasting by @Arseni1919 in https://github.com/amazon-science/chronos-forecasting/pull/481
- Minor fixes and improvements by @abdulfatir, @shchur in https://github.com/amazon-science/chronos-forecasting/pull/467, https://github.com/amazon-science/chronos-forecasting/pull/505, https://github.com/amazon-science/chronos-forecasting/pull/510, https://github.com/amazon-science/chronos-forecasting/pull/511,
📚 Documentation
- Describe deployment options via AutoGluon-Cloud by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/503
- Update notebook on Chronos-2 deployment to SageMaker by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/444
New Contributors
- @Arseni1919 made their first contribution in https://github.com/amazon-science/chronos-forecasting/pull/481
- @shaun0927 made their first contribution in https://github.com/amazon-science/chrono
- v2.2.22.2.22025-12-17 · 2025-12-17 18:13 UTC
查看更新说明
What's Changed
- Chronos-2: Add after_batch callback by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/436
- Speed up predict_df by @shchur in https://github.com/amazon-science/chronos-forecasting/pull/437
- Bump version from 2.2.1 to 2.2.2 by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/439
Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.2.1...v2.2.2
- v2.2.12.2.12025-12-16 · 2025-12-16 12:08 UTC
查看更新说明
What's Changed
- Chronos-2: Update quick start notebook with LoRA example by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/415
- Add unittests for
df_utilsby @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/414 - Chronos-2: Only pin_memory when device type is cuda by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/431
- Chronos-2: Add option to disable
DataParallelby @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/434 - Update version to 2.2.1 by @abdulfatir in https://github.com/amazon-science/chronos-forecasting/pull/435
Full Changelog: https://github.com/amazon-science/chronos-forecasting/compare/v2.2.0...v2.2.1
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Chronos: Pretrained Models for Time Series Forecasting
🚀 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 Facedatasetslibrary. - 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
📈 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
- Chronos-2 Quick Start
- Deploy Chronos-2 to AWS with AutoGluon-Cloud (recommended)
- Deploy Chronos-2 to AWS with SageMaker JumpStart
📝 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.