ZenML Documentation

repository·main·Indexed 26 days ago

https://github.com/zenml-io/zenml

An AI/ML platform designed to bridge the gap between pipeline development and production. ZenML enables Pythonic workflows that run on any infrastructure backend with automatic containerization, tracking, and tool integration. The documentation covers the ZenML Python SDK and the Server API, which is divided into the OSS API for core functionality (managing artifact versions, model versions, pipelines, runs, and service accounts) and the Pro API for enterprise features (managing devices, organizations, teams, tenants, and users).

Tokens
233.5K
Snippets
593
Records
1.2K
Agent score
90%

What's inside ZenML

  1. Overview of ZenML Deployers

    main
    Deployers are ZenML stack components that transform pipelines into long-running HTTP services. Unlike orchestrators used for batch processing, deployers create persistent web services with REST APIs, enabling real-time execution, interactive workflows, and integration with web applications or AI agents. They allow for request-response patterns where pipelines receive parameters via HTTP and return JSON responses.
  2. Overview of LLMOps with ZenML

    main
    ZenML provides a framework for integrating Large Language Models (LLMs) into MLOps workflows. This includes building Retrieval-Augmented Generation (RAG) pipelines, evaluating retrieval and generation performance, implementing reranking, finetuning embeddings, and finetuning LLMs. The guide uses a question-answering system for ZenML as a continuous use case to demonstrate these capabilities.
  3. Overview of the Kubernetes Orchestrator

    main

    The ZenML kubernetes integration allows you to orchestrate and scale ML pipelines on any Kubernetes cluster (EKS, GKE, AKS, OpenShift, Rancher, or self-managed) without writing Kubernetes code.

    It runs each pipeline step in a separate Kubernetes pod, using a master pod to orchestrate execution via topological sort. It is designed as a lightweight, minimalist alternative to Kubeflow or Airflow, avoiding the maintenance overhead of Kubeflow while providing distributed orchestration.

  4. Overview of ZenML API capabilities

    main

    The ZenML API provides programmatic access to ZenML services that extend beyond the capabilities of the standard Python SDK. It is divided into two main categories:

    • OSS API: Provides open-source API endpoints for core ZenML functionality.
    • Pro API: Provides enhanced API endpoints for ZenML Pro features.

    Use the API for tasks that require automation or integration outside of a standard Python development environment.

  5. Overview of ZenML and Kitaru SDKs

    main

    ZenML provides two primary Python SDKs for different machine learning and AI agent workflows:

    • ZenML SDK: Used to build, manage, and deploy production-ready machine learning pipelines.
    • Kitaru SDK: A sibling project designed for running, replaying, and improving AI agents (including features like flows, checkpoints, replay, and wait).

    Detailed documentation for each can be found at their respective reference sites.

  6. Overview of ZenML Pro features

    main

    ZenML Pro is an enterprise-grade extension of the Open Source version, designed for multi-user collaboration and scaling ML operations.

    Key differences from ZenML OSS include:

    • User Management: Multi-user support with SSO, Organizations, and Teams.
    • Access Control: Full Role-Based Access Control (RBAC) with customizable permissions.
    • Multi-tenancy: Support for Workspaces and Projects for resource isolation.
    • Enhanced UI: Access to the Model Control Plane, Artifact Control Plane, and comparison views.
    • Pipeline Execution: Ability to run pipelines and manage schedules directly from the UI, including support for Triggers and Run Snapshots.
    • Deployment Options: Available as SaaS, Hybrid, or Self-hosted.
    • Security: SOC 2 Type II and ISO 27001 certified.
  7. Overview of Seldon Core Model Deployer

    main

    Seldon Core is a production-grade model serving platform for Kubernetes. It allows you to deploy models as REST/gRPC microservices with features like monitoring, logging, model explainers, outlier detectors, and continuous deployment strategies (A/B testing, canary deployments). It includes built-in model server implementations for standard ML model formats.

    Note: The Seldon Core model deployer integration is currently not supported on MacOS.

  8. Overview of Kitaru for AI Agents

    main

    Kitaru is ZenML's sibling project designed for production AI agents. It follows a run, replay, improve pattern:

    • Run: Every model call and tool call in a run is recorded as a durable checkpoint.
    • Replay: You can replay a real run with a single change (e.g., a different model or prompt).
    • Improve: Diff the original and replayed runs, then roll the winning change across a cohort of recent runs.

    Because a Kitaru flow is a dynamic ZenML pipeline under the hood, agents and pipelines share the same stacks, server, and dashboard.

  9. Overview of the SkyPilot VM Orchestrator

    main

    The SkyPilot VM Orchestrator allows you to provision and manage virtual machines (VMs) on any cloud provider supported by the SkyPilot framework. It is designed to simplify running ML workloads by offering cost savings (via spot VMs), high GPU availability, and managed execution without the complexity of Kubernetes or expensive managed services like SageMaker.

    Key Features:

    • Cost Optimization: Automatically selects the cheapest VM, zone, region, or cloud.
    • GPU Availability: Provisions VMs across multiple zones/regions/clouds to ensure access.
    • Autostop: Automatically cleans up idle clusters to prevent unnecessary costs.
    • Managed Execution: Handles launching and scaling VMs for your pipelines.

    Important Considerations:

    • Deployment Context: This component is intended for use within a remote ZenML deployment. Using it with a local ZenML deployment may cause unexpected behavior.
    • GPU Support: Since pipelines run in Docker containers within the VMs, you may need to configure your pipeline settings with docker_run_args=["--gpus=all"] to enable GPU access inside the container.
    • Scheduling: The SkyPilot VM Orchestrator does not currently support scheduled pipeline runs.
    • Dashboards: While ZenML provides a dashboard for pipelines and artifacts, SkyPilot has its own optional API server/dashboard which can be started via sky api start.
  10. Understand Step Operators in ZenML

    main

    Step operators allow you to execute individual pipeline steps in specialized runtime environments optimized for specific workloads, such as those requiring GPUs or distributed processing frameworks like Spark.

    Key distinction: Unlike an orchestrator (which is a mandatory component responsible for the overall execution order and scheduling of a pipeline), a step operator is an optional component used to offload specific steps to environments that the orchestrator's runtime cannot provide (e.g., running a heavy training step on SageMaker while the rest of the pipeline runs on a local Kubernetes cluster).

  11. Understand Data Validators in ZenML

    main

    Data Validators are optional Stack Components used to maintain data quality and monitor model performance throughout the ML lifecycle. They enable data profiling, integrity testing, and drift detection (data and model drift) at various stages such as ingestion, training, evaluation, and inference.

    Key characteristics:

    • They must be registered as part of your ZenML Stack.
    • They generate data profiles and quality check reports that are versioned and stored in the Artifact Store.
    • Results can be retrieved and visualized later.