Skip to content

chronos

Chronos-2: multivariate, with covariates. Plus every hub model.

extra CPU tag GPU tag families models example
chronos :chronos :chronos-gpu Chronos-2 3 chronos_2

Start a server

docker run --rm -p 8000:8000 sktime/tserve:chronos chronos_2
uv pip install "tserve[server,chronos]"
uv run tserve chronos_2
pip install "tserve[server,chronos]"
tserve chronos_2

Check what loaded:

curl -s http://127.0.0.1:8000/models

Predict

Python needs the client extra on the caller.

curl -s http://127.0.0.1:8000/predict -H "Content-Type: application/json" -d '{
  "past": {
    "timestamp": ["2024-01-01", "2024-01-02", "2024-01-03", "2024-01-04", "2024-01-05"],
    "sales": [120, 135, 128, 142, 138]
  },
  "time": "timestamp",
  "target": ["sales"],
  "fh": 3,
  "model": "chronos_2"
}'
curl.exe -s http://127.0.0.1:8000/predict -H "Content-Type: application/json" -d '{"past":{"timestamp":["2024-01-01","2024-01-02","2024-01-03","2024-01-04","2024-01-05"],"sales":[120,135,128,142,138]},"time":"timestamp","target":["sales"],"fh":3,"model":"chronos_2"}'
from tserve.client import Client

past = {
    "timestamp": ["2024-01-01", "2024-01-02", "2024-01-03", "2024-01-04", "2024-01-05"],
    "sales": [120, 135, 128, 142, 138],
}

with Client("http://127.0.0.1:8000") as client:
    result = client.predict(
        past=past,
        time="timestamp",
        target=["sales"],
        fh=3,
        model="chronos_2",
    )
print(result.predictions)

Models

Chronos-2

Chronos2Forecaster extra chronos 3 models
model checkpoint
chronos_2 amazon/chronos-2
chronos_2_small autogluon/chronos-2-small
chronos_2_synth autogluon/chronos-2-synth

Also loadable here

Next steps