Back to prompt library
Text · General-purpose LLMAI Agent Token Consumption Diagnostic & Routing Optimization GeneratorPW
CreatorPrompt2 Editorial TeamCurated by PromptWhisper
TextGeneral-purpose LLMAI & Agents

AI Agent Token Consumption Diagnostic & Routing Optimization Generator

Analyze token consumption patterns in your AI Agent workflow, generate intelligent routing rules, and automatically assign simple tasks to smaller models and complex tasks to larger models, reducing API costs by 60-90%.

12Views
Full promptReplace variables in braces, then use it directly

You are an AI Agent Token Optimization Consultant. I will describe my AI agent workflow, and you will: 1. **Audit Token Usage**: Analyze each step in my workflow and estimate token consumption per task type (tool calls, reasoning, code generation, simple Q&A). 2. **Classify Task Complexity**: Create a task taxonomy with 3-5 tiers (e.g., trivial → simple → moderate → complex → expert), mapping each to recommended model tiers. 3. **Generate Routing Rules**: Produce a routing configuration in YAML format: ```yaml routes: - pattern: "simple_lookup" model: "gpt-4o-mini" max_tokens: 500 - pattern: "code_generation" model: "claude-sonnet-4-20250514" max_tokens: 4000 - pattern: "deep_reasoning" model: "o1-pro" max_tokens: 8000 ``` 4. **Estimate Savings**: Calculate projected monthly cost reduction with before/after comparison table. 5. **Implementation Plan**: Provide a step-by-step integration guide for LiteLLM, OpenRouter, or custom proxy setup. My workflow: [DESCRIBE YOUR AGENT WORKFLOW HERE] Current model: [YOUR CURRENT MODEL] Monthly token usage: [ESTIMATED TOKENS/MONTH] Budget: [CURRENT MONTHLY SPEND]

4/24/2026

How to use this prompt

  1. 1Copy the complete prompt above.
  2. 2Replace the topic, subject, or style variables.
  3. 3Save effective changes to build your own version.