Appearance
Sustain Mode
Sustain Mode automatically routes your AI requests to minimize carbon emissions while maintaining your quality requirements.
How Sustain Mode Works
Sustain Mode analyzes each request and:
- Assesses Carbon Impact: Evaluates real-time grid carbon intensity
- Scores Model Efficiency: Considers each model's carbon footprint per token
- Maintains Quality: Ensures responses meet your minimum quality threshold
- Optimizes Routing: Selects the most sustainable option that meets requirements
Enabling Sustain Mode
Project-Level Configuration
Enable Sustain Mode for all requests in a project:
python
from openai import OpenAI
client = OpenAI(
base_url="https://api.gateflow.ai/v1",
api_key="gw_prod_your_key_here"
)
# Enable Sustain Mode in project settings (via Dashboard or API)
# Then all requests automatically use carbon-optimized routing
response = client.chat.completions.create(
model="auto", # Let GateFlow choose the most sustainable model
messages=[{"role": "user", "content": "Analyze this sustainably"}]
)Request-Level Configuration
Override project settings for specific requests:
python
# Enable Sustain Mode for this specific request
response = client.chat.completions.create(
model="gpt-5.2",
routing_mode="sustain_optimized",
minimum_quality_score=85, # Minimum acceptable quality (0-100)
max_carbon_per_request_gco2=50, # Optional: Set maximum carbon budget
messages=[{"role": "user", "content": "Generate eco-friendly analysis"}]
)Configuration Options
Quality Threshold
Set the minimum quality score (0-100) you're willing to accept for carbon optimization:
python
# More aggressive optimization (lower quality threshold)
response = client.chat.completions.create(
model="auto",
routing_mode="sustain_optimized",
minimum_quality_score=80, # Allow more carbon-efficient models
messages=[{"role": "user", "content": "Draft content"}]
)
# Conservative optimization (higher quality threshold)
response = client.chat.completions.create(
model="auto",
routing_mode="sustain_optimized",
minimum_quality_score=95, # Prioritize quality over carbon savings
messages=[{"role": "user", "content": "Critical business analysis"}]
)Carbon Budget
Set maximum carbon emissions per request:
python
# Set carbon budget for the request
response = client.chat.completions.create(
model="auto",
routing_mode="sustain_optimized",
max_carbon_per_request_gco2=25, # 25 grams CO₂ equivalent max
messages=[{"role": "user", "content": "Quick summary"}]
)Fallback Behavior
Configure what happens when no sustainable alternative meets your requirements:
python
# Fallback options:
# - "use_requested_model": Use the originally requested model
# - "use_most_efficient": Use the most efficient model regardless of quality
# - "fail": Return error if no suitable model found
response = client.chat.completions.create(
model="gpt-5.2",
routing_mode="sustain_optimized",
minimum_quality_score=90,
fallback_behavior="use_requested_model", # Default: fall back to requested model
messages=[{"role": "user", "content": "Important analysis"}]
)Sustain Mode Response Data
Sustain Mode enhances responses with carbon tracking data:
python
response = client.chat.completions.create(
model="auto",
routing_mode="sustain_optimized",
messages=[{"role": "user", "content": "Analyze sustainability trends"}]
)
# Access sustainability metrics
print(f"Model used: {response.model}")
print(f"Original model requested: {response.sustainability.original_model}")
print(f"Carbon footprint: {response.sustainability.carbon_gco2e} gCO₂e")
print(f"Carbon saved: {response.sustainability.carbon_saved_gco2e} gCO₂e")
print(f"Quality score: {response.sustainability.quality_score}")
print(f"Grid carbon intensity: {response.sustainability.grid_carbon_intensity} gCO₂/kWh")
print(f"Sustain mode active: {response.sustainability.sustain_mode_active}")Best Practices
When to Use Sustain Mode
✅ Ideal for:
- Non-critical analysis and content generation
- Internal reports and summaries
- Draft content creation
- Background processing tasks
- Batch operations
❌ Use with caution for:
- Customer-facing critical responses
- High-stakes decision making
- Legal or compliance-related content
- Mission-critical applications
Gradual Adoption Strategy
- Start with monitoring: Enable Sustain Mode in "monitor-only" mode to see potential savings
- Test with non-critical workloads: Try on internal tools and background processes
- Adjust quality thresholds: Find the right balance for your use cases
- Monitor results: Track carbon savings and quality impact in the dashboard
- Expand usage: Gradually apply to more workloads as you gain confidence
Advanced Configuration
Task-Type Exclusions
Exclude specific task types from Sustain Mode:
python
# Configure in project settings (via Dashboard or API)
excluded_task_types = [
"legal_analysis",
"financial_advice",
"medical_diagnosis",
"customer_support_critical"
]Region-Specific Policies
Optimize for specific geographic regions:
python
# Prioritize providers with data centers in low-carbon regions
region_policy = {
"preferred_regions": ["nordics", "canada", "france"],
"avoid_regions": ["coal-heavy-region"]
}Troubleshooting
"No suitable sustainable model found"
Causes:
- Quality threshold set too high
- Carbon budget too restrictive
- Requested model has no sustainable alternatives
- All providers experiencing high carbon intensity
Solutions:
- Lower the
minimum_quality_score - Increase the
max_carbon_per_request_gco2 - Adjust
fallback_behaviorto "use_requested_model" - Add more providers to increase options
- Check grid carbon intensity in your region
Performance Impact
Sustain Mode adds minimal overhead:
- Routing decision: ~50-100ms additional latency
- Carbon data collection: ~20-50ms
- Total impact: Typically <150ms per request
For latency-sensitive applications, consider:
- Using
routing_mode="performance_optimized"for critical paths - Enabling Sustain Mode only for background processes
- Using asynchronous requests with time-shifted execution
Sustain Mode vs Manual Optimization
| Feature | Sustain Mode | Manual Optimization |
|---|---|---|
| Carbon Reduction | Automatic, real-time | Requires manual research |
| Quality Maintenance | Guaranteed thresholds | Manual quality checking |
| Provider Selection | Automatic, multi-provider | Manual provider choice |
| Grid Awareness | Real-time carbon intensity | Static assumptions |
| Reporting | Automatic tracking | Manual tracking required |
| Maintenance | Automatic updates | Manual updates needed |
Next Steps
- View Sustainability Dashboard - Monitor your carbon savings
- Configure Time-Shifted Execution - Defer requests to low-carbon periods
- Explore Provider Efficiency - Understand model carbon profiles