tune-cost-optimized-ai-gateway — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited tune-cost-optimized-ai-gateway (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
| Parameter | Default | Range | Impact |
|---|---|---|---|
| Similarity threshold | 0.95 | 0.85-0.99 | Lower = more hits, risk of wrong cached answer |
| Cache TTL | 1 hour | 5min-24hr | Longer = more hits, risk of stale data |
| Max cache entries | 100K | 10K-1M | More = more VRAM, higher hit rate |
| Embedding model | text-embedding-3-small | small/large | Small = cheaper + faster cache lookup |
| Cache scope | Per-tenant | Global/Per-tenant | Global = higher hit rate, shared privacy risk |
Tuning methodology:
| Factor | PTU | Pay-As-You-Go |
|---|---|---|
| Pricing | Fixed monthly | Per-token |
| Best for | Predictable, high-volume | Variable, bursty |
| Latency | Guaranteed | Best-effort |
| Commitment | 1-month minimum | None |
| Break-even | ~30K TPM sustained | Below 30K TPM |
Decision matrix:
| Monthly Volume | Recommendation | Why |
|---|---|---|
| <1M tokens/day | Pay-as-you-go | PTU overhead not justified |
| 1M-10M tokens/day | PTU for base + PAYG for burst | Hybrid = cost + flexibility |
| >10M tokens/day | PTU (committed) | Significant savings + guaranteed throughput |
| Strategy | Configuration | When to Use |
|---|---|---|
| Weighted round-robin | 60/40 primary/secondary | General traffic distribution |
| Latency-based | Route to fastest region | Latency-sensitive applications |
| Cost-based | Route to cheapest region | Pure FinOps optimization |
| Capacity-based | Route to lowest utilization | Prevent throttling |
| Compliance-based | Route by data residency | GDPR/HIPAA requirements |
Dynamic weight tuning:
| Tier | Budget | Rate | Model | % of Users |
|---|---|---|---|---|
| Free | 100K tok/mo | 10/min | mini only | 60% |
| Standard | 1M tok/mo | 60/min | mini + 4o | 30% |
| Premium | 10M tok/mo | 300/min | All | 8% |
| Enterprise | Unlimited | 1000/min | All + priority | 2% |
Cost allocation: Track per-tenant usage in Redis sorted sets for O(1) budget checks.
Monthly cost breakdown (100K requests/day, avg 500 tokens/request):
| Component | Without Gateway | With Gateway (30% cache) | Savings |
|---|---|---|---|
| Azure OpenAI (gpt-4o) | $7,500 | $5,250 | $2,250 |
| APIM (Standard v2) | — | $300 | — |
| Redis (Premium P1) | — | $400 | — |
| Embedding (cache key) | — | $20 | — |
| Total | $7,500 | $5,970 | $1,530 (20%) |
With 50% cache hit: Total drops to $4,470 — $3,030 savings (40%).
Optimization levers:
After tuning, compare:
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.