Skip to content

tirex2

NX-AI TiRex-2, plus every hub model. TiRex v1 stays on tirex.

extra CPU tag GPU tag families models example
tirex2 :tirex2 :tirex2-gpu TiRex-2 4 tirex_2

Gated checkpoints

tirex_2 is public. tirex_2_gifteval_zs, tirex_2_gifteval_pretrain, and tirex_2_fevbench are gated. Accept the model card and set a Hugging Face token before loading those three.

Start a server

docker run --rm -p 8000:8000 sktime/tserve:tirex2 tirex_2
uv pip install "tserve[server,tirex2]"
uv run tserve tirex_2
pip install "tserve[server,tirex2]"
tserve tirex_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": "tirex_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":"tirex_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="tirex_2",
    )
print(result.predictions)

Models

TiRex-2

TiRex2Forecaster extra tirex2 4 models

Native quantile levels are 0.1 through 0.9. The three decontaminated checkpoints are gated on Hugging Face.

model checkpoint
tirex_2 NX-AI/TiRex-2
tirex_2_gifteval_zs NX-AI/TiRex-2-gifteval-zs
tirex_2_gifteval_pretrain NX-AI/TiRex-2-gifteval-pretrain
tirex_2_fevbench NX-AI/TiRex-2-fevbench

Also loadable here

Next steps