kfp 2.18.2


pip install kfp

  Latest version

Released: Nov 23, 2026


Meta
Author: The Kubeflow Authors
Requires Python: >=3.9.0

Classifiers

Intended Audience
  • Developers
  • Education
  • Science/Research

License
  • OSI Approved :: Apache Software License

Programming Language
  • Python :: 3
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11
  • Python :: 3.12
  • Python :: 3.13

Topic
  • Scientific/Engineering
  • Scientific/Engineering :: Artificial Intelligence
  • Software Development
  • Software Development :: Libraries
  • Software Development :: Libraries :: Python Modules

Kubeflow Pipelines is a platform for building and deploying portable, scalable machine learning workflows based on Docker containers within the Kubeflow project.

Use Kubeflow Pipelines to compose a multi-step workflow (pipeline) as a graph of containerized tasks using Python code and/or YAML. Then, run your pipeline with specified pipeline arguments, rerun your pipeline with new arguments or data, schedule your pipeline to run on a recurring basis, organize your runs into experiments, save machine learning artifacts to compliant artifact registries, and visualize it all through the Kubeflow Dashboard.

Installation

To install kfp, run:

pip install kfp

Preview pipelines locally

kfp visualize reads Python (.py) or compiled KFP v2 specifications (.yaml, .yml, .json), without a cluster or server credentials:

# Offline, interactive React Flow HTML (defaults to pipeline.html).
kfp visualize pipeline.py

# Select a function when a Python file defines multiple pipelines.
kfp visualize pipeline.py --function training -o training.html

# Mermaid diagrams in Markdown; the output extension selects the format.
kfp visualize pipeline.yaml -o pipeline.md
# Equivalent: kfp visualize pipeline.yaml --format markdown

# Regenerate HTML on saved changes, without starting a server.
kfp visualize pipeline.py -w

# Regenerate Markdown for an editor or third-party Mermaid viewer.
kfp visualize pipeline.py --format markdown -w

# Compile once per change and update both pipeline.html and pipeline.md.
kfp visualize pipeline.py --format both -w
# Choose another output stem: report.html and report.md.
kfp visualize pipeline.py --format both -o report -w

# Serve a live preview and automatically open it in the default browser.
kfp visualize pipeline.py --format both -w -s

# Serve and open a snapshot without watching for edits.
kfp visualize pipeline.py -s

# Serve without launching a browser (useful on remote/headless machines).
kfp visualize pipeline.py -w -s --no-open
# Short form: kfp visualize pipeline.py -w -s -n

--format accepts html, both, or markdown, defaulting to HTML. When --format is omitted, an explicit .html or .md output path selects the format. With both, -o report, -o report.html, and -o report.md all produce report.html and report.md. Both artifacts are rendered and staged before either destination is replaced. Each replacement is atomic, but the pair is not a filesystem transaction.

HTML exports include JavaScript, styles, data, and third-party licenses: they work offline, including in HTML previewers that permit JavaScript. They contain the same graph canvas, task/artifact cards, inline DAG expansion, controls, and node inspector as the KFP pipeline UI. Markdown exports contain one Mermaid task-dependency diagram per DAG and need a Mermaid-aware renderer. Both show static dependencies, including parameter/artifact inputs and explicit ordering; loops are not unrolled, and no runtime execution status is shown. Legacy Argo Workflow YAML and standalone component specs are not supported. Compiler multi-document YAML and Kubernetes PipelineVersion manifests are supported. JSON files use JSON parsing to preserve Unicode and numeric constants.

HTML validates reusable DAG definitions once and keeps the spec compact. Markdown expands instance paths, with a limit of 10,000 DAGs, tasks, and dependency edges in total; use HTML for pipelines that exceed this limit. Missing/empty task display names and incomplete task-output or final-status producer references are rejected before replacing an export. All formats require a deploymentSpec field so their validated state can also be served by the shared KFP graph/inspector; an explicit empty object is supported. Removing the field or a producer name during an edit preserves the previous exports and preview.

-w is a short alias for --watch. Watching only updates files; it never starts a server unless --serve / -s is also supplied. Watch mode observes saved files, not unsaved editor buffers. Python inputs are recompiled in a fresh process after changes to .py files beneath the input's directory (excluding hidden directories, venv, node_modules, and __pycache__). Imports outside that directory and non-Python configuration files are not watched. YAML/JSON inputs watch only the input file. Compilation has a 60-second timeout. Compilation, rendering, or staging failures preserve the last successful exports and print the error; the live HTML viewer also displays it and recovers on the next valid change. Third-party HTML/Markdown viewers control their own reload behavior.

