Time Series Forecasting
Chronos
Safetensors
t5
time series
forecasting
foundation models
pretrained models
Instructions to use amazon/chronos-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Chronos
How to use amazon/chronos-2 with Chronos:
pip install chronos-forecasting
import pandas as pd from chronos import BaseChronosPipeline pipeline = BaseChronosPipeline.from_pretrained("amazon/chronos-2", device_map="cuda") # Load historical data context_df = pd.read_csv("https://autogluon.s3.us-west-2.amazonaws.com/datasets/timeseries/misc/AirPassengers.csv") # Generate predictions pred_df = pipeline.predict_df( context_df, prediction_length=36, # Number of steps to forecast quantile_levels=[0.1, 0.5, 0.9], # Quantiles for probabilistic forecast id_column="item_id", # Column identifying different time series timestamp_column="Month", # Column with datetime information target="#Passengers", # Column(s) with time series values to predict ) - Notebooks
- Google Colab
- Kaggle
Update deployment guide
Browse files
README.md
CHANGED
|
@@ -22,7 +22,7 @@ library_name: chronos-forecasting
|
|
| 22 |
|
| 23 |
# Chronos-2
|
| 24 |
|
| 25 |
-
**Update
|
| 26 |
|
| 27 |
**Chronos-2** is a 120M-parameter, encoder-only time series foundation model for zero-shot forecasting.
|
| 28 |
It supports **univariate**, **multivariate**, and **covariate-informed** tasks within a single architecture.
|
|
@@ -31,7 +31,8 @@ Trained on a combination of real-world and large-scale synthetic datasets, it ac
|
|
| 31 |
Chronos-2 is also **highly efficient**, delivering over 300 time series forecasts per second on a single A10G GPU and supporting both **GPU and CPU inference**.
|
| 32 |
|
| 33 |
## Links
|
| 34 |
-
-
|
|
|
|
| 35 |
- π [Technical report](https://arxiv.org/abs/2510.15821v1)
|
| 36 |
- π» [GitHub](https://github.com/amazon-science/chronos-forecasting)
|
| 37 |
- π [Example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/chronos-2-quickstart.ipynb)
|
|
@@ -53,9 +54,7 @@ Chronos-2 is also **highly efficient**, delivering over 300 time series forecast
|
|
| 53 |
π§© Chronos & Chronos-Bolt do not natively support future covariates, but they can be combined with external covariate regressors (see [AutoGluon tutorial](https://auto.gluon.ai/1.4.0/tutorials/timeseries/forecasting-chronos.html#incorporating-the-covariates)). This only models per-timestep effects, not effects across time. In contrast, Chronos-2 supports all covariate types natively.
|
| 54 |
|
| 55 |
|
| 56 |
-
##
|
| 57 |
-
|
| 58 |
-
### Local usage
|
| 59 |
|
| 60 |
For experimentation and local inference, you can use the [inference package](https://github.com/amazon-science/chronos-forecasting).
|
| 61 |
|
|
@@ -76,8 +75,7 @@ pipeline = Chronos2Pipeline.from_pretrained("amazon/chronos-2", device_map="cuda
|
|
| 76 |
context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
|
| 77 |
|
| 78 |
# (Optional) Load future values of covariates
|
| 79 |
-
|
| 80 |
-
future_df = test_df.drop(columns="target")
|
| 81 |
|
| 82 |
# Generate predictions with covariates
|
| 83 |
pred_df = pipeline.predict_df(
|
|
@@ -91,14 +89,44 @@ pred_df = pipeline.predict_df(
|
|
| 91 |
)
|
| 92 |
```
|
| 93 |
|
| 94 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
|
| 96 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 97 |
|
| 98 |
First, update the SageMaker SDK to make sure that all the latest models are available.
|
| 99 |
|
| 100 |
```
|
| 101 |
-
pip install -U sagemaker
|
| 102 |
```
|
| 103 |
|
| 104 |
Deploy an inference endpoint to SageMaker.
|
|
@@ -116,21 +144,18 @@ predictor = model.deploy()
|
|
| 116 |
Now you can send time series data to the endpoint in JSON format.
|
| 117 |
|
| 118 |
```python
|
| 119 |
-
import pandas as pd
|
| 120 |
-
df = pd.read_csv("https://raw.githubusercontent.com/AileenNielsen/TimeSeriesAnalysisWithPython/master/data/AirPassengers.csv")
|
| 121 |
-
|
| 122 |
payload = {
|
| 123 |
"inputs": [
|
| 124 |
-
{"target":
|
| 125 |
],
|
| 126 |
"parameters": {
|
| 127 |
-
"prediction_length":
|
| 128 |
}
|
| 129 |
}
|
| 130 |
forecast = predictor.predict(payload)["predictions"]
|
| 131 |
```
|
| 132 |
|
| 133 |
-
For more details about the endpoint API, check out the [example notebook](https://github.com/amazon-science/chronos-forecasting/blob/
|
| 134 |
|
| 135 |
|
| 136 |
## Training data
|
|
|
|
| 22 |
|
| 23 |
# Chronos-2
|
| 24 |
|
| 25 |
+
**Update Jun 5, 2026:** βοΈ Deploy Chronos-2 on AWS with AutoGluon-Cloud. Real-time, serverless, or batch inference in 3 lines of code β pandas DataFrames in, forecasts out. Check out the [new deployment guide](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html).
|
| 26 |
|
| 27 |
**Chronos-2** is a 120M-parameter, encoder-only time series foundation model for zero-shot forecasting.
|
| 28 |
It supports **univariate**, **multivariate**, and **covariate-informed** tasks within a single architecture.
|
|
|
|
| 31 |
Chronos-2 is also **highly efficient**, delivering over 300 time series forecasts per second on a single A10G GPU and supporting both **GPU and CPU inference**.
|
| 32 |
|
| 33 |
## Links
|
| 34 |
+
- βοΈ [Deploy on SageMaker with AutoGluon-Cloud](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html) (recommended)
|
| 35 |
+
- π [Deploy on SageMaker with JumpStart](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb)
|
| 36 |
- π [Technical report](https://arxiv.org/abs/2510.15821v1)
|
| 37 |
- π» [GitHub](https://github.com/amazon-science/chronos-forecasting)
|
| 38 |
- π [Example notebook](https://github.com/amazon-science/chronos-forecasting/blob/main/notebooks/chronos-2-quickstart.ipynb)
|
|
|
|
| 54 |
π§© Chronos & Chronos-Bolt do not natively support future covariates, but they can be combined with external covariate regressors (see [AutoGluon tutorial](https://auto.gluon.ai/1.4.0/tutorials/timeseries/forecasting-chronos.html#incorporating-the-covariates)). This only models per-timestep effects, not effects across time. In contrast, Chronos-2 supports all covariate types natively.
|
| 55 |
|
| 56 |
|
| 57 |
+
## Running the model locally
|
|
|
|
|
|
|
| 58 |
|
| 59 |
For experimentation and local inference, you can use the [inference package](https://github.com/amazon-science/chronos-forecasting).
|
| 60 |
|
|
|
|
| 75 |
context_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/train.parquet")
|
| 76 |
|
| 77 |
# (Optional) Load future values of covariates
|
| 78 |
+
future_df = pd.read_parquet("https://autogluon.s3.amazonaws.com/datasets/timeseries/electricity_price/test.parquet").drop(columns="target")
|
|
|
|
| 79 |
|
| 80 |
# Generate predictions with covariates
|
| 81 |
pred_df = pipeline.predict_df(
|
|
|
|
| 89 |
)
|
| 90 |
```
|
| 91 |
|
| 92 |
+
## Production use on Amazon SageMaker
|
| 93 |
+
|
| 94 |
+
For production use, we recommend deploying Chronos-2 to Amazon SageMaker. There are two options:
|
| 95 |
+
|
| 96 |
+
- **AutoGluon-Cloud** (recommended) β minimal setup with a high-level Python API: pass a pandas DataFrame in, get forecasts back. Supports real-time, serverless, and batch inference out of the box.
|
| 97 |
+
- **SageMaker JumpStart** β fine-grained control over the deployment configuration. JSON request/response payloads only; serverless inference and batch prediction require additional setup.
|
| 98 |
|
| 99 |
+
### βοΈ AutoGluon-Cloud
|
| 100 |
+
|
| 101 |
+
Install AutoGluon-Cloud:
|
| 102 |
+
|
| 103 |
+
```
|
| 104 |
+
pip install autogluon.cloud>=0.5.0
|
| 105 |
+
```
|
| 106 |
+
|
| 107 |
+
Make predictions from a pandas DataFrame
|
| 108 |
+
|
| 109 |
+
```python
|
| 110 |
+
from autogluon.cloud import TimeSeriesFoundationModel
|
| 111 |
+
|
| 112 |
+
model = TimeSeriesFoundationModel(model_name="chronos-2")
|
| 113 |
+
|
| 114 |
+
# Batch prediction
|
| 115 |
+
forecast_df = model.predict(df, prediction_length=24)
|
| 116 |
+
|
| 117 |
+
# Deploy & invoke a real-time endpoint
|
| 118 |
+
endpoint = model.deploy(instance_type="ml.g5.xlarge")
|
| 119 |
+
forecast_df = endpoint.predict(df, prediction_length=24)
|
| 120 |
+
```
|
| 121 |
+
|
| 122 |
+
For more details (e.g. serverless endpoints, covariate-aware forecasting), see the [full deployment guide](https://auto.gluon.ai/cloud/stable/tutorials/foundation-model-timeseries.html).
|
| 123 |
+
|
| 124 |
+
### π SageMaker JumpStart
|
| 125 |
|
| 126 |
First, update the SageMaker SDK to make sure that all the latest models are available.
|
| 127 |
|
| 128 |
```
|
| 129 |
+
pip install -U 'sagemaker<3'
|
| 130 |
```
|
| 131 |
|
| 132 |
Deploy an inference endpoint to SageMaker.
|
|
|
|
| 144 |
Now you can send time series data to the endpoint in JSON format.
|
| 145 |
|
| 146 |
```python
|
|
|
|
|
|
|
|
|
|
| 147 |
payload = {
|
| 148 |
"inputs": [
|
| 149 |
+
{"target": [1.0, 2.5, ..., 12.3]}
|
| 150 |
],
|
| 151 |
"parameters": {
|
| 152 |
+
"prediction_length": 24,
|
| 153 |
}
|
| 154 |
}
|
| 155 |
forecast = predictor.predict(payload)["predictions"]
|
| 156 |
```
|
| 157 |
|
| 158 |
+
For more details about the endpoint API, check out the [example notebook](https://github.com/amazon-science/chronos-forecasting/blob/2.2.2/notebooks/deploy-chronos-to-amazon-sagemaker.ipynb).
|
| 159 |
|
| 160 |
|
| 161 |
## Training data
|