Kedro is an open-source Python framework for writing reproducible, maintainable and modular data science and machine learning code. In MLOps & deployment, it sits at the authoring layer: it turns exploratory notebook logic into a standard project structure of pure functions, declarative data connections and configuration files that an orchestrator, a container platform or a cloud ML service can then run in production.
Kedro was created at QuantumBlack, the AI unit of McKinsey, and later joined the LF AI & Data Foundation as a hosted project. Its central idea is borrowed from software engineering: separate code from data access and configuration, so that the same pipeline runs unchanged on a laptop, in continuous integration and on a production cluster.
How Kedro structures a machine learning project
Kedro structures a project around four core abstractions: nodes, pipelines, the Data Catalog and configuration. A node wraps an ordinary Python function and declares its named inputs and outputs. A pipeline is a collection of nodes, and Kedro resolves the execution order automatically from the data dependencies, forming a directed acyclic graph.
The Data Catalog maps every dataset name to a storage location and a loader, such as a CSV file on S3, a Parquet table, a Spark DataFrame or a pickled model. Because nodes only see names, the function code contains no file paths or credentials. This is the property that makes Kedro code portable between environments.
The table below summarizes the building blocks and the responsibility each one carries.
| Abstraction | Defined in | Responsibility |
|---|---|---|
| Node | Python function plus inputs and outputs | Performs one transformation step |
| Pipeline | pipeline.py in a pipeline package | Groups nodes into a dependency graph |
| Data Catalog | catalog.yml | Loads and saves datasets by name |
| Parameters | parameters.yml | Holds tunable values such as split ratios |
| Runner | Command line or Python API | Executes the graph sequentially or in parallel |
| Hooks | settings.py and plugin classes | Inject logic before or after runs and nodes |
A new project created with kedro new follows a fixed project template: source code under src, configuration under conf, and data folders organized by processing layer. The uniform layout means a new team member can navigate any Kedro project in minutes.
Configuration environments and the Data Catalog
Kedro separates configuration into environments, usually conf/base for shared settings and conf/local for machine-specific values and secrets that never enter version control. Additional environments such as staging or prod override only the keys that differ, and kedro run --env=prod selects them at run time.
The OmegaConfigLoader merges these files and supports variable interpolation and runtime parameters. Datasets in the catalog can be marked versioned: true, which makes Kedro save each output under a timestamped version folder. This gives a lightweight form of data and model versioning, although it does not replace a dedicated tool such as DVC or a model registry.
The following table shows how typical settings are distributed across configuration files.
| Setting type | Typical file | Kept in version control |
|---|---|---|
| Dataset paths and formats | conf/base/catalog.yml | Yes |
| Model hyperparameters | conf/base/parameters.yml | Yes |
| Cloud credentials | conf/local/credentials.yml | No |
| Production overrides | conf/prod/catalog.yml | Yes, without secrets |
| Logging setup | conf/logging.yml | Yes |
Kedro compared with orchestrators and ML platforms
Kedro is not a workflow orchestrator and not a serving platform. It does not schedule jobs, retry failed tasks across machines or host prediction endpoints. Instead, it produces a well-defined pipeline graph that deployment plugins translate into the format of an orchestrator, such as Airflow DAGs, Kubeflow pipelines or Databricks jobs.
This division of labor is the most common source of confusion. The table compares Kedro with neighboring tools in the MLOps stack.
| Tool | Primary role | Relationship to Kedro |
|---|---|---|
| Kedro | Pipeline authoring and project structure | Defines code, data and configuration |
| Apache Airflow | Scheduling and orchestration | Runs Kedro nodes as tasks via a plugin |
| Kubeflow | Kubernetes-based ML workflows | Executes containerized Kedro pipelines |
| MLflow | Experiment tracking and model registry | Integrated through hooks or kedro-mlflow |
| Metaflow and ZenML | Pipeline frameworks with built-in orchestration | Overlapping alternatives with different scope |
| DVC | Data and model versioning | Complements versioned datasets |
In practice, teams pair Kedro with an experiment tracker and an orchestrator. The visualization tool Kedro-Viz renders the pipeline graph interactively, which helps reviewers inspect model lineage from raw data to trained artifact.
Deploying Kedro pipelines to production
Deploying a Kedro project usually means packaging it as a Python wheel with kedro package, building a container image and handing the pipeline to a target platform. Because the catalog abstracts storage, only the environment configuration changes between development and production.
The choice of deployment path depends on the infrastructure that already exists, as the decision table shows.
| Situation | Recommended approach | Reason |
|---|---|---|
| Single batch job on one machine | Container with kedro run | Simplest path with no extra tooling |
| Existing Airflow estate | Airflow plugin with one task per node group | Reuses scheduling and alerting |
| Kubernetes cluster | Kubeflow or Argo Workflows | Scales nodes as separate pods |
| Spark-heavy workloads | Databricks jobs | Native distributed data processing |
| Managed cloud ML | Vertex AI or Amazon SageMaker pipelines | Uses provider monitoring and registries |
A training pipeline and an inference pipeline are often defined in the same project and selected with kedro run --pipeline=name. Sharing preprocessing nodes between them reduces training-serving skew, because the same feature code runs in both paths.
Limitations and common mistakes
Kedro adds structure and some overhead. For a short experiment, the template and configuration files can feel heavy, and teams sometimes adopt it too early or too late. Common pitfalls include:
- Overly granular nodes, which create hundreds of tiny tasks and slow orchestration when each node becomes a separate container.
- Hidden side effects inside node functions, such as writing files directly, which breaks reproducibility and lineage.
- Secrets in base configuration, instead of local files or a secrets manager.
- Treating versioned datasets as a full model registry, without promotion stages or approval workflows.
- Assuming Kedro provides real-time serving, when it targets batch pipelines; online inference needs a serving layer such as KServe or BentoML.
The framework also enforces one Python process per run by default, so distributed scale must come from the runner, from Spark or from the orchestrator rather than from Kedro itself.
The idea in brief
Kedro is a way to keep data science code tidy. Imagine a kitchen where every recipe step is on its own card. Each card says what goes in and what comes out. A separate list says where each ingredient is stored.
Because the cards never mention the shelf, you can move the kitchen and still cook the same dish. Kedro does this for machine learning work. The steps stay the same everywhere, and only the storage list changes. That makes the work easier to share, test and run on a schedule.
A practical scenario
A retail analytics team builds a weekly demand forecasting model in notebooks. Running it requires one analyst to execute twelve cells in the right order, and results differ between laptops. The team rewrites the work as a Kedro project with three modular pipelines: data preparation, model training and batch scoring, about 25 nodes in total.
Raw sales files on cloud storage are declared in catalog.yml, and the trained model is saved as a versioned dataset. Development uses conf/local, while conf/prod points to production buckets. The project is packaged as a wheel, built into a container and deployed through the Airflow plugin, which runs the scoring pipeline every Monday at 05:00.
The outcome is a fully reproducible weekly run that no longer depends on a single person. New analysts read the pipeline graph in Kedro-Viz on their first day, and when forecast accuracy drops, the team can trace each output back to the exact input files and parameters that produced it.