--serve / -s serves an HTML preview with any export format and opens the preview once in the default browser after the server starts. The launch attempt runs in the background, so a browser command that waits for its window to close does not block updates. Stopping the CLI does not wait for or close the browser. By itself it serves a snapshot; combine it with --watch / -w for live updates. Pass --no-open / -n to keep serving without launching a browser. The URL is always printed, and if automatic launch fails, serving continues with a warning so you can open it manually. Plain exports and watch-only commands never launch a browser.

The server binds only to 127.0.0.1 on an automatically selected port and serves only the viewer and its graph data, not the workspace. Keep it private: the graph includes component specifications. A separately opened .html file is an offline snapshot, not a live connection. Remote environments require port forwarding to reach the printed URL; retain its 127.0.0.1:<port> Host and token path. Stop with Ctrl+C.

Only compile trusted Python: importing a pipeline executes its module-level code, including arbitrary side effects. The visualizer does not itself submit runs. Exported task/component specifications can contain source code or literal credentials; review them before sharing.

Getting started

The following is an example of a simple pipeline that uses the kfp v2 syntax:

from kfp import dsl
import kfp


@dsl.component
def add(a: float, b: float) -> float:
    '''Calculates sum of two arguments'''
    return a + b


@dsl.pipeline(
    name='Addition pipeline',
    description='An example pipeline that performs addition calculations.')
def add_pipeline(
    a: float = 1.0,
    b: float = 7.0,
):
    first_add_task = add(a=a, b=4.0)
    second_add_task = add(a=first_add_task.output, b=b)


client = kfp.Client(host='<my-host-url>')
client.create_run_from_pipeline_func(
    add_pipeline, arguments={
        'a': 7.0,
        'b': 8.0
    })
