Skip to main content

Forecast Engine

Python License Amazon Chronos

A lightweight forecasting engine built on the official Amazon Chronos pipelines.

Forecast Engine provides one clean interface for running modern time-series forecasts from Python or over HTTP. It supports univariate and multivariate forecasting, panel data, covariates, prediction intervals, and reusable model pipelines without exposing Chronos internals to the application layer.

Python  →  ForecastEngine.forecast(...)
HTTP    →  POST /forecast

Built on amazon-science/chronos-forecasting.

Why Forecast Engine?

The official Chronos package provides the forecasting models. Forecast Engine adds the application layer around them:

  • Chronos 2 native multivariate forecasting for related targets such as dx + dy.
  • Univariate forecasting with Chronos 2 or Chronos Bolt.
  • Panel forecasting for multiple independent items in one request.
  • Historical and known-future covariates with Chronos 2.
  • Configurable quantiles for prediction intervals.
  • Stable validation and response formats across Python and HTTP usage.
  • Lazy model loading and pipeline reuse so model weights are not reloaded for every forecast.
  • A single authenticated REST endpoint that is easy to place behind an application backend.

Quick start

Install the package from PyPI:

pip install forecast-engine

To install the optional FastAPI server too:

pip install "forecast-engine[server]"

Python

import pandas as pd

from forecast_engine import ForecastEngine

series = pd.DataFrame({
    "date": pd.date_range("2026-01-01", periods=48, freq="h"),
    "sales": range(48),
})

engine = ForecastEngine()

result = engine.forecast(
    data=series,
    target_cols=["sales"],
    forecast_horizon=12,
    frequency="h",
)

print(result.to_records())

For related variables, pass them together:

result = engine.forecast(
    data=movement_history,
    target_cols=["dx", "dy"],
    forecast_horizon=8,
    frequency="s",
)

Chronos 2 receives those targets jointly in one native multivariate forecast.

REST API

Forecast Engine also includes a thin FastAPI service. The public inference contract is intentionally small:

POST /forecast
Authorization: Bearer <token>
Content-Type: application/json

Example request body:

{
  "data": [
    {"date": "2026-01-01T00:00:00Z", "dx": 1.2, "dy": 0.4},
    {"date": "2026-01-01T00:00:01Z", "dx": 1.3, "dy": 0.5},
    {"date": "2026-01-01T00:00:02Z", "dx": 1.4, "dy": 0.6}
  ],
  "target_cols": ["dx", "dy"],
  "forecast_horizon": 5,
  "frequency": "s",
  "model": "chronos2"
}

Responses use a stable long format with:

timestamp · item_id · target_name · prediction · quantiles

Timestamps are returned as explicit UTC ISO 8601 values ending in Z and can be reused directly in later requests.

See the API reference for the complete request contract, validation rules, errors, covariates, panel data, and runtime options.

Models

Model Multivariate Covariates Panel data Best for
chronos2 Yes Yes Yes General forecasting, related targets, covariates
chronos-bolt-base No No Yes Fast univariate forecasting

chronos2 is the default model.

Documentation

The README intentionally stays small. More detailed documentation lives in docs/:

Development

For a source checkout and the locked development environment:

git clone https://github.com/seblessa/forecast-engine.git
cd forecast-engine
uv sync --locked
uv run pytest -W error
uv build --no-sources

The command uv build --no-sources produces both a wheel and a source distribution. See the development and release workflow before changing the stable branch.

The normal flow is dev → tests/build → approval → main → PyPI.

License

Licensed under the Apache License 2.0.

Metadata

Release files for forecast-engine 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for forecast-engine 1.0.0
File Size Uploaded
forecast_engine-1.0.0.tar.gz 117.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for forecast-engine 1.0.0
File Interpreter ABI Platform
forecast_engine-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 135.9 kB

Release files / forecast_engine-1.0.0.tar.gz

Download URL forecast_engine-1.0.0.tar.gz
Size 117.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ce944a524c306558a5a8e9c3da274a0b9de34181e5c557fac472c5bb7746af5a
BLAKE2b-256 checksum
How to use checksums
768eee6ea5e8ff461bc56c96a71378183f268f9ce4997498d8de92242992589f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release files / forecast_engine-1.0.0-py3-none-any.whl

Download URL forecast_engine-1.0.0-py3-none-any.whl
Size 18.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
351aeee38ee6091df5b6396a969d2c77e31b2201bf31cebf80ec61e16a484bac
BLAKE2b-256 checksum
How to use checksums
6fbebc16eb6b763b9192d9699144fd3a0261337df6b3f99b5962b5d6b7f7ded0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.

Transparency log

Release history Release notifications | RSS feed

1.0.1

2 release files

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page