
Script an AI task-reduction workflow
You'll have a working Python or bash script that identifies low-value AI requests in your workflow and routes them away, reducing unnecessary compute.
What you'll make
AI Task-Reduction Script
- classify_request() — determines if a request needs AI or can be handled locally: what to include
- calculate_energy_cost() — estimates environmental impact using 0.3 Wh baseline: what to include
- route_task() — sends requests to appropriate handlers (local vs AI): what to include
- main() — orchestration with logging and cost tracking: what to include
Paste your complete Python or bash script with example output from a real day of usage
The 4 parts
Each part ends with a check you can see.
Map Your AI Request Pattern
Capture and categorize a week of your actual AI requests to identify reduction candidates
Done when
You have a log of 20+ real AI requests categorized by type and necessity level
Measure Your Environmental Impact
Calculate the energy consumption of your AI usage using the 0.3 Wh baseline metric
Done when
You have energy cost calculations for your request categories with specific Wh totals
Build Local-First Alternatives
Create specific rules for handling filterable requests without AI and test them on real tasks
Done when
You have 3-5 tested routing rules that handle specific request types locally
Code the Task-Reduction System
Build and test a complete script that classifies, routes, and tracks the environmental impact of your AI workflow
Done when
You have a working script that reduces AI requests by at least 20% while maintaining output quality
Capstone: you put together your AI Task-Reduction Script.
Where this helps
An elective: a single lesson that sits outside rtwo's job certificates and doesn't count toward one.
About this lesson
What you'll be able to do
- Run a working script that identifies and filters low-value AI requests in your workflow
- Calculate the energy cost of your AI usage using documented baseline metrics
- Have a tested set of routing rules that reduce unnecessary AI compute by at least 20%
- Know which types of requests to handle locally vs route to AI based on environmental impact
Who it's for
- Developers or analysts who make multiple AI API calls daily and want to reduce waste
- Teams tracking their environmental footprint who need concrete data on AI usage
- Anyone curious about the energy cost of their AI workflow who can run basic scripts
What it won't cover
- Setting up renewable energy for your infrastructure
- Comparing different AI model efficiency ratings
- Building custom low-power AI models
- Organizational carbon accounting beyond your direct usage
Skills you'll practise
- Energy consumption analysis for AI systems
- Request pattern classification
- Workflow routing logic design
- Environmental impact measurement