Skip to content

Commit 125c4cb

Browse files
htahir1github-actions[bot]bcdurakschustmiAlexejPenner
committed
Update README and add agent example (#3815)
* Update header.png file * Update ZenML logo alt text in README.md * Update core concepts and steps for ML workflows and agents * Update model registration and promotion steps * Enhance project and workspace organization features * Refactor ML pipeline steps for clarity and consistency * Update dependencies and add type hints to create_dataset(). * Update create_dataset to return split data as tuples * Add agent comparison pipeline steps * Refactor code for better readability * Update integration information in README.md * Update prompts, test architectures, and generate diagrams * Update typing annotations to Any in prompt materializer and visualizer * Add Langfuse observability integration to LLM utility calls * Update Langfuse integration for LiteLLM * Update readme_problem.png asset image * Optimised images with calibre/image-actions * Step Status Refresh Functionality + Kubernetes Orchestrator Implementation (#3735) * first checkpoint * new changes * fixes * new changes * small change * deprecate old method * new changes * missing import * listen to events * linting * loop optimization * changed the deprecation warning * new condition * switching to jobs * formatting * handling the store * not allowing finished steps to be updated * docstrings * label param name * removed unused function * comment and formatting * renamed function * moved steps outside * removed unused input * additional check * docstrings and formatting * removed status checks * orchestrator pod updates * new check * Upper limit datasets version (#3824) * Add Docker settings to pipeline and refactor data loading steps * Update agent visualizations with automatic generation * Update visualizations method in Agent Architecture Comparison example * Register agent materializer import to trigger registration * Refactor data_loading function return annotations * Add handling for missing OpenAI library import * Remove detailed agent workflow print statement * Update examples/agent_comparison/agent_comparison_pipeline.py Co-authored-by: Alexej Penner <[email protected]> * Update pipeline script with evaluation message * Update README.md * Update docs/book/how-to/secrets/secrets.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update README.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Remove Langfuse integration and references * Add token counting notes for accurate counting * Add import of "re" at the top of the file * Update README.md * Update imports to remove unnecessary type ignore * Update environment variables to use None as default * Integrate ZenML MCP Server for conversational insights * Auto-update of LLM Finetuning template --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Barış Can Durak <[email protected]> Co-authored-by: Michael Schuster <[email protected]> Co-authored-by: Alexej Penner <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: GitHub Actions <[email protected]> (cherry picked from commit 6b0047a)
1 parent 329c44a commit 125c4cb

36 files changed

+3168
-175
lines changed

README.md

Lines changed: 160 additions & 132 deletions
Large diffs are not rendered by default.
798 KB
Loading
3.11 MB
Loading

docs/book/getting-started/core-concepts.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ icon: lightbulb
77

88
![A diagram of core concepts of ZenML OSS](../.gitbook/assets/core_concepts_oss.png)
99

10-
**ZenML** is an extensible, open-source MLOps framework for creating portable, production-ready **MLOps pipelines**. It's built for data scientists, ML Engineers, and MLOps Developers to collaborate as they develop to production. In order to achieve this goal, ZenML introduces various concepts for different aspects of an ML workflow, and we can categorize these concepts under three different threads:
10+
**ZenML** is a unified, extensible, open-source MLOps framework for creating portable, production-ready **MLOps pipelines**. It's built for data scientists, ML Engineers, and MLOps Developers to collaborate as they develop to production. By extending the battle-tested principles you rely on for classical ML to the new world of AI agents, ZenML serves as one platform to develop, evaluate, and deploy your entire AI portfolio - from decision trees to complex multi-agent systems. In order to achieve this goal, ZenML introduces various concepts for different aspects of ML workflows and AI agent development, and we can categorize these concepts under three different threads:
1111

1212
<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden></th><th data-hidden data-card-target data-type="content-ref"></th><th data-hidden data-card-cover data-type="files"></th></tr></thead><tbody><tr><td><mark style="color:purple;"><strong>1. Development</strong></mark></td><td>As a developer, how do I design my machine learning workflows?</td><td></td><td><a href="core-concepts.md#1-development">#1-development</a></td><td><a href="../.gitbook/assets/development.png">development.png</a></td></tr><tr><td><mark style="color:purple;"><strong>2. Execution</strong></mark></td><td>While executing, how do my workflows utilize the large landscape of MLOps tooling/infrastructure?</td><td></td><td><a href="core-concepts.md#2-execution">#2-execution</a></td><td><a href="../.gitbook/assets/execution.png">execution.png</a></td></tr><tr><td><mark style="color:purple;"><strong>3. Management</strong></mark></td><td>How do I establish and maintain a production-grade and efficient solution?</td><td></td><td><a href="core-concepts.md#3-management">#3-management</a></td><td><a href="../.gitbook/assets/management.png">management.png</a></td></tr></tbody></table>
1313

@@ -17,7 +17,7 @@ If you prefer visual learning, this short video demonstrates the key concepts co
1717

1818
## 1. Development
1919

20-
First, let's look at the main concepts that play a role during the development stage of an ML workflow with ZenML.
20+
First, let's look at the main concepts that play a role during the development stage of ML workflows and AI agent pipelines with ZenML.
2121

2222
#### Step
2323

@@ -42,6 +42,12 @@ def step_2(input_one: str, input_two: str) -> str:
4242
"""Combines the two strings passed in."""
4343
combined_str = f"{input_one} {input_two}"
4444
return combined_str
45+
46+
@step
47+
def evaluate_agent_response(prompt: str, test_query: str) -> dict:
48+
"""Evaluates an AI agent's response to a test query."""
49+
response = call_llm_agent(prompt, test_query)
50+
return {"query": test_query, "response": response, "quality_score": 0.95}
4551
```
4652

4753
#### Pipelines
@@ -63,24 +69,34 @@ from zenml import pipeline
6369
def my_pipeline():
6470
output_step_one = step_1()
6571
step_2(input_one="hello", input_two=output_step_one)
72+
73+
@pipeline
74+
def agent_evaluation_pipeline():
75+
"""An AI agent evaluation pipeline."""
76+
prompt = "You are a helpful assistant. Please answer: {query}"
77+
test_query = "What is machine learning?"
78+
evaluation_result = evaluate_agent_response(prompt, test_query)
6679
```
6780

6881
Executing the Pipeline is as easy as calling the function that you decorated with the `@pipeline` decorator.
6982

7083
```python
7184
if __name__ == "__main__":
7285
my_pipeline()
86+
agent_evaluation_pipeline()
7387
```
7488

7589
#### Artifacts
7690

7791
Artifacts represent the data that goes through your steps as inputs and outputs, and they are automatically tracked and stored by ZenML in the artifact store. They are produced by and circulated among steps whenever your step returns an object or a value. This means the data is not passed between steps in memory. Rather, when the execution of a step is completed, they are written to storage, and when a new step gets executed, they are loaded from storage.
7892

93+
Artifacts can be traditional ML data (datasets, models, metrics) or AI agent components (prompt templates, agent configurations, evaluation results). The same artifact system seamlessly handles both use cases.
94+
7995
The serialization and deserialization logic of artifacts is defined by [Materializers](../how-to/artifacts/materializers.md).
8096

8197
#### Models
8298

83-
Models are used to represent the outputs of a training process along with all metadata associated with that output. In other words: models in ZenML are more broadly defined as the weights as well as any associated information. Models are first-class citizens in ZenML and as such viewing and using them is unified and centralized in the ZenML API, client, as well as on the [ZenML Pro](https://zenml.io/pro) dashboard.
99+
Models are used to represent the outputs of a training process along with all metadata associated with that output. In other words: models in ZenML are more broadly defined as the weights as well as any associated information. This includes traditional ML models (scikit-learn, PyTorch, etc.) and AI agent configurations (prompt templates, tool definitions, multi-agent system architectures). Models are first-class citizens in ZenML and as such viewing and using them is unified and centralized in the ZenML API, client, as well as on the [ZenML Pro](https://zenml.io/pro) dashboard.
84100

85101
#### Materializers
86102

@@ -160,9 +176,9 @@ Secrets are sensitive data that you don't want to store in your code or configur
160176

161177
#### Collaboration
162178

163-
Collaboration is a crucial aspect of any MLOps team as they often need to bring together individuals with diverse skills and expertise to create a cohesive and effective workflow for machine learning projects. A successful MLOps team requires seamless collaboration between data scientists, engineers, and DevOps professionals to develop, train, deploy, and maintain machine learning models.
179+
Collaboration is a crucial aspect of any MLOps team as they often need to bring together individuals with diverse skills and expertise to create a cohesive and effective workflow for machine learning projects and AI agent development. A successful MLOps team requires seamless collaboration between data scientists, engineers, and DevOps professionals to develop, train, deploy, and maintain both traditional ML models and AI agent systems.
164180

165-
With a deployed **ZenML Server**, users have the ability to create their own teams and project structures. They can easily share pipelines, runs, stacks, and other resources, streamlining the workflow and promoting teamwork.
181+
With a deployed **ZenML Server**, users have the ability to create their own teams and project structures. They can easily share pipelines, runs, stacks, and other resources, streamlining the workflow and promoting teamwork across the entire AI development lifecycle.
166182

167183
#### Dashboard
168184

docs/book/getting-started/hello-world.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ icon: hand-wave
77

88
# Hello World
99

10-
This guide will help you build and deploy your first ZenML pipeline, starting locally and then transitioning to the cloud without changing your code.
10+
This guide will help you build and deploy your first ZenML pipeline, starting locally and then transitioning to the cloud without changing your code. The same principles you'll learn here apply whether you're building classical ML models or AI agents.
1111

1212
{% stepper %}
1313
{% step %}
@@ -115,14 +115,24 @@ ZenML handles packaging code, building containers, orchestrating execution, and
115115
Congratulations! You've just experienced the core value proposition of ZenML:
116116

117117
* **Write Once, Run Anywhere**: The same code runs locally during development and in the cloud for production
118-
* **Separation of Concerns**: Infrastructure configuration and ML code are completely decoupled, enabling independent evolution of each
119-
* **Full Tracking**: Every run, artifact, and model is automatically versioned and tracked
118+
* **Unified Framework**: Use the same MLOps principles for both classical ML models and AI agents
119+
* **Separation of Concerns**: Infrastructure configuration and ML code are completely decoupled, enabling independent
120+
evolution of each
121+
* **Full Tracking**: Every run, artifact, and model is automatically versioned and tracked - whether it's a scikit-learn model or a multi-agent system
120122

121123
To continue your ZenML journey, explore these key topics:
122124

125+
**For All AI Workloads:**
123126
* **Pipeline Development**: Discover advanced features like [scheduling](../how-to/steps-pipelines/advanced_features.md#scheduling) and [caching](../how-to/steps-pipelines/advanced_features.md#caching)
124127
* **Artifact Management**: Learn how ZenML [stores, versions, and tracks your data](../how-to/artifacts/artifacts.md) automatically
125-
* **Organization**: Use [tags](../how-to/tags/tags.md) and [metadata](../how-to/metadata/metadata.md) to keep your ML projects structured
128+
* **Organization**: Use [tags](../how-to/tags/tags.md) and [metadata](../how-to/metadata/metadata.md) to keep your AI projects structured
129+
130+
**For LLMs and AI Agents:**
131+
* **LLMOps Guide**: Follow our comprehensive [LLMOps Guide](https://docs.zenml.io/user-guides/llmops-guide) for agent development patterns
132+
* **Agent Evaluation**: Learn to [systematically evaluate](https://github.com/zenml-io/zenml-projects/tree/main/llm-complete-guide) and compare different agent architectures
133+
* **Prompt Management**: Version and track prompts, tools, and agent configurations as [artifacts](../how-to/artifacts/artifacts.md)
134+
135+
**Infrastructure & Deployment:**
126136
* **Containerization**: Understand how ZenML [handles containerization](../how-to/containerization/containerization.md) for reproducible execution
127137
* **Stacks & Infrastructure**: Explore the concepts behind [stacks](../how-to/stack-components/stack_components.md) and [service connectors](../how-to/stack-components/service_connectors.md) for authentication
128138
* **Secrets Management**: Learn how to [handle sensitive information](../how-to/secrets/secrets.md) securely

docs/book/getting-started/zenml-pro/projects.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,19 @@ icon: clipboard-list
55

66
# Projects
77

8-
Projects in ZenML Pro provide a logical subdivision within workspaces, allowing you to organize and manage your MLOps resources more effectively. Each project acts as an isolated environment within a workspace, with its own set of pipelines, artifacts, models, and access controls.
8+
Projects in ZenML Pro provide a logical subdivision within workspaces, allowing you to organize and manage your MLOps resources more effectively. Each project acts as an isolated environment within a workspace, with its own set of pipelines, artifacts, models, and access controls. This isolation is particularly valuable when working with both traditional ML models and AI agent systems, allowing teams to separate different types of experiments and workflows.
99

1010
## Understanding Projects
1111

12-
Projects help you organize your ML work and resources. You can use projects to separate different initiatives, teams, or experiments while sharing common resources across your workspace.
12+
Projects help you organize your ML work and resources. You can use projects to separate different initiatives, teams, or experiments while sharing common resources across your workspace. This includes separating traditional ML experiments from AI agent development work.
1313

1414
Projects offer several key benefits:
1515

1616
1. **Resource Isolation**: Keep pipelines, artifacts, and models organized and separated by project
1717
2. **Granular Access Control**: Define specific roles and permissions at the project level
1818
3. **Team Organization**: Align projects with specific teams or initiatives within your organization
1919
4. **Resource Management**: Track and manage resources specific to each project independently
20+
5. **Experiment Separation**: Isolate different types of AI development work (ML vs agents vs multi-modal systems)
2021

2122
## Using Projects with the CLI
2223

@@ -112,14 +113,17 @@ Projects provide isolation for various MLOps resources:
112113
* Create projects based on logical boundaries (e.g., use cases, teams, or products)
113114
* Use clear naming conventions for projects
114115
* Document project purposes and ownership
116+
* Separate traditional ML and agent development where needed
115117
2. **Access Control**
116118
* Start with default roles before creating custom ones
117119
* Regularly audit project access and permissions
118120
* Use teams for easier member management
121+
* Implement stricter controls for production agent systems
119122
3. **Resource Management**
120123
* Monitor resource usage within projects
121124
* Set up appropriate quotas and limits
122125
* Clean up unused resources regularly
126+
* Track LLM API costs per project for agent development
123127
4. **Documentation**
124128
* Maintain project-specific documentation
125129
* Document custom roles and their purposes

docs/book/getting-started/zenml-pro/workspaces.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ icon: briefcase
99
**Note**: Workspaces were previously called "Tenants" in earlier versions of ZenML Pro. We've updated the terminology to better reflect their role in organizing MLOps resources.
1010
{% endhint %}
1111

12-
Workspaces are individual, isolated deployments of the ZenML server. Each workspace has its own set of users, roles, projects, and resources. Essentially, everything you do in ZenML Pro revolves around a workspace: all of your projects, pipelines, stacks, runs, connectors and so on are scoped to a workspace.
12+
Workspaces are individual, isolated deployments of the ZenML server. Each workspace has its own set of users, roles, projects, and resources. Essentially, everything you do in ZenML Pro revolves around a workspace: all of your projects, pipelines, stacks, runs, connectors and so on are scoped to a workspace. This includes both traditional ML workflows and AI agent development projects.
1313

1414
![Image showing the workspace page](<.gitbook/assets/Workspace - Home.png>)
1515

@@ -125,10 +125,12 @@ Another approach is to create workspaces based on your organization's structure
125125
* Data Science Department Workspace
126126
* Research Department Workspace
127127
* Production Department Workspace
128+
* AI Agent Development Workspace
128129
2. **Team-based Separation**: Align workspaces with your organizational structure:
129130
* ML Engineering Team Workspace
130131
* Research Team Workspace
131132
* Operations Team Workspace
133+
* Agent Development Team Workspace
132134
3. **Data Classification**: Separate workspaces based on data sensitivity:
133135
* Public Data Workspace
134136
* Internal Data Workspace

docs/book/how-to/artifacts/artifacts.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ def create_data() -> pd.DataFrame:
3838
"feature_2": [4, 5, 6],
3939
"target": [10, 20, 30]
4040
})
41+
42+
@step
43+
def create_prompt_template() -> str:
44+
"""Creates a prompt template that becomes an artifact."""
45+
return """
46+
You are a helpful customer service agent.
47+
48+
Customer Query: {query}
49+
Previous Context: {context}
50+
51+
Please provide a helpful response following our company guidelines.
52+
"""
4153
```
4254

4355
### Consuming Artifacts (Step Inputs)
@@ -51,11 +63,27 @@ def process_data(df: pd.DataFrame) -> pd.DataFrame:
5163
df["feature_3"] = df["feature_1"] * df["feature_2"]
5264
return df
5365

66+
@step
67+
def test_agent_response(prompt_template: str, test_query: str) -> dict:
68+
"""Uses a prompt template artifact to test agent responses."""
69+
filled_prompt = prompt_template.format(
70+
query=test_query,
71+
context="Previous customer complained about delayed shipping"
72+
)
73+
# Your agent logic here
74+
response = call_llm_agent(filled_prompt)
75+
return {"query": test_query, "response": response, "prompt_used": filled_prompt}
76+
5477
@pipeline
5578
def simple_pipeline():
5679
"""Pipeline that creates and processes artifacts."""
80+
# Traditional ML artifacts
5781
data = create_data() # Produces an artifact
5882
processed_data = process_data(data) # Uses and produces artifacts
83+
84+
# AI agent artifacts
85+
prompt = create_prompt_template() # Produces a prompt artifact
86+
agent_test = test_agent_response(prompt, "Where is my order?") # Uses prompt artifact
5987
```
6088

6189
### Artifacts vs. Parameters
@@ -498,7 +526,9 @@ Artifacts are a central part of ZenML's approach to ML pipelines. They provide:
498526
* Visualization capabilities
499527
* Cross-pipeline data sharing
500528

501-
By understanding how artifacts work, you can build more effective, maintainable, and reproducible ML pipelines.
529+
Whether you're working with traditional ML models, prompt templates, agent configurations, or evaluation datasets, ZenML's artifact system treats them all uniformly. This enables you to apply the same MLOps principles across your entire AI stack - from classical ML to complex multi-agent systems.
530+
531+
By understanding how artifacts work, you can build more effective, maintainable, and reproducible ML pipelines and AI workflows.
502532

503533
For more information on specific aspects of artifacts, see:
504534

0 commit comments

Comments
 (0)