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.
- Docs: https://docs.generalforecast.com
- API reference: https://docs.generalforecast.com/api
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, store the snapshot's rows and
register them 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 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.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| generalforecast-0.2.1.tar.gz | 380.9 kB | With provenance | Details for generalforecast-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| generalforecast-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for generalforecast-0.2.1-py3-none-any.whl |
Total release size: 640.2 kB
Release files / generalforecast-0.2.1.tar.gz
| Download URL | generalforecast-0.2.1.tar.gz |
|---|---|
| Size | 380.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cacd59129eef4082bb262a3f07175884de62b48dacb90aa9ced3b68b1afc3b42
|
|
BLAKE2b-256 checksum How to use checksums |
f209292d6b9b34dfeec30cc0c627a883e16a0d664eb32590759bb06717923f3d
|
| 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 logRelease files / generalforecast-0.2.1-py3-none-any.whl
| Download URL | generalforecast-0.2.1-py3-none-any.whl |
|---|---|
| Size | 259.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
116f9b734002688115970e3b0886e1cc31359b1cd5737b2976954bb0357f41bb
|
|
BLAKE2b-256 checksum How to use checksums |
b8b4918fc405053d624a7bf7bf19798f94adc398fb2a0ee7b678e708368ced2a
|
| 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 logSecurity for generalforecast 0.2.1
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.
Attestation for generalforecast-0.2.1.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 logA 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.