bedrock-cost-optimize
Skill mit 6-Phasen-Workflow plus 10 konkrete Hebel. Erstmals durchgespielt im Projekt _index gegen av-production im Mai 2026 ($42 Sonnet-4.6-Burst → Optimierungs-Vorlage).
Trigger-Phrasen
„bedrock kosten audit”
„warum kostet bedrock so viel”
„AIP einrichten fuer X”
„MCP token check”
„cost-gate fuer Y”
„spar bedrock”
„kostentreiber finden in Bedrock”
Workflow — 6 Phasen
Phase Worum Skript-Hinweis 1 Discover Wer ruft Bedrock? (CloudWatch AWS/Bedrock Namespace + ECS/Lambda-Inventar). CloudTrail Data-Events sind standardmaessig NICHT erfasst — daher CloudWatch zuerst. siehe Phase-1-Pattern im Projekt-Plan 2 Baseline Pro Caller: Bedrock-Modell (env-vars + Source-Code), System-Prompt-Token-Schaetzung (chars/3.5 fuer DE), Avg In/Out aus CloudWatch. analog 3 Gate Notbremsen: AWS Budget+Alarm, Service-Quotas, max_tokens Hard-Caps pro Caller. Budget-Action mit IAM-Restrict nur nach Marvin-OK. playbook §3 4 Profile Application Inference Profile pro Caller + Cost-Allocation-Tags + Bedrock Model-Invocation-Logging aktivieren.playbook §4 5 Optimize Datengetrieben (nach 3 Tagen AIP-Daten): Tool-Description-Cutdown, System-Prompt+RAG-Tuning, Modell-Routing pruefen, Batch-Inference fuer Async, Embeddings-Modell-Wahl. playbook §5 6 Compound Lessons → mcp-best-practices + mcp-eigenbau + routine-anlegen. Token-Audit wird Pflicht-Check. playbook §6
Die 10 Hebel (Quick-Reference)
# Hebel Effekt Aufwand 1 Application Inference Profile pro Caller + Tags Sichtbarkeit pro Caller in Cost Explorer 1h 2 AWS Budget + (optional Action mit IAM-Restrict) Notbremse gegen Runaway-Cost 30min 3 max_tokens Hard-Cap + Stop-Sequences pro Callerverhindert ungezuegelten Output, schuetzt vor Loops 1h 4 MCP-Tool-Description-Audit + Cutdown Anthropic-Pattern: bis 50% Input-Reduktion bei Tool-heavy Agents 3-4h 5 System-Prompt + RAG-Tuning (Top-K, Chunk-Size) 50-70% Input-Reduktion bei RAG-Use-Cases 2h 6 Prompt-Caching 1h-TTL als Default bis 90% Rabatt auf Cache-Reads bei statischem System-Prompt 1h pro Caller 7 Embeddings: Titan v2 statt Cohere Multilingual wo DE-only 5x billiger pro Embedding 1 Nachmittag 8 Modell-Routing Haiku-First drastisch billiger fuer Background-Tasks parallel-Session 9 Batch-Inference fuer Async-Workloads 50% Rabatt vs On-Demand 1-2h pro Caller 10 Bedrock Service-Quotas drosseln Hard-Stop fuer Runaway-Loops 30min
Anti-Patterns (gesehen in av-production Mai 2026)
Anti-Pattern Befund TASK_MODEL=claude-sonnet-4-6 in Open-WebUIBackground-Tasks (Title-Gen, Tag-Gen, Search-Query-Gen) laufen auf Sonnet statt Haiku. 60-70% der Sonnet-Calls sind Background. Quick-Win: TASK_MODEL=Haiku. thinking.budget_tokens=4096 in DEFAULT_MODEL_PARAMSExtended Thinking AN ohne Use-Case. Output-Token-Kosten. max_tokens=8192 DefaultLLM kann ohne Hardcap explodieren bei Loop-Bug. Caching deklariert aber 0 Cache-Reads LiteLLM-Config cache_control_injection_points: [{location: message, role: system}] allein reicht nicht — Bedrock-Converse-API erwartet cachePoint-Bloecke an anderen Stellen. 1M-Context-Beta versehentlich aktiv 2x Input-Preis ueber 200k Tokens. Aktuell sieht’s wie ein einmaliger Test aus, aber Pattern blockieren. CloudTrail-Lookup fuer Bedrock-Caller leer, weil InvokeModel ein Data-Event ist. Stattdessen: Bedrock Model-Invocation-Logging aktivieren ODER ueber CloudWatch-Metrics korrelieren.
Pflicht-Hooks fuer andere Skills
mcp-eigenbau : vor Live-Gang audit-checklist.md durchlaufen — Token-Footprint pro Tool < 3000 Tokens, max_tokens-Cap gesetzt.
routine-anlegen : im 6-Fragen-Brief Pflicht-Punkt max_tokens-Cap + AIP-ARN.
(Implementierung in Phase 6 des bedrock-cost-optimize-Projekts.)
Verwandte Doku
Projekt _index — erstmalige Anwendung mit allen Findings
mcp-best-practices — wird in Phase 6 um Token-Footprint-Sektion erweitert
_index — AWS-Account-Struktur, IAM-Roles