-
Notifications
You must be signed in to change notification settings - Fork 548
Added a prompt optimization example #3903
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
✅ No broken links found! |
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
…tection This update significantly improves the prompt optimization example with several key features: - Auto-detect LLM providers (OpenAI/Anthropic) from model names or environment - Add configurable scoring system with quality, speed, and findings weights - Introduce scoreboard artifact to track and compare prompt performance - Improve production pipeline with graceful fallback to default prompts - Expand CLI with options for custom prompts, sampling, and scoring config - Support fully-qualified model names (provider:model format) The scoring system uses normalized weights and caps to prevent gaming, while the provider auto-detection simplifies setup for users switching between models.
Describe changes
This PR adds a new example demonstrating ZenML's artifact
management capabilities through a two-stage AI prompt optimization
workflow using Pydantic AI for exploratory data analysis.
Key Features:
sharing
What This Example Demonstrates
ZenML Core Capabilities:
cross-pipeline sharing
passing
Real-World Use Case:
systems
deployment
Usage
Complete workflow (default)
python run.py
Individual stages
python run.py --optimization-pipeline # Find best prompt
python run.py --production-pipeline # Use optimized prompt
Custom data sources
python run.py --data-source "local:data.csv"
python run.py --data-source "hf:scikit-learn/wine"
Technical Highlights
Artifact Management Pattern:
Stage 1: Tag best prompt with exclusive tag
add_tags(tags=[Tag(name="optimized", exclusive=True)],
infer_artifact=True)
Stage 2: Retrieve tagged prompt
artifacts = client.list_artifact_versions(tags=["optimized"],
size=1)
optimized_prompt = artifacts.items[0] if artifacts.items else
default_prompt
Simplified Architecture:
experiment tracking)
Code Quality
lines)
started
Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes