Skip to main content

General Forecast

The Python SDK and gf command line for General Forecast: predictors on tabular and time series foundation models, run on the hosted service.

uv pip install generalforecast

Python 3.12 or later. The package is pure Python; every prediction, check and evaluation runs on the service.

Log in

gf login

gf login opens your browser and saves a key for this machine. In CI or a notebook, set GF_API_KEY (and GF_PROJECT if the key spans projects) instead.

A predictor from a table

A predictor is a directory with a manifest, gf.yaml, and the table its context comes from.

mkdir churn && cp customers.csv churn/
gf init churn          # asks for the target and model, writes gf.yaml
gf check churn         # resolves gf.yaml on the service, writes gf.lock
gf eval churn          # scores the held-out rows on the service
gf push churn          # deploys it to production
gf predict churn --queries new_customers.csv

gf check uploads the manifest's snapshot and writes the gf.lock the service answers with (--upgrade accepts a newer model digest). gf eval needs a snapshot context with a holdout or until, which gf init writes. gf push has the service check the directory again, keep the snapshot's resolved rows and register them with the lock as a new revision; a lock that no longer matches is refused until gf check runs again. gf status, gf promote and gf rollback move environments between revisions.

To score rows with a catalog model without a predictor directory:

gf predict --model general-forecast/tabicl-v2-classifier \
  --target churned --context customers.csv --queries new_customers.csv

gf model list shows the catalog with each model's task and per-call limits.

Python

import generalforecast as gf

churn = gf.Predictor("churn")  # a pushed predictor
predictions = churn.predict("new_customers.csv")

adhoc = gf.Predictor(
    "general-forecast/tabicl-v2-classifier",
    target="churned",
    context="customers.csv",
)
predictions = adhoc.predict("new_customers.csv")

Estimators

Classifier, Regressor and Forecaster follow scikit-learn's conventions. fit keeps the labeled rows; predict sends them as the context of a hosted prediction.

import numpy as np
import pandas as pd
import generalforecast as gf

clf = gf.Classifier(model="general-forecast/tabicl-v2-classifier")
clf.fit(X_context, y_context)
probabilities = clf.predict_proba(X_queries)

days = pd.date_range("2025-01-01", periods=60, freq="D")
history = pd.DataFrame(
    {
        "date": np.tile(days, 2),
        "sku": np.repeat(["a", "b"], 60),
        "units": np.r_[np.arange(60.0) % 7, 10 + np.arange(60.0) % 5],
    }
)
fc = gf.Forecaster(target="units", time="date", series="sku", horizon=7)
fc.fit(history)
quantiles = fc.forecast()  # 0.1, 0.5 and 0.9 for each sku and step

A model reads a bounded number of context rows per request. When the training rows are more than one request carries, push them as a context with a predictor that reads it, or pass selection= to draw each query's context from them.

Live contexts

A live context is a table on the service that grows as rows arrive; a predictor whose manifest names it (context: {live: events}) always predicts with the latest rows.

gf context create events --file events.yaml
gf context append events rows.csv --id event_id
gf context label events labels.csv --id event_id --target converted
events = gf.Predictor("conversion").context
events.append(new_rows)
events.label(ids, outcomes)

The client

gf.Client and gf.AsyncClient cover the whole API: predictors, revisions and environments, contexts, snapshots, models, keys and secrets.

with gf.Client() as client:
    checked = client.predictors.check("churn")
    scores = client.predictors.evaluate("churn")
    client.predictors.push("churn", env="staging", wait=True)

License

MIT; see LICENSE.

Metadata

Release files for generalforecast 0.2.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 generalforecast 0.2.0
File Size Uploaded Provenance Actions
generalforecast-0.2.0.tar.gz 374.8 kB With provenance Details for generalforecast-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for generalforecast 0.2.0
File Interpreter ABI Platform Actions
generalforecast-0.2.0-py3-none-any.whl Python 3 none any Details for generalforecast-0.2.0-py3-none-any.whl

Total release size: 629.9 kB

Release files / generalforecast-0.2.0.tar.gz

Download URL generalforecast-0.2.0.tar.gz
Size 374.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ae4bbc00bb9b0e5e6e4abd4c775409999286c7a23cb8c5bc01964183753b95fd
BLAKE2b-256 checksum
How to use checksums
29bd9c26e7630398b26c8ad49389e830bc5748bddaf1cb18a27609e6a3df0792
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Release files / generalforecast-0.2.0-py3-none-any.whl

Download URL generalforecast-0.2.0-py3-none-any.whl
Size 255.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fea937f9085657ab99dd41cb1fd344e6eccf73de002cc22d9320dcf38b97f4b
BLAKE2b-256 checksum
How to use checksums
fc733700360f5c52c2ba98f4a951bb969c95b8433eebf8d90f22b85ad93ecded
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 20, 2026.

Transparency log

Security for generalforecast 0.2.0

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for generalforecast-0.2.0.tar.gz

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 Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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