Multi-Model & Multi-Step
Multi-step workflows, leveraging different models' strengths, and building reusable pipeline templates.
🎭 Multi-Step Workflows
Draft-Refine Pattern
// Stage 1: fast draft
drafter = aiMessage()
.system( "Generate quick content drafts" )
.user( "Write about: ${topic}" )
.to( aiModel( "openai", { model: "gpt-4o-mini" } ) )
.transform( r => r.content )
// Stage 2: quality refinement
refiner = aiMessage()
.system( "Improve and expand content while maintaining the core message" )
.user( "Enhance this draft: ${draft}" )
.to( aiModel( "openai", { model: "gpt-4o" } ) )
.transform( r => r.content )
topic = "AI in healthcare"
draft = drafter.run( { topic: topic } )
refined = refiner.run( { draft: draft } )Analysis-Enhancement Pattern
Validation Pipeline
🔀 Multi-Model Pipelines
Model Specialization
Dynamic Model Selection
♻️ Reusable Templates
Parameterized Pipelines
Pipeline Factories
Composable Building Blocks
Related Pages
Last updated