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.2.tar.gz (267.0 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.2-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: koala_flow-0.1.2.tar.gz
  • Upload date:
  • Size: 267.0 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.2.tar.gz
Algorithm Hash digest
SHA256 bfe71db82b2be4f1c645d5a422ded3a0afdcc33ec187eb3a17a828c7083e91bb
MD5 4bfd6b18e89f3d4c4197d2c84160b9fd
BLAKE2b-256 e71fa819d1d54b5f1b15fa2c7e8f8d659bbdd1efad44eab265c79f00d547a41b

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: koala_flow-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.4 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9f684763f714eff77f178503c83d9204328a9ba67bfaed236bab264bd159ca4b
MD5 187965f65a92ea7298ffe9c19530354d
BLAKE2b-256 b165d72a9f57e43de00e9cfdcca140023147deaf3cc3dc4f7537547a73162e9f

See more details on using hashes here.

Provenance

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