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 values appear under predictions at addresses such as /disputed. 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.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 relflow 0.3.0
File Size Uploaded
relflow-0.3.0.tar.gz 230.5 kB Details

Built distribution (wheel)

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

Total release size: 476.6 kB

Release files / relflow-0.3.0.tar.gz

Download URL relflow-0.3.0.tar.gz
Size 230.5 kB
Tags Source
SHA-256 checksum
How to use checksums
5745c7a98cb5a6234e1725cf0c03c3c57f965579023af8d8f1aa3055f47aae14
BLAKE2b-256 checksum
How to use checksums
b3903959cfccc2c5cc0201e0e838d5e1a0853234f55bd88bad64c6b5ef733d52
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.0-py3-none-any.whl

Download URL relflow-0.3.0-py3-none-any.whl
Size 246.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1b1f8a1198c9f3de6a0f99bdd4326906977f51c4c0d68d69c51d2c55c01d563f
BLAKE2b-256 checksum
How to use checksums
51dce4f6fde443d15a9d39896e555d0c082c22e5a062964c5ef87d52f8e16039
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

0.3.1

2 release files

This release

0.3.0 This release

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