### Clone ZenML Example Project as Alternative Setup Source: https://docs.zenml.io/user-guides/production-guide/end-to-end This snippet provides an alternative method to obtain the end-to-end project code. Instead of using a ZenML template, it instructs on cloning the official ZenML examples repository from GitHub, navigating to the specific `e2e` example, installing its dependencies, and initializing the ZenML project within that directory. ```Bash git clone --depth 1 [email protected]:zenml-io/zenml.git cd zenml/examples/e2e pip install -r requirements.txt zenml init ``` -------------------------------- ### Bash Commands for Local ZenML Pipeline API Setup Source: https://docs.zenml.io/user-guides/tutorial/trigger-pipelines-from-external-systems These Bash commands provide instructions for setting up and running the ZenML pipeline API locally. They cover installing Python dependencies from `requirements.txt`, exporting necessary environment variables for the API key and ZenML store configuration, and finally starting the FastAPI server. ```bash # Install the required dependencies pip install -r requirements.txt # Set the API key export PIPELINE_API_KEY="your-secure-api-key" # If using a remote ZenML server, set these as well export ZENML_STORE_URL="https://your-zenml-server-url" export ZENML_STORE_API_KEY="your-zenml-api-key" # If you want to use a specific stack export ZENML_ACTIVE_STACK_ID="your-stack-id" # Start the API server python pipeline_api.py ``` -------------------------------- ### Example HTTP GET Request for Step Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps Demonstrates a basic HTTP GET request to retrieve a step using its ID. This example includes necessary headers for authorization and content negotiation. ```HTTP GET /api/v1/steps/{step_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP GET Request for Server Info Source: https://docs.zenml.io/api-reference/pro-api/pro-api/server/info A standard HTTP GET request example demonstrating how to query the `/server/info` endpoint to retrieve server information. ```HTTP GET /server/info HTTP/1.1 Host: Accept: */* ``` -------------------------------- ### Install ZenML with Local Server Dependencies Source: https://docs.zenml.io/getting-started/installation Installs ZenML along with the optional dependencies required to run the local ZenML server and its integrated web dashboard. This is necessary for local dashboard access and advanced features. ```bash pip install "zenml[server]" ``` -------------------------------- ### Example HTTP GET Request for Run Steps Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps Demonstrates a basic HTTP GET request to the `/api/v1/steps` endpoint, including necessary headers like `Host` and `Authorization` for authentication. ```HTTP GET /api/v1/steps HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Verify ZenML Installation Source: https://docs.zenml.io/getting-started/installation After installation, these commands allow you to verify that ZenML has been successfully installed and is accessible, either through the command line interface or by checking the package version within a Python script. ```bash zenml version ``` ```python import zenml print(zenml.__version__) ``` -------------------------------- ### Install ZenML Nightly Build Source: https://docs.zenml.io/getting-started/installation Installs the latest, potentially unstable, nightly build of ZenML. These builds are sourced directly from the `develop` branch and are not guaranteed to be stable, intended for testing new features. ```bash pip install zenml-nightly ``` -------------------------------- ### HTTP/cURL Example: Get Step Configuration Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps/step-configuration An example of an HTTP GET request that can also be used as a cURL command to retrieve the configuration of a specific step, including placeholders for host and authorization token. ```HTTP GET /api/v1/steps/{step_id}/step-configuration HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` ```cURL curl -X GET \ 'https://YOUR_HOST/api/v1/steps/{step_id}/step-configuration' \ -H 'Authorization: Bearer YOUR_OAUTH2_TOKEN' \ -H 'Accept: */*' ``` -------------------------------- ### Example HTTP Request to Get Run Steps Source: https://docs.zenml.io/api-reference/oss-api/oss-api/runs/steps Demonstrates how to construct a direct HTTP GET request to fetch pipeline run steps, including necessary headers for authorization. ```HTTP GET /api/v1/runs/{run_id}/steps HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### HTTP Request Example for Get Pipeline Configuration Source: https://docs.zenml.io/api-reference/oss-api/oss-api/runs/pipeline-configuration An example HTTP/1.1 request demonstrating how to call the 'Get Pipeline Configuration' endpoint. It includes the method, path, host placeholder, and a placeholder for the OAuth2 authorization token. ```HTTP GET /api/v1/runs/{run_id}/pipeline-configuration HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Install ZenML via pip Source: https://docs.zenml.io/deploying-zenml/upgrade-zenml-server/migration-guide/migration-zero-twenty Commands to install ZenML using pip, including how to install a specific older version for rollback purposes or the latest version for updates. ```Shell pip install zenml==0.13.2 ``` ```Shell pip install zenml ``` -------------------------------- ### Install ZenML and Core Dependencies Source: https://docs.zenml.io/user-guides/starter-guide/starter-project This command installs the ZenML library with support for templates and the ZenML server, along with the 'notebook' package for Jupyter. It then installs the scikit-learn integration, making it available for use within ZenML pipelines. ```shell pip install "zenml[templates,server]" notebook zenml integration install sklearn -y ``` -------------------------------- ### Initialize ZenML Project with Starter Template Source: https://docs.zenml.io/user-guides/starter-guide/starter-project These commands create a new directory for the project, navigate into it, and then initialize a ZenML project using the built-in 'starter' template. The '--template-with-defaults' flag applies default settings. Finally, it installs all project-specific Python dependencies listed in the generated 'requirements.txt' file. ```shell mkdir zenml_starter cd zenml_starter zenml init --template starter --template-with-defaults # Just in case, we install the requirements again pip install -r requirements.txt ``` -------------------------------- ### HTTP GET Request Example for /auth/callback Source: https://docs.zenml.io/api-reference/pro-api/pro-api/auth/callback An example of an HTTP GET request to the /auth/callback endpoint, demonstrating the basic structure for invoking this API. ```HTTP GET /auth/callback HTTP/1.1 Host: Accept: */* ``` -------------------------------- ### Clone ZenML MLOps Starter Example Directly Source: https://docs.zenml.io/user-guides/starter-guide/starter-project As an alternative to using templates, these commands clone the official ZenML repository's 'mlops_starter' example directly. It then changes the current directory to the example's root, installs its specific Python requirements, and initializes ZenML within that cloned project context. ```shell git clone --depth 1 [email protected]:zenml-io/zenml.git cd zenml/examples/mlops_starter pip install -r requirements.txt zenml init ``` -------------------------------- ### Example HTTP Request for Get Service Source: https://docs.zenml.io/api-reference/oss-api/oss-api/services An example HTTP/1.1 GET request to retrieve a service by its ID, including host and authorization header. ```HTTP GET /api/v1/services/{service_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### HTTP Request Example: List Pipelines Source: https://docs.zenml.io/api-reference/oss-api/oss-api/pipelines An example of how to make a GET request to the `/api/v1/pipelines` endpoint using standard HTTP, including necessary headers for authorization. ```HTTP GET /api/v1/pipelines HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Set Up ZenML Starter Project Environment Source: https://docs.zenml.io/user-guides/production-guide/understand-stacks These commands provide two methods to set up the ZenML starter project. The first method uses `pip` and `zenml init` with a template, while the alternative clones the project directly from GitHub. Both ensure necessary dependencies are installed and the project is initialized for pipeline execution. ```bash pip install "zenml[templates,server]" notebook zenml integration install sklearn -y mkdir zenml_starter cd zenml_starter zenml init --template starter --template-with-defaults # Just in case, we install the requirements again pip install -r requirements.txt ``` ```bash git clone --depth 1 [email protected]:zenml-io/zenml.git cd zenml/examples/mlops_starter pip install -r requirements.txt zenml init ``` -------------------------------- ### Get Comprehensive ZenML System Information Source: https://docs.zenml.io/user-guides/best-practices/debug-and-solve-issues Use this command to retrieve detailed system information about your ZenML installation, including versions, server details, configuration directories, and active integrations. This output is crucial for diagnosing issues. ```bash zenml info -a -s ``` -------------------------------- ### ZenML OSS API: Getting Started and Overview Source: https://docs.zenml.io/api-reference/oss-api/oss-api/info Provides an entry point and general overview of the ZenML Open Source API, including a link to the full OpenAPI specification. ```APIDOC OSS API: Getting Started OSS API Specification: https://1cf18d95-zenml.cloudinfra.zenml.io/openapi.json ``` -------------------------------- ### HTTP Example: GET Request for API Token Source: https://docs.zenml.io/api-reference/oss-api/oss-api/api-token A practical example of an HTTP GET request to the /api/v1/api_token endpoint, demonstrating the necessary headers for authorization. ```HTTP GET /api/v1/api_token HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### ZenML Pro API: Getting Started and Overview Source: https://docs.zenml.io/api-reference/oss-api/oss-api/info Provides an entry point and general overview of the ZenML Pro API, designed for professional and enterprise use cases. ```APIDOC Pro API: Getting Started ``` -------------------------------- ### Example HTTP GET Request for Check Permissions Source: https://docs.zenml.io/api-reference/pro-api/pro-api/rbac/check-permissions An example HTTP GET request to the `/rbac/check_permissions` endpoint, demonstrating how to include `user_id`, `action`, and authorization token. ```HTTP GET /rbac/check_permissions?user_id=123e4567-e89b-12d3-a456-426614174000&action=text HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Deploy and Login to Local ZenML Server Source: https://docs.zenml.io/getting-started/installation This sequence of commands installs ZenML with server dependencies and then initiates a local login, which automatically launches and connects to the ZenML dashboard in your browser. This enables full local functionality of ZenML. ```bash pip install "zenml[server]" zenml login --local ``` -------------------------------- ### Example HTTP Request to Get User Source: https://docs.zenml.io/api-reference/oss-api/oss-api/users An example HTTP GET request to the /api/v1/users/{user_name_or_id} endpoint, demonstrating the required headers for authentication and a path parameter. ```HTTP GET /api/v1/users/{user_name_or_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Install ZenML and Login Locally Source: https://docs.zenml.io/user-guides/starter-guide/create-an-ml-pipeline This snippet provides the necessary commands to install ZenML with its server components and then log into the local ZenML dashboard. This is a crucial first step for setting up a ZenML development environment. ```shell pip install "zenml[server]" zenml login --local # Will launch the dashboard locally ``` -------------------------------- ### Example HTTP Request to Get Artifact Versions Source: https://docs.zenml.io/api-reference/oss-api/oss-api/artifact-versions A cURL-like HTTP GET request example for the `/api/v1/artifact_versions` endpoint, demonstrating the necessary headers including authorization. ```HTTP GET /api/v1/artifact_versions HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP GET Request for Run Status Source: https://docs.zenml.io/api-reference/oss-api/oss-api/runs/status A raw HTTP 1.1 request example to fetch the status of a pipeline run using the ZenML OSS API. This example demonstrates the required Host header and Bearer token authorization. ```HTTP GET /api/v1/runs/{run_id}/status HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Connect to ZenML Pro Trial Instance Source: https://docs.zenml.io/user-guides/production-guide/deploying-zenml This command allows a local ZenML Python client to quickly connect to a free ZenML Pro trial instance, providing access to managed SaaS features. ```bash zenml login --pro ``` -------------------------------- ### Example HTTP GET Request for Models Source: https://docs.zenml.io/api-reference/oss-api/oss-api/models A standard HTTP GET request example for fetching models from the ZenML API, including necessary headers for authorization. ```HTTP GET /api/v1/models HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Install ZenML GitLab Integration Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/set-up-repository Before registering a GitLab code repository, the corresponding ZenML integration must be installed. This command installs the necessary components for GitLab support. ```cli zenml integration install gitlab ``` -------------------------------- ### ZenML Pro API Overview Source: https://docs.zenml.io/api-reference/pro-api/getting-started Describes the ZenML Pro API as a RESTful API following OpenAPI 3.1.0 specifications, listing its primary functionalities such as workspace, organization, user management, RBAC, and authentication. ```APIDOC The ZenML Pro API is a RESTful API that follows OpenAPI 3.1.0 specifications. It provides endpoints for various resources and operations, including: * Workspace management * Organization management * User management * Role-based access control (RBAC) * Authentication and authorization ``` -------------------------------- ### Example HTTP Request to Get Artifact Source: https://docs.zenml.io/api-reference/oss-api/oss-api/artifacts An example HTTP `GET` request demonstrating how to call the `/api/v1/artifacts/{artifact_id}` endpoint, including necessary headers like Authorization. ```HTTP GET /api/v1/artifacts/{artifact_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP GET Request for Organization Workspaces Source: https://docs.zenml.io/api-reference/pro-api/pro-api/organizations/tenants An example HTTP 1.1 GET request to the /organizations/{organization_id}/tenants endpoint, demonstrating the required Host and Authorization headers. ```HTTP GET /organizations/{organization_id}/tenants HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Install GitHub Integration for ZenML Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/set-up-repository Installs the specific ZenML integration for GitHub, which is a prerequisite for connecting ZenML to GitHub repositories and leveraging GitHub as a code source. ```bash zenml integration install github ``` -------------------------------- ### Set up ZenML Project Environment and Initialize with Template Source: https://docs.zenml.io/user-guides/production-guide/end-to-end This snippet guides you through setting up the necessary Python environment for a ZenML end-to-end project. It installs core ZenML components, server, and notebook dependencies, along with the scikit-learn integration. Following this, it demonstrates how to initialize a new project directory using a ZenML template, ensuring all required dependencies are installed. ```Bash pip install "zenml[templates,server]" notebook zenml integration install sklearn -y ``` ```Bash mkdir zenml_batch_e2e cd zenml_batch_e2e zenml init --template e2e_batch --template-with-defaults # Just in case, we install the requirements again pip install -r requirements.txt ``` -------------------------------- ### Example HTTP Request to Get ZenML Stack Source: https://docs.zenml.io/api-reference/oss-api/oss-api/stacks An example of an HTTP GET request to retrieve a ZenML stack using its ID, including necessary headers like Authorization. ```HTTP GET /api/v1/stacks/{stack_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP GET Request for Stacks API Source: https://docs.zenml.io/api-reference/oss-api/oss-api/stacks A standard HTTP GET request example to retrieve stacks from the ZenML API, demonstrating the required Host and Authorization headers. ```HTTP GET /api/v1/stacks HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### ZenML API Usage Scenarios and Authentication Methods Source: https://docs.zenml.io/api-reference/pro-api/getting-started Compares the ZenML Pro API and Workspace API, outlining which API to use for specific tasks and their corresponding recommended authentication methods. This helps in choosing the correct API for managing organizations, triggering runs, or pipeline development. ```APIDOC Task | Use This API | Authentication Method ---|---|--- Managing organizations, workspaces, users | **ZenML Pro API** (cloudapi.zenml.io) | Short-lived API tokens from organization settings Triggering run templates, pipeline operations | **Workspace API** (your workspace URL) | Service accounts + API keys (recommended for automation) Pipeline development, artifact management | **Workspace API** (your workspace URL) | Temporary API tokens or service accounts ``` -------------------------------- ### Authenticate and Check Current User with ZenML Pro API Source: https://docs.zenml.io/api-reference/pro-api/getting-started Demonstrates how to use a generated API token to authenticate and retrieve current user information from the ZenML Pro API programmatically. Examples are provided for curl, wget, and Python. ```curl curl -H "Authorization: Bearer YOUR_API_TOKEN" https://cloudapi.zenml.io/users/me ``` ```wget wget -qO- --header="Authorization: Bearer YOUR_API_TOKEN" https://cloudapi.zenml.io/users/me ``` ```python import requests response = requests.get( "https://cloudapi.zenml.io/users/me", headers={"Authorization": f"Bearer YOUR_API_TOKEN"} ) print(response.json()) ``` -------------------------------- ### Register AWS Service Connector Interactively Source: https://docs.zenml.io/how-to/infrastructure-deployment/auth-management/aws-service-connector This command initiates an interactive registration process for the AWS Service Connector within ZenML. It's recommended for users who prefer not to install and configure the AWS CLI locally, guiding them through the setup. ```Shell zenml service-connector register -i --type aws ``` -------------------------------- ### ZenML Pro API Endpoints Reference Source: https://docs.zenml.io/api-reference/pro-api/getting-started A comprehensive list of available endpoints within the ZenML Pro API, categorized by resource, including nested sub-endpoints for specific actions and a link to the full OpenAPI specification. ```APIDOC Users: Authorize server Me Invitations Releases Devices: Verify Roles: Assignments Permissions Teams: Members Organizations: Trial Invitations Members Roles Teams Tenants Tenant Entitlement Validation: Name Tenant name Health Usage event Usage batch Stigg webhook Auth: Login Connections Authorize Callback Logout Device authorization Api token Tenant authorization Rbac: Check permissions Allowed resource ids Resource members Server: Info Pro API Specification: https://cloudapi.zenml.io/openapi.json ``` -------------------------------- ### Launch ZenML Dashboard Locally Source: https://docs.zenml.io/deploying-zenml/upgrade-zenml-server/migration-guide/migration-zero-twenty This snippet shows the command to start the ZenML Dashboard locally and the console output indicating successful deployment, connection to the local server, and the URL to access the dashboard. It also provides default login credentials. ```shell $ zenml up Deploying a local ZenML server with name 'local'. Connecting ZenML to the 'local' local ZenML server (http://127.0.0.1:8237). Updated the global store configuration. Connected ZenML to the 'local' local ZenML server (http://127.0.0.1:8237). The local ZenML dashboard is available at 'http://127.0.0.1:8237'. You can connect to it using the 'default' username and an empty password. ``` -------------------------------- ### Example HTTP Request to Get Service Connector Source: https://docs.zenml.io/api-reference/oss-api/oss-api/service-connectors An example HTTP GET request demonstrating how to retrieve a service connector using the specified endpoint, including required headers for authorization. ```HTTP GET /api/v1/service_connectors/{connector_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP Request to Create a ZenML Run Step Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps An example HTTP POST request demonstrating how to create a new run step using the `/api/v1/steps` endpoint, including required headers and a sample JSON request body. ```HTTP POST /api/v1/steps HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Content-Type: application/json Accept: */* Content-Length: 706 { "user": "123e4567-e89b-12d3-a456-426614174000", "project": "123e4567-e89b-12d3-a456-426614174000", "name": "text", "start_time": "2025-07-04T07:06:41.138Z", "end_time": "2025-07-04T07:06:41.138Z", "status": "initializing", "cache_key": "text", "code_hash": "text", "docstring": "text", "source_code": "text", "pipeline_run_id": "123e4567-e89b-12d3-a456-426614174000", "original_step_run_id": "123e4567-e89b-12d3-a456-426614174000", "parent_step_ids": [ "123e4567-e89b-12d3-a456-426614174000" ], "inputs": { "ANY_ADDITIONAL_PROPERTY": [ "123e4567-e89b-12d3-a456-426614174000" ] }, "outputs": { "ANY_ADDITIONAL_PROPERTY": [ "123e4567-e89b-12d3-a456-426614174000" ] }, "logs": { "uri": "text", "artifact_store_id": "123e4567-e89b-12d3-a456-426614174000" } } ``` -------------------------------- ### Example HTTP Request to Get Pipeline by ID Source: https://docs.zenml.io/api-reference/oss-api/oss-api/pipelines An example HTTP GET request demonstrating how to call the /api/v1/pipelines/{pipeline_id} endpoint, including necessary headers for authorization and content negotiation. ```HTTP GET /api/v1/pipelines/{pipeline_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP Request to Get Artifact Version Source: https://docs.zenml.io/api-reference/oss-api/oss-api/artifact-versions An example HTTP GET request demonstrating how to retrieve an artifact version using its ID, including necessary headers like Authorization. ```HTTP GET /api/v1/artifact_versions/{artifact_version_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example HTTP Request for Get Step Logs Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps/logs An example of an HTTP GET request to retrieve step logs, including the host, authorization header, and accepted content types. This snippet demonstrates the basic structure for calling the `/api/v1/steps/{step_id}/logs` endpoint. ```HTTP GET /api/v1/steps/{step_id}/logs HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Install ZenML Python Package Source: https://docs.zenml.io/getting-started/hello-world Installs the ZenML Python SDK and CLI tools into your environment using pip, enabling access to ZenML functionalities. ```Shell pip install zenml ``` -------------------------------- ### Get User HTTP Request Example Source: https://docs.zenml.io/api-reference/pro-api/pro-api/users An example HTTP request demonstrating how to call the GET /users/{user_id_or_email} endpoint to retrieve a specific user. This shows the path parameter usage and authorization. ```HTTP GET /users/{user_id_or_email} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### ZenML Workspace API Run Template Endpoints Source: https://docs.zenml.io/api-reference/pro-api/getting-started This section describes the Pro-specific API endpoints available at your workspace URL (e.g., https://1bfe8d94-zenml.cloudinfra.zenml.io/docs) for managing and triggering Run Templates. Run Templates enable triggering pipeline runs from external systems via HTTP requests, with service accounts and API keys recommended for automation. ```APIDOC Workspace API (Base URL: your workspace URL, e.g., https://1bfe8d94-zenml.cloudinfra.zenml.io/docs) Run Templates (Pro-specific): Purpose: Trigger pipeline runs from external systems using HTTP requests. GET /run_templates POST /run_templates GET /run_templates/{template_id} PATCH /run_templates/{template_id} POST /run_templates/{template_id}/runs (Trigger a run template) ``` -------------------------------- ### HTTP Request Example to Get a Tag Source: https://docs.zenml.io/api-reference/oss-api/oss-api/tags An example HTTP GET request demonstrating how to retrieve a tag by its name or ID. It includes the endpoint with a path parameter and necessary headers like Authorization. ```HTTP GET /api/v1/tags/{tag_name_or_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Activate ZenML Project Source: https://docs.zenml.io/getting-started/hello-world This command activates a specific project within ZenML, allowing you to switch contexts and work on different machine learning initiatives. Replace `` with the actual name of your ZenML project. ```bash zenml project set ``` -------------------------------- ### Define a Simple ZenML Pipeline with Steps Source: https://docs.zenml.io/how-to/infrastructure-deployment/auth-management/service-connectors-guide Provides a basic Python example of a ZenML pipeline. It defines two simple steps, `simple_step_one` and `simple_step_two`, and orchestrates their execution within a `simple_pipeline` function. This demonstrates the fundamental structure of a ZenML pipeline. ```python from zenml import step, pipeline @step def simple_step_one() -> str: """Simple step one.""" return "Hello World!" @step def simple_step_two(msg: str) -> None: """Simple step two.""" print(msg) @pipeline def simple_pipeline() -> None: """Define single step pipeline.""" message = simple_step_one() simple_step_two(msg=message) if __name__ == "__main__": simple_pipeline() ``` -------------------------------- ### Configure Deepchecks Check Conditions in ZenML Source: https://docs.zenml.io/stacks/stack-components/data-validators/deepchecks This example illustrates how to specify conditions for Deepchecks checks using the `check_kwargs` parameter in `deepchecks_data_integrity_check_step`. ZenML recognizes arguments starting with `condition_` and having a dictionary value as conditions, abstracting the direct Deepchecks API for condition setup. ```python deepchecks_data_integrity_check_step( check_list=[ DeepchecksDataIntegrityCheck.TABULAR_OUTLIER_SAMPLE_DETECTION, DeepchecksDataIntegrityCheck.TABULAR_STRING_LENGTH_OUT_OF_BOUNDS, ], dataset_kwargs=dict(label='class', cat_features=['country', 'state']), check_kwargs={ DeepchecksDataIntegrityCheck.TABULAR_OUTLIER_SAMPLE_DETECTION: dict( nearest_neighbors_percent=0.01, extent_parameter=3, condition_outlier_ratio_less_or_equal=dict( max_outliers_ratio=0.007, outlier_score_threshold=0.5, ), condition_no_outliers=dict( outlier_score_threshold=0.6, ) ), DeepchecksDataIntegrityCheck.TABULAR_STRING_LENGTH_OUT_OF_BOUNDS: dict( num_percentiles=1000, min_unique_values=3, condition_number_of_outliers_less_or_equal=dict( max_outliers=3, ) ), }, ... ) ``` -------------------------------- ### ZenML Global Configuration Initialization Output Source: https://docs.zenml.io/reference/global-settings Example console output demonstrating the initialization process of the ZenML global configuration, including default user and stack creation, and the initial stack table. ```console Initializing the ZenML global configuration version to 0.13.2 Creating default user 'default' ... Creating default stack for user 'default'... The active stack is not set. Setting the active stack to the default stack. Using the default store for the global config. Unable to find ZenML repository in your current working directory (/tmp/folder) or any parent directories. If you want to use an existing repository which is in a different location, set the environment variable 'ZENML_REPOSITORY_PATH'. If you want to create a new repository, run zenml init. Running without an active repository root. Using the default local database. ┏━━━━━━━━┯━━━━━━━━━━━━┯━━━━━━━━┯━━━━━━━━━┯━━━━━━━━━━━━━━━━┯━━━━━━━━━━━━━━┓ ┃ ACTIVE │ STACK NAME │ SHARED │ OWNER │ ARTIFACT_STORE │ ORCHESTRATOR ┃ ┠────────┼────────────┼────────┼─────────┼────────────────┼──────────────┨ ┃ 👉 │ default │ ❌ │ default │ default │ default ┃ ┗━━━━━━━━┷━━━━━━━━━━━━┷━━━━━━━━┷━━━━━━━━━┷━━━━━━━━━━━━━━━━┷━━━━━━━━━━━━━━┛ ``` -------------------------------- ### Example 200 Successful Response for Run Status Source: https://docs.zenml.io/api-reference/oss-api/oss-api/runs/status An example of a successful response body for the Get Run Status API endpoint, showing a typical 'initializing' status as a plain text string. ```text initializing ``` -------------------------------- ### Example: HTTP GET Request for Model Versions Source: https://docs.zenml.io/api-reference/oss-api/oss-api/models/model-versions An example of an HTTP GET request to retrieve model versions, demonstrating the correct endpoint path, host placeholder, and the required Authorization header for authentication. ```HTTP GET /api/v1/models/{model_name_or_id}/model_versions HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Register a Generic ZenML Code Repository Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/set-up-repository Registers a new code repository with ZenML using the command-line interface. This command requires a unique name for the repository, its type, and optional type-specific parameters for configuration. ```bash zenml code-repository register --type= [--CODE_REPOSITORY_OPTIONS] ``` -------------------------------- ### Example HTTP GET Request for Code Repository Source: https://docs.zenml.io/api-reference/oss-api/oss-api/code-repositories An example of an HTTP GET request to retrieve a code repository. This snippet demonstrates the required path, host, and the authorization header using a Bearer token. ```HTTP GET /api/v1/code_repositories/{code_repository_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Log in to ZenML Account Source: https://docs.zenml.io/getting-started/hello-world Connects your local ZenML environment to your ZenML Pro account, allowing you to log in and select your workspace for centralized management and collaboration. ```Shell zenml login ``` -------------------------------- ### Example HTTP GET Request for API Token Source: https://docs.zenml.io/api-reference/pro-api/pro-api/auth/api-token An example demonstrating how to make an HTTP GET request to the `/auth/api_token` endpoint. This snippet shows the required HTTP method, path, host, and the Authorization header with a Bearer token. ```HTTP GET /auth/api_token HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Define a Basic ZenML Pipeline Source: https://docs.zenml.io/getting-started/hello-world Illustrates how to define a simple ZenML step and pipeline in Python. The 'basic_step' returns a greeting, and 'basic_pipeline' orchestrates its execution. The script includes a standard entry point to run the pipeline locally. ```Python from zenml import step, pipeline @step def basic_step() -> str: """A simple step that returns a greeting message.""" return "Hello World!" @pipeline def basic_pipeline(): """A simple pipeline with just one step.""" basic_step() if __name__ == "__main__": basic_pipeline() ``` -------------------------------- ### Example HTTP GET Request for Service Connector Client Source: https://docs.zenml.io/api-reference/oss-api/oss-api/service-connectors/client Illustrates a sample HTTP GET request to the `/api/v1/service_connectors/{connector_id}/client` endpoint. This example includes the necessary Host and Authorization headers for accessing the API. ```HTTP GET /api/v1/service_connectors/{connector_id}/client HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Spin Up Local ZenML Server Source: https://docs.zenml.io/deploying-zenml/upgrade-zenml-server/migration-guide/migration-zero-twenty CLI command to quickly start and run a ZenML server instance locally on the current machine. This is suitable for local development and testing. ```Shell zenml up ``` -------------------------------- ### Install ZenML Integration for Code Repositories Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/set-up-repository Installs the necessary ZenML integration for a specific code repository type, enabling its use within ZenML workflows. Replace with the desired integration (e.g., 'github'). ```bash zenml integration install ``` -------------------------------- ### Install GitHub Integration for ZenML Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/connect-your-git-repository Installs the specific ZenML integration for GitHub, enabling ZenML to interact with GitHub code repositories and manage pipeline code directly from GitHub. ```bash zenml integration install github ``` -------------------------------- ### Get User Successful Response Example Source: https://docs.zenml.io/api-reference/pro-api/pro-api/users An example JSON response body for a successful call to the GET /users/{user_id_or_email} endpoint, showing the structure of a single UserRead object. This helps in understanding the returned data format. ```JSON { "name": "text", "avatar_url": "text", "company": "text", "job_title": "text", "metadata": {}, "password": "text", "password_expired": true, "email": "[email protected]", "oauth_provider": "text", "oauth_id": "text", "id": "123e4567-e89b-12d3-a456-426614174000", "is_active": true, "is_superuser": false } ``` -------------------------------- ### Example 200 OK Response for Get Run Steps Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps Illustrates a successful JSON response (HTTP 200 OK) from the `/api/v1/steps` endpoint, showing the structure of a `Page[StepRunResponse]` object, including pagination metadata and an array of `items` with detailed `body` and `metadata` fields for a step run. ```JSON { "index": 1, "max_size": 1, "total_pages": 1, "total": 1, "items": [ { "body": { "created": "2025-07-04T07:06:41.138Z", "updated": "2025-07-04T07:06:41.138Z", "user_id": "123e4567-e89b-12d3-a456-426614174000", "project_id": "123e4567-e89b-12d3-a456-426614174000", "status": "initializing", "start_time": "2025-07-04T07:06:41.138Z", "end_time": "2025-07-04T07:06:41.138Z", "model_version_id": "123e4567-e89b-12d3-a456-426614174000", "substitutions": { "ANY_ADDITIONAL_PROPERTY": "text" } }, "metadata": { "config": { "enable_cache": true, "enable_artifact_metadata": true, "enable_artifact_visualization": true, "enable_step_logs": true, "step_operator": "text", "experiment_tracker": "text", "parameters": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "settings": { "ANY_ADDITIONAL_PROPERTY": { "ANY_ADDITIONAL_PROPERTY": "anything" } }, "extra": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "failure_hook_source": { "module": "text", "attribute": "text", "type": "user", "ANY_ADDITIONAL_PROPERTY": "anything" }, "success_hook_source": { "module": "text", "attribute": "text", "type": "user", "ANY_ADDITIONAL_PROPERTY": "anything" }, "model": { "name": "text", "license": "text", "description": "text", "audience": "text", "use_cases": "text", "limitations": "text", "trade_offs": "text", "ethics": "text", "tags": [ "text" ], "version": "none", "save_models_to_registry": true, "model_version_id": "123e4567-e89b-12d3-a456-426614174000", "suppress_class_validation_warnings": false }, "retry": { "max_retries": 1, "delay": 0, "backoff": 0 }, "substitutions": { "ANY_ADDITIONAL_PROPERTY": "text" }, "outputs": {} ``` -------------------------------- ### Example HTTP Request to Get a Secret Source: https://docs.zenml.io/api-reference/oss-api/oss-api/secrets Provides a sample HTTP GET request to retrieve a secret. This example includes the endpoint path, host placeholder, authorization header with a bearer token, and accepted content types. ```HTTP GET /api/v1/secrets/{secret_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example JSON Response for GET /api/v1/models (200 OK) Source: https://docs.zenml.io/api-reference/oss-api/oss-api/models An example JSON payload representing a successful response (HTTP 200 OK) from the GET /api/v1/models endpoint, showcasing the structure of a paginated list of ModelResponse objects. ```JSON { "index": 1, "max_size": 1, "total_pages": 1, "total": 1, "items": [ { "body": { "created": "2025-07-04T07:06:08.769Z", "updated": "2025-07-04T07:06:08.769Z", "user_id": "123e4567-e89b-12d3-a456-426614174000", "project_id": "123e4567-e89b-12d3-a456-426614174000" }, "metadata": { "license": "text", "description": "text", "audience": "text", "use_cases": "text", "limitations": "text", "trade_offs": "text", "ethics": "text", "save_models_to_registry": true }, "resources": { "user": { "body": { "created": "2025-07-04T07:06:08.769Z", "updated": "2025-07-04T07:06:08.769Z", "active": false, "activation_token": "text", "full_name": "", "email_opted_in": true, "is_service_account": true, "is_admin": true, "default_project_id": "123e4567-e89b-12d3-a456-426614174000" }, "metadata": { "email": "", "external_user_id": "123e4567-e89b-12d3-a456-426614174000", "user_metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" } }, "resources": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "123e4567-e89b-12d3-a456-426614174000", "permission_denied": false, "name": "text" }, "tags": [ { "body": { "created": "2025-07-04T07:06:08.769Z", "updated": "2025-07-04T07:06:08.769Z", "user_id": "123e4567-e89b-12d3-a456-426614174000", "color": "grey", "exclusive": true }, "metadata": { "tagged_count": 1 }, "resources": { "user": { "body": { "created": "2025-07-04T07:06:08.769Z", "updated": "2025-07-04T07:06:08.769Z", "active": false, "activation_token": "text", "full_name": "", "email_opted_in": true, "is_service_account": true, "is_admin": true, "default_project_id": "123e4567-e89b-12d3-a456-426614174000" }, "metadata": { "email": "", "external_user_id": "123e4567-e89b-12d3-a456-426614174000", "user_metadata": { "ANY_ADDITIONAL_PROPERTY": "anything" } }, "resources": { "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "123e4567-e89b-12d3-a456-426614174000", "permission_denied": false, "name": "text" }, "ANY_ADDITIONAL_PROPERTY": "anything" }, "id": "123e4567-e89b-12d3-a456-426614174000", "permission_denied": false, "name": "text" } ], "latest_version_name": "text" ``` -------------------------------- ### Install ZenML Integration for Code Repositories Source: https://docs.zenml.io/how-to/project-setup-and-management/setting-up-a-project-repository/connect-your-git-repository Installs the necessary ZenML integration for a specific code repository type, enabling its use within ZenML. Replace `` with the desired integration (e.g., `github`). ```bash zenml integration install ``` -------------------------------- ### HTTP GET Request Example for Entitlement Source: https://docs.zenml.io/api-reference/pro-api/pro-api/organizations/entitlement An example of an HTTP GET request to fetch entitlement details for a specified feature and organization. This snippet demonstrates the basic structure including host, authorization header, and accept type. ```HTTP GET /organizations/{organization_id}/entitlement/{feature} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Minimal ZenML Helm Chart Configuration Example Source: https://docs.zenml.io/getting-started/deploying-zenml/deploy-with-helm An example `values.yaml` snippet demonstrating a minimal configuration for a ZenML server deployment, using a temporary SQLite database and a ClusterIP service without external exposure. ```yaml zenml: ingress: enabled: false ``` -------------------------------- ### Example HTTP Request to Get Model Version Source: https://docs.zenml.io/api-reference/oss-api/oss-api/model-versions An example HTTP 1.1 GET request to retrieve a model version, demonstrating the endpoint structure, host placeholder, and the required Authorization header with a bearer token. ```HTTP GET /api/v1/model_versions/{model_version_id} HTTP/1.1 Host: Authorization: Bearer YOUR_OAUTH2_TOKEN Accept: */* ``` -------------------------------- ### Example 200 OK Response for ZenML Run Step Creation Source: https://docs.zenml.io/api-reference/oss-api/oss-api/steps A sample JSON response body for a successful `POST /api/v1/steps` request, illustrating the structure of the returned `StepRunResponse` object, including body and metadata. ```JSON { "body": { "created": "2025-07-04T07:06:41.138Z", "updated": "2025-07-04T07:06:41.138Z", "user_id": "123e4567-e89b-12d3-a ```