2.18.2 Nov 23, 2026
2.18.1 Nov 18, 2026
2.18.0 Oct 28, 2026
2.17.3 Oct 22, 2026
2.17.0 Jul 09, 2026
2.16.1 May 05, 2026
2.16.0 Feb 25, 2026
2.15.2 Dec 03, 2025
2.15.1 Nov 25, 2025
2.15.0 Nov 25, 2025
2.14.6 Oct 13, 2025
2.14.5 Oct 09, 2025
2.14.4 Sep 29, 2025
2.14.3 Aug 28, 2025
2.14.2 Aug 07, 2025
2.14.1 Aug 05, 2025
2.13.0 Apr 28, 2025
2.12.2 Apr 24, 2025
2.12.1 Feb 28, 2025
2.12.0 Feb 27, 2025
2.11.0 Dec 09, 2024
2.10.1 Nov 14, 2024
2.10.0 Nov 08, 2024
2.9.0 Sep 09, 2024
2.8.0 Jun 22, 2024
2.7.0 Feb 14, 2024
2.6.0 Jan 11, 2024
2.5.0 Jan 08, 2024
2.4.0 Oct 27, 2023
2.3.0 Sep 22, 2023
2.2.0 Sep 14, 2023
2.1.3 Sep 06, 2023
2.1.2 Jul 28, 2023
2.1.1 Jul 27, 2023
2.0.1 Jun 21, 2023
2.0.0 Mar 16, 2022
2.0.0rc2
2.0.0rc1
2.0.0b17
2.0.0b16 May 04, 2023
2.0.0b15 Apr 24, 2023
2.0.0b14
2.0.0b13
2.0.0b12
2.0.0b11 Jan 20, 2023
2.0.0b10 Dec 29, 2022
2.0.0b9 Dec 21, 2022
2.0.0b8 Nov 30, 2022
2.0.0b7 Nov 28, 2022
2.0.0b6
2.0.0b5 Sep 26, 2022
2.0.0b4
2.0.0b3 Aug 17, 2022
2.0.0b2
2.0.0b1
2.0.0b0
2.0.0a5
2.0.0a4 May 25, 2022
2.0.0a3
2.0.0a2
2.0.0a1
2.0.0a0
1.8.24 Mar 10, 2026
1.8.23 Aug 05, 2025
1.8.22 May 17, 2023
1.8.21 May 04, 2023
1.8.20 Apr 06, 2023
1.8.19 Feb 17, 2023
1.8.18 Dec 21, 2022
1.8.17 Dec 09, 2022
1.8.16 Nov 17, 2022
1.8.15 Nov 17, 2022
1.8.14 Sep 21, 2022
1.8.13 Jul 11, 2022
1.8.12 Mar 30, 2022
1.8.11 Jan 24, 2022
1.8.10 Dec 08, 2021
1.8.9 Nov 04, 2021
1.8.8 Nov 03, 2021
1.8.7 Oct 28, 2021
1.8.6 Oct 19, 2021
1.8.5 Oct 12, 2021
1.8.4 Oct 04, 2021
1.8.3 Sep 29, 2021
1.8.2 Sep 16, 2021
1.8.1 Sep 10, 2021
1.8.0 Sep 03, 2021
1.7.2 Aug 26, 2021
1.7.1 Aug 17, 2021
1.7.0 Aug 07, 2021
1.6.6 Jul 23, 2021
1.6.5 Jul 19, 2021
1.6.4 Jun 24, 2021
1.6.3 Jun 03, 2021
1.6.2 May 19, 2021
1.6.1 May 18, 2021
1.6.0 May 14, 2021
1.6.0rc0
1.4.1 Mar 18, 2021
1.4.1rc1
1.4.1rc0
1.4.0 Feb 01, 2021
1.4.0rc1
1.3.0 Jan 08, 2021
1.2.0 Dec 18, 2020
1.1.2 Dec 05, 2020
1.1.1 Nov 12, 2020
1.1.1rc0 Nov 11, 2020
1.1.1b1
1.1.0 Nov 02, 2020
1.1.0a1
1.0.4 Oct 22, 2020
1.0.3 Oct 10, 2020
1.0.3rc1
1.0.1 Sep 08, 2020
1.0.1rc1
1.0.0 Jun 05, 2020
1.0.0rc5
1.0.0rc4
1.0.0rc3
1.0.0rc2
1.0.0rc1
0.5.2 Mar 02, 2021
0.5.1 May 07, 2020
0.5.0 Apr 24, 2020
0.4.0 Apr 07, 2020
0.3.0 Mar 23, 2020
0.2.5 Feb 27, 2020
0.2.4.1 Feb 20, 2020
0.2.4 Feb 19, 2020
0.2.2.1 Feb 11, 2020
0.2.2 Feb 05, 2020
0.2.1 Feb 03, 2020
0.2.0 Jan 20, 2020
0.1.40 Jan 09, 2020
0.1.39 Jan 06, 2020
0.1.38 Dec 20, 2019
0.1.37 Dec 05, 2019
0.1.36 Nov 27, 2019
0.1.35 Nov 14, 2019
0.1.34 Nov 09, 2019
0.1.33 Nov 02, 2019
0.1.32.2 Oct 27, 2019
0.1.32.1 Oct 24, 2019
0.1.32 Oct 18, 2019
0.1.31.2 Oct 09, 2019
0.1.31.1 Oct 01, 2019
0.1.31 Sep 24, 2019
0.1.30 Sep 14, 2019
0.1.29 Sep 08, 2019
0.1.27 Aug 22, 2019
0.1.26 Aug 16, 2019
0.1.25 Jul 30, 2019
0.1.24 Jul 13, 2019
0.1.23.1 Jun 28, 2019
0.1.23 Jun 28, 2019
0.1.22
0.1.19 May 08, 2019
0.1.18
0.1.16 Apr 11, 2019
0.1.11 Mar 06, 2019
kfp.tar.gz Apr 26, 2019

Wheel compatibility matrix

Platform Python 3
any

Files in release

Extras:
Dependencies:
click (>=8.1.8)
click-option-group (==0.5.7)
docstring-parser (<1,>=0.7.3)
google-api-core (<3,>=2.30.3)
google-api-core (<3,>=2.44.0)
google-auth (<3,>=1.6.1)
google-cloud-storage (<4,>=2.2.1)
kfp-pipeline-spec (<3,>=2.18.2)
kfp-server-api (<3,>=2.18.2)
kubernetes (<31,>=8.0.0)
protobuf (<7.0,>=6.33.6)
PyYAML (<7,>=5.3)
requests (==2.32.5)
requests (<3,>=2.33.0)
requests-toolbelt (<2,>=0.8.0)
tabulate (<1,>=0.8.6)
urllib3 (==2.6.3)
urllib3 (==2.8.0)
oauthlib (<5,>=4.0.1)
certifi (>=2026.10.19)
pyasn1 (>=0.6.5)