User Guide · Benchmarks · API map · Community
Featureless modeling, shaped by your data
relflow is a predictive modeling framework, intended for any predictive task. You describe your records, their relationships, and the outcomes you want to predict using a typed Python schema. relflow builds a model from that schema, then learns features and predictions together during training.
A customer has usage history and support tickets. An asset has sensor readings and maintenance records. An insurance claim has invoices and line items. Keep those records and their relationships in the model, without first turning every history into a hand-crafted table of counts and averages.
Why relflow?
- Featureless. Learn features from typed values and nested records inside the model, without a separate feature engineering pipeline.
- Modular. Compose models from fields and branches. Extend them with your own custom leaf types and connect to your own custom data sources.
- Scalable. Stream massive datasets from disk or cloud storage through batched training and inference.
- Flexible. Predict probabilities, numbers, or several outcomes together. Targets can live at the root or inside nested collections of records.
- Deployable. Use the trained model for batch prediction and real-time serving, with its learned vocabularies and normalizers included.
- State of the art. On the nine published RelArena tasks with more than one million training observations, relflow beats TabPFN-3 on 9 of 9 and TabPFN-3.5 on 6 of 9. Inspect the scores and comparison records.
Philosophy
relflow was designed to be the first-of-its-class featureless modeling paradigm, providing a scalable solution in which model architecture embodies the latent data structure.
By internalizing feature processing as model components, relflow keeps the same learned vocabularies and normalizers throughout training and inference. The typed schema describes both the data contract and the architecture, including how related records contribute context to each prediction.
Install
Requires Python 3.12 or newer. With uv:
uv add relflow
uv run relflow --version
With pip, use python -m pip install relflow. Image fields use
uv add "relflow[image]". For text encoders and HTTP serving, use
uv add "relflow[text,serving]". See
Installation for the full list.
Describe your data. Define your predictions.
Suppose you want to predict whether a subscriber will cancel within 90 days. The model can use their current plan, monthly usage, and support history:
import relflow as rf
class MonthlyUsage(rf.Branch):
"""One month of a subscriber's product usage."""
month = rf.Period("month_of_year")
minutes = rf.Number
data_gb = rf.Number
overage_fee = rf.Number
class SupportTicket(rf.Branch):
"""One support ticket in a subscriber's history."""
channel = rf.Category
resolved = rf.Boolean
days_open = rf.Number
class ChurnModel(rf.Model):
"""A subscriber with usage and support histories."""
plan = rf.Category
tenure_months = rf.Number
monthly_usage = MonthlyUsage(length=12, overflow="tail")
support_tickets = SupportTicket(length=32, overflow="tail")
churn_90d = rf.Boolean(mask=True)
if __name__ == "__main__":
model = ChurnModel(preset="small")
data = rf.ArrowDataModule(
train="customers/train/*.parquet",
validate="customers/validation/*.parquet",
test="customers/test/*.parquet",
)
model.fit(data, preset="small")
validation_metrics = model.validate(data)
test_metrics = model.test(data)
model.save("churn.rf")
The schema is the architecture. Fields describe individual values; branches
keep related records together. relflow uses that structure to build its
representations, context encoders, prediction heads, and learning objectives.
Class declarations describe the contract; constructing ChurnModel(...) creates
a new, untrained model.
The constructor preset selects architecture defaults. The preset on fit
independently selects training defaults, including the optimizer, batch size,
and training budget. The bundled small and medium presets are alternative
recipes; you do not need to configure those settings individually to get started.
mask=True makes churn_90d a supervised target: the historical answer trains
the model without becoming an input. Validation and test records also include
observed answers, hidden in the same way for evaluation. New prediction requests
may omit the target. Each history is supplied oldest to newest;
overflow="tail" retains the most recent records up to the declared cap. See
Targets and masking for
multiple objectives and targets within nested collections.
The Parquet files contain one subscriber observation per row, with nested usage
and ticket records and the historical churn_90d answer. Your application owns
the decision cutoff, labels, and evaluation split. Training streams those files;
the complete dataset does not need to fit in memory. Cloud storage paths use
the same data-module interface.
Predict for new records
Load the saved model and pass a Polars DataFrame. New request records contain the
same known inputs and a customer_id to retain, with the future answer omitted:
import polars as pl
import relflow as rf
model = rf.Model.load("churn.rf")
requests = pl.read_parquet("customers/requests.parquet")
result = model.predict(requests, batch_size=256, retain=("customer_id",))
print(result.select("inputs", "predictions"))
The result is an eager Polars DataFrame. Each row retains its customer identifier
under inputs; predictions.churn_90d.content.probability holds the estimated
probability of cancellation. For larger prediction jobs, stream output to files
with batch inference.
Use rf.PolarsDataModule when training and validation data are already in memory.
What can you build with relflow?
The User Guide uses six examples to show how the same typed modeling approach generalizes across datasets and prediction tasks:
| Use case | Available context | Predictions |
|---|---|---|
| Support tickets | Product details and a conversation | Escalation probability and time to resolution |
| Customer churn | Subscriber details, usage, and support histories | Cancellation within 90 days |
| Demand forecasting | Sales history and planned promotions | Units sold for each supplied future week |
| Credit risk | An application, credit accounts, and inquiries | Default within 12 months |
| Predictive maintenance | Sensor readings and completed work orders | Failure within 30 days |
| Insurance claims | Policies, claims, invoices, and line items | Payout and fraud probability for each claim |
These illustrate the same modeling contract across different data structures, leaf types, and prediction targets. Explore the data, model, and class schema and learn about leaf types.
Results you can inspect
On the nine published RelArena tasks with more than one million training observations, relflow beats TabPFN-3 on 9 of 9 and TabPFN-3.5 on 6 of 9. This is the recorded comparison checked November 10, 2026; the benchmark page includes individual scores, task sizes, comparison rules, and source records.
A retained Amazon item-lifetime-value model has 926,554 task-trained parameters, about 0.42% of the approximately 220 million in the TabPFN-3.5 base checkpoint. Including its shared frozen text encoder, the relflow model has 23,640,282 parameters. See the model-size comparison for exactly what is counted.
The Evidence library explores individual learning capabilities with controlled comparisons, source code, measurements, and execution provenance.
Selected historical learning checks · relflow 0.4.2
| Experiment | relflow result | Control |
|---|---|---|
| Match IDs absent from training | 0.9991 AUC with Hash |
0.5000 with unknown Category labels |
| Recall a value by an unfamiliar ID | 0.100 normalized RMSE, median of three seeds | 1.401 after corrupting the lookup IDs |
| Distinguish nulls from zero | 100% accuracy with value states preserved | 50% after filling nulls with zero |
These are recorded synthetic tasks, with their original controls and revision. Each linked page explains the setup, limitations, and retained results.
Go further
- Models and schemas: how typed declarations shape the model.
- Context branches: collections, nested records, and learned context.
- Targets and masking: hidden answers, multiple objectives, and nested predictions.
- Data flow: follow an observation from loading to prediction or a training update.
- Runtime: fit, validate, test, and predict with presets.
- Data modules: streaming files, queries, and custom readers.
- Custom leaf types: extend the same registration system used by built-in fields.
- Inference and deployment: batch output and HTTP serving.
- API map: find public classes and methods with links to their source.
Join the Discord community, contribute through CONTRIBUTING.md, or work on the site using the documentation guide.
relflow is free and open source under the Apache License, Version 2.0
(Apache-2.0). This covers project-authored code, documentation, examples, schema
machinery, cache implementations, and preset definitions unless a file states
otherwise. See NOTICE for project attribution and
licensing for details.
Metadata
Release files for relflow 0.5.3
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 |
|---|---|---|---|---|
| relflow-0.5.3.tar.gz | 346.2 kB | With provenance | Details for relflow-0.5.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| relflow-0.5.3-py3-none-any.whl | Python 3 | none | any | Details for relflow-0.5.3-py3-none-any.whl |
Total release size: 694.4 kB
Release files / relflow-0.5.3.tar.gz
| Download URL | relflow-0.5.3.tar.gz |
|---|---|
| Size | 346.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce8b0085e96c0b3c82c8d622cc008ad57e0d32b81d326222ff20bb879644ac52
|
|
BLAKE2b-256 checksum How to use checksums |
19ca94b078a806a58975991e3bbdf517020d0b68d3d9e0bc15da42f7e3ea1edc
|
| 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 / relflow-0.5.3-py3-none-any.whl
| Download URL | relflow-0.5.3-py3-none-any.whl |
|---|---|
| Size | 348.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5f99c4f600d56861953fde852751c221c4ce2f1e5db83245051fc8182e5f5ee7
|
|
BLAKE2b-256 checksum How to use checksums |
f4da9910afb1db083065caf5b46a31e7478d72ff718fe42122ec269a75371d5c
|
| 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 relflow 0.5.3
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 relflow-0.5.3.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.