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.6.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.6-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koala_flow-0.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 9aa4a8e28720a063b4dbe726489e91c6a96c7963daeacc8a3e4b9602d3c2b472
MD5 0a66fe0ef9490bd2c3b0f99e83cd0d56
BLAKE2b-256 4017998eac9471838f8aaeee49b8f63b431777aedaf6df51cf407d60cfb4a251

See more details on using hashes here.

Provenance

The following attestation bundles were made for koala_flow-0.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: koala_flow-0.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9bf5c9b78a25a7f31c3eb961eff33526fa5251d7f2fb3045d5879404d50ff6c8
MD5 0e8708942edc36e82762553bd3fcfd2f
BLAKE2b-256 4c124d2710ceae20755d2ef31a992ccaba36a7d0fc3558c968a3cc1286895844

See more details on using hashes here.

Provenance

The following attestation bundles were made for koala_flow-0.1.6-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