ForecastAgent 1.0: Zero-shot and fine-tuned time series forecasting SDK & CLI wrapper
Project description
ForecastAgent 1.0
ForecastAgent 1.0 is a professional, production-ready Python SDK and Serving API for Zero-Shot Time Series Forecasting, powered by the TiRex-2 xLSTM-based time series foundation model.
With ForecastAgent 1.0, you can run accurate, probabilistic time series forecasting out of the box with zero training, or deploy a self-hosted SaaS API for scalable production workloads.
Key Features
- Zero-Shot Generalization: Perform high-quality forecasting on new time series datasets without fine-tuning.
- Probabilistic Quantiles: Predicts 9 distinct quantiles (from 10th to 90th percentile) to model uncertainty.
- Covariate Support: Supports both past (historical) and future (known ahead of time) covariates.
- Windows & Linux Native: Includes automated monkeypatches to support execution on Windows hosts bypassing Triton and MSVC compiler dependencies.
- FastAPI Serve: Built-in CLI command to spin up a high-performance serving backend.
Installation
From PyPI
pip install forecast-agent-sdk
From Source
Clone this repository and install the package in editable mode:
git clone https://github.com/shinydatatech/ForecastAgent.git
cd ForecastAgent
pip install -e .
Dependencies
The package requires:
torch>=2.0.0numpyxlstm>=2.0.0fastapi,uvicorn,pydantichuggingface_hub
Quickstart
1. Python SDK Usage
Load the model (either from Hugging Face or a local directory) and run zero-shot forecasting:
from forecastagent import ForecastAgent
# Load the model (automatically downloads weights from Hugging Face if not cached)
agent = ForecastAgent.from_pretrained("shinydatatech/forecastagent-v1.0")
# Input target history (e.g., hourly electricity consumption)
history = [10.2, 11.5, 12.1, 11.8, 13.0, 14.5, 15.2, 14.8, 13.9, 13.1]
# Predict 3 steps forward
results = agent.predict(
target=history,
prediction_length=3,
freq="h"
)
print("Median Forecast (50th percentile):", results["median"])
print("Lower Bound (10th percentile):", results["lower"])
print("Upper Bound (90th percentile):", results["upper"])
print("All 9 Quantiles:", results["quantiles"])
2. Launch Serving API Server
You can launch the FastAPI server via the command-line interface:
# Launch server locally on port 8000
forecastagent-api --model-path shinydatatech/forecastagent-v1.0 --port 8000
API Endpoints
GET /: Health check and model metadata.POST /v1/predict: Forecast endpoint.{ "instances": [ { "target": [10.2, 11.5, 12.1, 11.8, 13.0], "start": "2026-07-01T00:00:00", "freq": "h" } ], "prediction_length": 3 }
Publishing Model & Package
For detailed step-by-step instructions on:
- Publishing merged model checkpoints to Hugging Face
- Building distribution packages (
.whl/.tar.gz) - Setting up automated release pipelines via GitHub Actions
Please refer to the Implementation & Publishing Guide.
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file forecast_agent_sdk-1.0.0.tar.gz.
File metadata
- Download URL: forecast_agent_sdk-1.0.0.tar.gz
- Upload date:
- Size: 50.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dc01b51415baef54584378a28d91571985e253060e66b222a3985a488242c23b
|
|
| MD5 |
f77192d7ed18d9c7306acfc6c5c93e11
|
|
| BLAKE2b-256 |
f428de0a409c063ae453b292c0fcbbdc8e3465dc817630b8131dae96fc8fd4a1
|
File details
Details for the file forecast_agent_sdk-1.0.0-py3-none-any.whl.
File metadata
- Download URL: forecast_agent_sdk-1.0.0-py3-none-any.whl
- Upload date:
- Size: 60.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4c1e96b11c24a8a245c9cbb92318d38d559ed769f26cd063b480de9b553305f
|
|
| MD5 |
c8e0199e8f4354821b6955001688440c
|
|
| BLAKE2b-256 |
5c806fa1a10e3036991116c447558a6e0fd543b793bb1eae27402649df0de52f
|