Morflow

Morflow (pronounced morph-flow) is a modular, high-performance data processing engine built for AI/ML input/output processing and tensor transformations. Define processing pipelines for images, audio, tensors and more in declarative .morf files and reuse the same native actions across training and production serving with shared tensor storage and multi-threaded CPU execution.

Why Morflow?

Keep Training and Serving in Sync

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 reuse the same native actions across supported platforms and languages in both training and production serving.

High Performance Regardless of Host Language

Written in Rust, Morflow provides shared tensor storage, zero-copy tensor views, automatic flow parallelism, and multi-threaded CPU execution. Pipelines called from Python or another host language execute in the native Rust runtime.

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 base/latest import to_tensor
from image_basics/latest import resize, color_adjust, to_image

accept Image $img_in
accept IntArg $target_width = 512
accept IntArg $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

Benchmark

A 10-second stereo clip: decode the WAV, resample to 16 kHz, high-pass filter, normalize, then compute a spectrogram and re-encode the WAV.

Audio processed per second (higher is faster)
  1. Morflow4 threads
    369 s of audio / sec
  2. Morflow1 thread
    192 s of audio / sec
  3. NumPy + SciPy1 thread
    97 s of audio / sec

Morflow 0.3.2 · NumPy 2.2.6 · SciPy 1.15.3 · AMD Ryzen AI 9 365 · Linux · Nov 2026 · How it's measured

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.3.2

Rust

cargo add morflow