Managing External Services

How to manage external, longer-lived services

This is an older version of the ZenML documentation. To read and view the latest version please visit this up-to-date URL.

ZenML interacts with external systems (e.g. prediction services, monitoring systems, visualization services) via a so-called Service abstraction. The concrete implementation of this abstraction deals with functionality concerning the life-cycle management and tracking of an external service (e.g. process, container, Kubernetes deployment etc.).

Using Services in Steps

Services can be passed through steps like any other object, and used to interact with the external systems that they represent:

from zenml.steps import step

def my_step(my_service: MyService) -> ...:
    if not my_service.is_running:
        my_service.start()  # starts service
    my_service.stop()  # stops service


One concrete example of a Service is the built-in LocalDaemonService, a service represented by a local daemon process which extends the base Service class with functionality concerning the life-cycle management and tracking of local daemon processes.

Another example is the TensorboardService which enables visualizing TensorBoard logs by managing a local TensorBoard server, which couples nicely with the TensorboardVisualizer to visualize Tensorboard logs:

from import (

service = TensorboardService(

# start the service

# stop the service

You can find full examples of using services here:

Last updated