1+ workflow :
2+ name : " model_selection_demo"
3+ description : " Demonstrate Claude model selection for cost optimization"
4+ version : " 2.0"
5+
6+ defaults :
7+ claude_preset : " development"
8+ output_dir : " ./outputs/model_selection_demo"
9+
10+ steps :
11+ # Example 1: Cost-effective development workflow
12+ - name : " simple_code_review"
13+ type : " claude_smart"
14+ preset : " development" # Uses sonnet automatically (cost-effective)
15+
16+ prompt :
17+ - type : " static"
18+ content : |
19+ Review this simple function for basic issues:
20+
21+ ```python
22+ def add_numbers(a, b):
23+ return a + b
24+ ```
25+
26+ Just check for basic syntax and style issues.
27+
28+ output_to_file : " simple_review.json"
29+
30+ # Example 2: High-quality analysis workflow
31+ - name : " complex_architecture_analysis"
32+ type : " claude_smart"
33+ preset : " analysis" # Uses opus automatically (best capability)
34+
35+ prompt :
36+ - type : " static"
37+ content : |
38+ Analyze this complex microservices architecture for:
39+ - Security vulnerabilities
40+ - Performance bottlenecks
41+ - Scalability issues
42+ - Design pattern violations
43+ - Technical debt
44+
45+ Provide detailed recommendations with specific implementation steps.
46+
47+ output_to_file : " architecture_analysis.json"
48+
49+ # Example 3: Production workflow with fallback
50+ - name : " production_deployment"
51+ type : " claude_smart"
52+ preset : " production" # Uses opus with sonnet fallback
53+
54+ prompt :
55+ - type : " static"
56+ content : |
57+ Generate a production deployment checklist for a critical banking application.
58+ Include security checks, rollback procedures, and monitoring setup.
59+
60+ output_to_file : " deployment_checklist.json"
61+
62+ # Example 4: Manual model selection - cost optimization
63+ - name : " batch_documentation"
64+ type : " claude"
65+
66+ claude_options :
67+ model : " sonnet" # Explicit cost-effective choice
68+ max_turns : 3
69+ allowed_tools : ["Read", "Write"]
70+
71+ prompt :
72+ - type : " static"
73+ content : |
74+ Generate basic documentation for these functions.
75+ Keep it simple and concise.
76+
77+ output_to_file : " basic_docs.md"
78+
79+ # Example 5: Manual model selection - high quality
80+ - name : " critical_security_audit"
81+ type : " claude"
82+
83+ claude_options :
84+ model : " opus" # Explicit high-quality choice
85+ fallback_model : " sonnet" # Fallback for reliability
86+ max_turns : 10
87+ allowed_tools : ["Read", "Glob", "Grep"]
88+
89+ prompt :
90+ - type : " static"
91+ content : |
92+ Perform a comprehensive security audit of the entire codebase.
93+ Look for:
94+ - SQL injection vulnerabilities
95+ - XSS attack vectors
96+ - Authentication bypass issues
97+ - Data exposure risks
98+ - Cryptographic weaknesses
99+
100+ Provide detailed findings with remediation steps.
101+
102+ output_to_file : " security_audit.json"
103+
104+ # Example 6: Cost comparison demonstration
105+ - name : " cost_comparison_summary"
106+ type : " gemini"
107+ model : " gemini-2.5-flash"
108+
109+ prompt :
110+ - type : " static"
111+ content : |
112+ Summarize the cost implications of this pipeline:
113+
114+ - simple_code_review: Used sonnet (~$0.01)
115+ - complex_architecture_analysis: Used opus (~$0.26)
116+ - production_deployment: Used opus with fallback (~$0.26)
117+ - batch_documentation: Used sonnet (~$0.01)
118+ - critical_security_audit: Used opus (~$0.26)
119+
120+ Total estimated cost: ~$0.80
121+ Cost if everything used opus: ~$1.30 (63% more expensive)
122+ Cost if everything used sonnet: ~$0.05 (94% cheaper, but lower quality for complex tasks)
123+
124+ Explain the cost optimization strategy.
125+
126+ output_to_file : " cost_analysis.json"
0 commit comments