Skip to main content

relflow

PyPI version Python 3.12+ Apache-2.0 license Documentation Discord channel invite

relflow builds PyTorch/Lightning models from nested records streamed through Apache Arrow. Typed fields represent values; branches combine them into local contexts; decoders learn to predict selected fields from the available context.

Install

Python 3.12 or newer:

uv add relflow

Add relflow[text] for Hugging Face text encoders or relflow[serving] for the HTTP runtime.

Describe One Record

For example, predict whether a payment will be disputed:

payment_id: payment-42
amount: 86.50
merchant: grocery
disputed: false
import relflow as rf

model = rf.Model.xs(
    amount=rf.Number,
    merchant=rf.Category,
    disputed=rf.Boolean(mask=True),
)

Parent keywords name each field. mask=True makes disputed a supervised prediction target whose label is excluded from the inputs. payment_id remains available as application metadata. Add repeated contexts with rf.Branch(...) when a prediction needs transaction history or other related records.

Train And Predict

The application supplies Arrow tables named train_table, validation_table, and request_table. Training and validation include the dispute label; prediction requests omit it.

data = rf.ArrowDataModule(
    model=model,
    train=train_table,
    validate=validation_table,
)
model.fit(data, batch_size=128, learning_rate=1e-4, weight_decay=0.01, max_epochs=30)

predictions = model.predict(request_table, batch_size=256, retain=("payment_id",))
model.save("artifacts/payment.rf")

Fitting includes early stopping and restoration of the best validation model. Configure AdamW directly on fit; each call starts with the current model parameters and fresh optimization state. Hardware, logging, and Lightning options can also be supplied to the model methods. Predictions are an Arrow table: decoded results use schema field names such as predictions.disputed, and repeated branches become lists of records. Requested embeddings appear separately in representations. Retention adds an inputs column. For larger file-backed jobs, use an Arrow data module with rf.Writer to stream predictions to Parquet.

Documentation

Documentation, modeling proofs, and branding sources live in the separate relflow/docs repository. Its website uses static examples and Typst diagrams and builds independently of this package. Run package checks here with uv run pytest; follow the documentation repository's instructions to run learning experiments explicitly. See CONTRIBUTING.md for development conventions.

Community · Apache 2.0 license

Metadata

Release files for relflow 0.3.1

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

Source distribution (sdist)

Source distribution for relflow 0.3.1
File Size Uploaded
relflow-0.3.1.tar.gz 233.8 kB Details

Built distribution (wheel)

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

Total release size: 483.2 kB

Release files / relflow-0.3.1.tar.gz

Download URL relflow-0.3.1.tar.gz
Size 233.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b7dff806e36a7cdd0b08d840c6b53b52792638db421a36a0c24fc7cc09af080e
BLAKE2b-256 checksum
How to use checksums
c736eaa47b13b4f52fb8a7eba6a4780b3ca819c9cd74f08c8d3fc48260478fe0
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 Oct 17, 2026.

Transparency log

Release files / relflow-0.3.1-py3-none-any.whl

Download URL relflow-0.3.1-py3-none-any.whl
Size 249.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e141f45b187677cdee85003838918a1e41603df12e9bd91fa52ac347d15784be
BLAKE2b-256 checksum
How to use checksums
11283ef53342d6e391d06ccd9fcc683a45d09972996d0ff01fedddbce474e10e
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 Oct 17, 2026.

Transparency log

Release history Release notifications | RSS feed

0.3.2

2 release files

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.0.1

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