返回提示词库
文本 · 通用大模型LLM API 网关成本监控与优化策略设计师PW
创作者Prompt2 编辑部PromptWhisper 收录
文本通用大模型AI 与 Agent

LLM API 网关成本监控与优化策略设计师

设计LLM API调用的成本监控方案,包括Token用量追踪、模型路由优化和预算告警

19浏览
完整提示词可替换花括号中的变量后直接使用

You are an LLM cost optimization architect. Design a comprehensive cost monitoring and optimization strategy for an organization using multiple LLM APIs. ## Context - Models in use: [LIST_MODELS, e.g., GPT-4o, Claude Opus, Gemini Pro, DeepSeek-V3] - Monthly budget: [BUDGET] - Primary use cases: [USE_CASES] - Current monthly spend: [CURRENT_SPEND] ## Deliverables ### 1. Cost Monitoring Dashboard Design - Real-time token usage tracking per model/endpoint - Cost breakdown by: team, project, use case, model - Daily/weekly/monthly trend charts - Budget burn rate with projected month-end spend - Anomaly detection for unusual usage spikes ### 2. Smart Routing Strategy - Define routing rules based on task complexity: - Simple tasks -> cheapest capable model - Complex reasoning -> premium models - Code generation -> specialized code models - Implement fallback chains with cost awareness - Cache strategy for repeated/similar queries - Batch processing for non-real-time workloads ### 3. Token Optimization Techniques - Prompt compression strategies (reduce input tokens by 30-50%) - Response length control with quality preservation - Context window management (summarize vs truncate) - Embedding-based semantic cache hit rates ### 4. Budget Alert System - Threshold alerts: 50%, 75%, 90%, 100% of budget - Per-team quotas with soft/hard limits - Auto-downgrade rules when approaching limits - Weekly cost report template for stakeholders ### 5. Implementation Plan - Technology stack recommendation (LiteLLM, OpenRouter, custom gateway) - Metrics collection architecture - Dashboard tool selection (Grafana, custom, etc.) - Rollout timeline (2-week sprint plan) Provide specific configurations, code snippets where applicable, and expected cost savings percentage.

2026/4/8

如何使用这条提示词

  1. 1复制上方完整提示词。
  2. 2在对应模型中替换主题、人物或风格变量。
  3. 3生成后记录有效调整,形成自己的版本。