> Real-world cost optimization results from Washin Village's animal recognition system
Scanned 5/31/2026
Install via CLI
openskills install tools-only/X-Skills# 💰 GAIA v4.8.2 Cost Savings Report
> Real-world cost optimization results from Washin Village's animal recognition system
## 📊 Project Overview
| Item | Value |
|------|-------|
| **System** | GAIA (Global AI Intelligence for Animals) |
| **Version** | v4.8.2 |
| **Task** | Animal recognition from videos |
| **Dataset** | 294 videos |
| **Model** | Claude Sonnet 4.5 |
| **Test Date** | January 2026 |
---
## 📈 Results Summary
### Cost Comparison
| Optimization | Cost/Video | Total (294) | Savings |
|--------------|------------|-------------|---------|
| ❌ No optimization | $0.038 | $11.14 | — |
| ✅ + Prompt Caching | $0.033 | $9.62 | **14%** |
| ✅ + Batch API | $0.019 | $5.57 | **50%** |
| ✅ **+ Both** | **$0.016** | **$4.79** | **57%** 🔥 |
### Yearly Projection (at 294 videos/month)
| Mode | Monthly | Yearly | Yearly Savings |
|------|---------|--------|----------------|
| No optimization | $11.14 | $133.68 | — |
| **Fully optimized** | $4.79 | $57.48 | **$76.20/year** |
---
## 🔍 Why Only 14% from Caching?
**Expected:** 90% savings from Prompt Caching
**Actual:** 14% savings
### Root Cause: Image-Heavy Workload
```
Input Token Distribution:
├── System Prompt: ~15% → ✅ Cacheable (saves 90%)
└── Image Data: ~85% → ❌ Cannot cache
Actual Savings: 15% × 90% = ~14%
```
**Key Insight:** For image/video workloads, caching only applies to the system prompt portion. The 90% savings only applies to text-heavy workloads.
---
## 💡 Techniques Applied
### 1. Prompt Caching
```python
system=[{
"type": "text",
"text": "You are GAIA, an animal recognition AI...",
"cache_control": {"type": "ephemeral"} # ← This line!
}]
```
- Cache TTL: 5 minutes (auto-refresh on use)
- Minimum tokens: 1,024 (Sonnet)
- Cache hit rate: 95%+ (sequential processing)
### 2. Batch API
```python
batch = client.messages.batches.create(
requests=[
{"custom_id": f"video-{i}", "params": {...}}
for i in range(294)
]
)
```
- 50% discount on all tokens
- Completed in: ~45 minutes
- No rate limit issues
---
## 📋 Detailed Breakdown
### Per-Request Cost Analysis
| Component | Tokens | Normal Price | Optimized Price |
|-----------|--------|--------------|-----------------|
| System Prompt | 2,000 | $0.006 | $0.0006 (cached) |
| Image Input | 10,000 | $0.030 | $0.015 (batch) |
| Output | 500 | $0.0075 | $0.00375 (batch) |
| **Total** | 12,500 | **$0.0435** | **$0.019** |
### Pricing Reference (Sonnet 4.5)
| Type | Price | With Batch | With Cache |
|------|-------|------------|------------|
| Input | $3/MTok | $1.50/MTok | — |
| Output | $15/MTok | $7.50/MTok | — |
| Cache Write | $3.75/MTok | — | +25% first time |
| Cache Read | $0.30/MTok | — | **-90%** |
---
## ✅ Recommendations
Based on our GAIA experience:
| Workload Type | Best Strategy | Expected Savings |
|---------------|---------------|------------------|
| Text-heavy (chatbots) | Prompt Caching | 70-90% |
| Image/Video processing | Batch API | 50% |
| Mixed workloads | Both techniques | 50-60% |
| Real-time required | Prompt Caching only | 10-30% |
---
## 🔗 Related Files
- [Batch API Example Script](../scripts/batch_example.py)
- [Caching Example Script](../scripts/cache_example.py)
- [Cost Calculator Script](../scripts/calculate_savings.py)
---
*Report generated by Washin Village (和心村) — Home of 28 cats & dogs in Japan's Boso Peninsula*
🐱 **Made with love for the AI community**
No comments yet. Be the first to comment!