A lightweight ML orchestration framework for batch inference using dlt and Narwhals.
Project description
Koala Flow
The Data-First ML Orchestration Framework for the Modern Stack.
Koala Flow is the bridge between your data warehouse and your machine learning models. It abstracts away the boilerplate of batch inference, allowing Data Engineers to deploy models with the same rigor as ETL pipelines.
Built on the shoulders of giants: dlt for robust data loading and Narwhals for dataframe-agnostic processing (Polars, Pandas, PyArrow).
🚀 Why Koala Flow?
- Universal Ingestion: Pull features from REST APIs, SQL databases, S3, or local files seamlessly.
- Lazy & Efficient: Process 100GB+ datasets on a single machine using lazy evaluation and smart batching.
- Schema Evolution: Automatically handle new model outputs or changed feature types without breaking downstream tables.
- Framework Agnostic: Bring your own model (XGBoost, Scikit-Learn, PyTorch, ONNX). We just run it.
📦 Installation
Python 3.10 or greater is required.
pip install koala-flow
Optional backends:
pip install "koala-flow[polars, xgboost]"
⚡ Quick Start
Deploying a batch inference pipeline takes less than 20 lines of code.
import dlt
from koala_flow import InferencePipeline
from koala_flow.adapters import XGBoostAdapter
# 1. Define your pipeline configuration
pipeline = InferencePipeline(
name="fraud_detection_prod",
# Load your trained model artifact
model=XGBoostAdapter("s3://models/fraud_v2.json"),
# Destination: Where do predictions go? (BigQuery, Snowflake, DuckDB, etc.)
destination=dlt.destinations.bigquery(
credentials=dlt.secrets.value,
dataset_name="ml_predictions"
)
)
# 2. Run it!
# Source can be ANY dlt source (SQL, API, Files)
pipeline.run(
source=dlt.sources.sql_database("postgresql://db-prod/users"),
table_name="scored_transactions"
)
🏗 Architecture
Koala Flow enforces a clean separation of concerns for ML in production:
graph LR
A[Source: dlt] --> B{Batch Iterator}
B --> C[Feature Prep: Narwhals]
C --> D[Model Inference]
D --> E[Sink: dlt]
style B fill:#f9f,stroke:#333,stroke-width:2px,color:#000
style C fill:#bbf,stroke:#333,stroke-width:2px,color:#000
- Source:
dlthandles the extraction, ensuring state is managed (incremental loading). - Prep: Your transformation logic runs on
Narwhals, compatible with Pandas or Polars. - Inference: The
ModelAdapterhandles the specific.predict()logic. - Sink:
dlthandles the loading, schema inference, and type casting.
🔌 Supported Adapters
| Adapter | Status | Description |
|---|---|---|
PickleAdapter |
✅ Stable | Standard Scikit-Learn / Generic Python objects |
XGBoostAdapter |
✅ Stable | Optimized DMatrix loading for XGBoost |
LightGBMAdapter |
🚧 Beta | Native LightGBM support |
ONNXAdapter |
🚧 Beta | High-performance inference runtime |
PyTorchAdapter |
🗓 Planned | TorchScript / Eager execution |
🤝 Contributing
We welcome contributions! Whether it's a new model adapter, a documentation fix, or a core feature.
- Check the Issues for help wanted.
- Read our Contribution Guide.
- Join the Discord Community.
📄 License
MIT © 2026 godalida - KoalaDataLab
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file koala_flow-0.1.3.tar.gz.
File metadata
- Download URL: koala_flow-0.1.3.tar.gz
- Upload date:
- Size: 267.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a2c28804bc933bd22f15a60dc13843efe7fb6cd745f3fdc80c034e734c159885
|
|
| MD5 |
88551de521b36dbc8cc3045980fecc45
|
|
| BLAKE2b-256 |
423742375148ef0664c4ec4fdb4550ece937cd1cf38d15d14c7c04a2e3b10aab
|
Provenance
The following attestation bundles were made for koala_flow-0.1.3.tar.gz:
Publisher:
publish.yml on godalida/koala-flow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
koala_flow-0.1.3.tar.gz -
Subject digest:
a2c28804bc933bd22f15a60dc13843efe7fb6cd745f3fdc80c034e734c159885 - Sigstore transparency entry: 947326097
- Sigstore integration time:
-
Permalink:
godalida/koala-flow@08dc6a9ccd84b663f8a63c726f30683fba0b8845 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/godalida
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08dc6a9ccd84b663f8a63c726f30683fba0b8845 -
Trigger Event:
release
-
Statement type:
File details
Details for the file koala_flow-0.1.3-py3-none-any.whl.
File metadata
- Download URL: koala_flow-0.1.3-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b5f7eaae54590aea64621dcdf20828d1d9a7f004371806fbc8cd9aaba284dbd9
|
|
| MD5 |
492653ff73314a4073322e9f14eabef8
|
|
| BLAKE2b-256 |
6787bec6cd1e2e7438037e28353934545fd54674cfc208801bfe6126fdaab283
|
Provenance
The following attestation bundles were made for koala_flow-0.1.3-py3-none-any.whl:
Publisher:
publish.yml on godalida/koala-flow
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
koala_flow-0.1.3-py3-none-any.whl -
Subject digest:
b5f7eaae54590aea64621dcdf20828d1d9a7f004371806fbc8cd9aaba284dbd9 - Sigstore transparency entry: 947326107
- Sigstore integration time:
-
Permalink:
godalida/koala-flow@08dc6a9ccd84b663f8a63c726f30683fba0b8845 -
Branch / Tag:
refs/tags/v0.1.3 - Owner: https://github.com/godalida
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@08dc6a9ccd84b663f8a63c726f30683fba0b8845 -
Trigger Event:
release
-
Statement type: