Skip to main content

A lightweight ML orchestration framework for batch inference using dlt and Narwhals.

Project description

Koala Flow Logo

Koala Flow

The Data-First ML Orchestration Framework for the Modern Stack.

PyPI Downloads Tests License


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
  1. Source: dlt handles the extraction, ensuring state is managed (incremental loading).
  2. Prep: Your transformation logic runs on Narwhals, compatible with Pandas or Polars.
  3. Inference: The ModelAdapter handles the specific .predict() logic.
  4. Sink: dlt handles 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.

  1. Check the Issues for help wanted.
  2. Read our Contribution Guide.
  3. 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

koala_flow-0.1.4.tar.gz (267.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

koala_flow-0.1.4-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file koala_flow-0.1.4.tar.gz.

File metadata

  • Download URL: koala_flow-0.1.4.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

Hashes for koala_flow-0.1.4.tar.gz
Algorithm Hash digest
SHA256 bb7b54fa748508bc61f9b0b570225be7bb501a94aa5f13817a451ee65550d067
MD5 9cf8700aef6c7a4e87f122c27fded78e
BLAKE2b-256 c5cf1ccf4b9392bda52e95ec6a4bcdf36b15342ad69c01d864407d856a3f5fab

See more details on using hashes here.

Provenance

The following attestation bundles were made for koala_flow-0.1.4.tar.gz:

Publisher: publish.yml on godalida/koala-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file koala_flow-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: koala_flow-0.1.4-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

Hashes for koala_flow-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7da77dc04638ffebe3ea41c3c78b51e83a675ad4ed67c21af3c11f18ab4f9c51
MD5 cd75b0fc5beef76b5cc46007dcf6904e
BLAKE2b-256 f28f334d52ca93185f12f31bb5808bb823551709a2fed0cc32f45601ceb0e5b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for koala_flow-0.1.4-py3-none-any.whl:

Publisher: publish.yml on godalida/koala-flow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page