Morflow

Morflow (pronounced morph-flow) is a modular, high-performance data processing engine that allows developers to define media, audio, and tensor pipelines in declarative .morf files and execute them identically across many platforms and languages with native speed and zero train-serve skew.

Why Morflow?

Eliminate AI Train-Serve Skew

In typical AI workflows, preprocessing code written in Python training notebooks is copy-pasted or rewritten in other languages for production services. This rewrite introduces subtle numerical discrepancies, library differences, and critical bugs (train-serve and cross-language skew). With Morflow, you write the pipeline once in a .morf file and execute the exact same deterministic operations across many platforms and languages in both training and production serving.

High Performance Regardless of Host Language

Written in Rust, Morflow provides zero-copy memory operations, automatic flow parallelism, and multi-threaded CPU execution. When calling Morflow from Python or another host language, you get the full speed and multi-core scalability of native Rust.

Developer-Friendly & Self-Explanatory Pipelines

Graph formats like TorchScript or ONNX are difficult to inspect, debug, or understand without specialized tools. A .morf file is clean, declarative, and easily understood by developers across different teams (data science, backend, infra) at a glance.

Lean Production Images

Rather than bundling massive, monolithic dependencies, Morflow ensures production deployments include only the specific actions required by the active pipelines, drastically reducing container image sizes.

Rich Action Packs & Effortless Custom Actions

Designed around an ecosystem of modular, reusable Action Packs (for computer vision, audio DSP, multimodal preprocessing, etc.) alongside a lightweight interface that makes creating custom actions straightforward and fast.

Ship AI & Data Pipelines Together Without Server Rebuilds

Because .morf pipelines and actions are decoupled from host application logic, data processing pipelines can be updated and shipped alongside AI models without requiring server code recompilation or backend service rebuilds.

Highlights

Express complex audio DSP, computer vision, and tensor operations as clean dataflow graphs. Morflow auto-parallelizes independent branches with native execution across runtimes.

image_pipeline.morf
# Declarative image transformation flow
import base/latest
from image_essentials/latest import to_tensor, resize, color_adjust, to_image

accept $img_in
accept $target_width = 512
accept $target_height = 512

$img_in
  >> to_tensor(color="rgb", dtype="f32", normalize=true)
  >> resize(width=$target_width, height=$target_height)
  >> color_adjust(contrast=1.15, saturation=1.05)
  >> to_image(color="rgba", dtype="u8")
  >> emit

Supported Languages

Write your pipeline once in .morf and execute natively across these supported languages.

Python

pip install morflow

Node.js

npm install morflow

Java

org.morflow:morflow:0.1.0

Rust

cargo add morflow