Why Cost Optimization Matters
Benefits:- ✅ Reduce LLM costs - Save 40-60% on API costs
- ✅ Prevent budget overruns - Set limits and get alerts
- ✅ Track spending - Per-user, per-feature cost attribution
- ✅ Optimize performance - Balance cost vs latency
- ✅ Forecast costs - Predict future spending
- LLM API calls (tokens, models, providers)
- Infrastructure (compute, memory, storage)
- Data transfer (egress, cross-region)
- Monitoring and logging
- Secrets management
Quick Start
Enable Cost Tracking
Automatic Provider Selection
Cost-Optimized Client
Provider Cost Comparison
Optimization Strategies
Lowest Cost:- Always selects cheapest provider
- Best for batch processing
- May have higher latency
- Selects fastest provider
- Best for real-time applications
- May have higher costs
- Optimizes cost-latency tradeoff
- Best for most applications
- Configurable weights
Request Batching
Batch Multiple Requests
Caching Strategies
Response Caching
Semantic Caching
Budget Management
Set Budget Limits
Budget Alerts
Cost Attribution
Per-User Cost Tracking
Cost Allocation Tags
Infrastructure Cost Optimization
Serverless Optimization
Container Optimization
Kubernetes Resource Limits
Cost Monitoring
Real-Time Cost Dashboard
Cost Reports
Best Practices
- Set budget limits to prevent overruns
- Enable caching for repeated requests
- Use batch processing when possible
- Right-size infrastructure resources
- Monitor costs in real-time
- Use cost-optimized providers for non-critical workloads
- Implement rate limiting to control usage
- Track costs per user/feature for attribution
Cost Comparison
Provider Pricing (per 1M tokens)
| Provider | Model | Input | Output | Total (1:1) |
|---|---|---|---|---|
| OpenAI | GPT-4 | $30 | $60 | $45 |
| OpenAI | GPT-3.5 | $0.50 | $1.50 | $1.00 |
| Anthropic | Claude 3 Opus | $15 | $75 | $45 |
| Anthropic | Claude 3 Sonnet | $3 | $15 | $9 |
| Gemini Pro | $0.50 | $1.50 | $1.00 | |
| AWS | Bedrock Claude | $15 | $75 | $45 |
| Cohere | Command | $1 | $2 | $1.50 |
| Mistral | Large | $4 | $12 | $8 |
Infrastructure Pricing
| Platform | Compute | Memory | Cost/Month |
|---|---|---|---|
| AWS Lambda | 1GB-sec | 128MB | $0.0000166667 |
| Azure Functions | 1GB-sec | 128MB | $0.000016 |
| Google Cloud Functions | 1GB-sec | 128MB | $0.0000025 |
| Kubernetes (EKS) | 1 vCPU | 2GB | $73 |
| Heroku | 1 dyno | 512MB | $25 |
Support
- Documentation: docs.tealtiger.ai
- Cost Calculator: tealtiger.ai/calculator
- GitHub Issues: Report issues
- Email: reachout@tealtiger.ai

