This prompt is designed for infrastructure engineers operating multi-model routing middleware. Use it when you need to decide per-request whether a task requires a premium model, a standard model, or can be handled by a lightweight model. The prompt assesses input complexity against a defined rubric and selects the cheapest model tier capable of producing an acceptable result. This is not a general-purpose chatbot prompt. It belongs inside a routing layer that intercepts requests before they reach your primary model invocation. The output is a structured tier selection with justification, not a conversational response. Deploy this when your system has at least two model tiers with distinct pricing and capability profiles, and when over-routing to premium models is measurably increasing your inference costs without proportional quality gains.
Prompt
Model Tier Selection Prompt Based on Complexity and Budget

When to Use This Prompt
Defines the operational context, required infrastructure, and failure boundaries for deploying a model tier selection prompt in a production routing layer.
The ideal deployment scenario involves a middleware service that inspects every incoming request before model dispatch. The prompt expects a well-defined model catalog with per-token pricing, capability descriptions, and complexity thresholds. You must provide a complexity rubric that maps input characteristics—such as reasoning depth, domain specificity, output precision requirements, and ambiguity level—to model tier requirements. Without this rubric, the prompt will produce inconsistent or overly conservative routing decisions. The prompt is stateless and should be evaluated per-request, not per-session. It works best when paired with a lightweight pre-classifier that extracts complexity signals before the routing decision, reducing the token overhead of the routing prompt itself.
Do not use this prompt when you have a single model tier, when all requests require premium quality guarantees, or when your cost structure makes routing overhead more expensive than always using a mid-tier model. Avoid deploying it in systems where latency from an additional routing step exceeds the latency savings from using a faster model. If your complexity rubric is poorly calibrated, the prompt will either over-route to premium (wasting money) or under-route to lightweight models (degrading quality). Start with a shadow deployment that logs routing decisions without enforcing them, then compare actual quality outcomes before cutting over. For high-stakes domains such as healthcare, legal, or safety-critical systems, always require human review of routing decisions that downgrade from premium, and never allow automatic downgrades for requests classified as high-risk.
Use Case Fit
Where this prompt works, where it fails, and what you must provide before putting it into production.
Good Fit: Multi-Model Routing Middleware
Use when: you operate a routing layer that dispatches requests to at least two model tiers (e.g., lightweight, standard, premium) and need per-request tier selection based on complexity and budget. Guardrail: define explicit complexity thresholds and cost caps in the prompt variables so the model has concrete boundaries rather than vague guidance.
Bad Fit: Single-Model Deployments
Avoid when: your system only has one model available or when the cost difference between tiers is negligible. Risk: the prompt adds latency and token overhead without producing actionable routing decisions. Guardrail: skip tier selection entirely and use a static model assignment until you have at least two tiers with meaningful cost or capability differences.
Required Input: Model Catalog with Pricing
What to watch: the prompt cannot make cost-aware decisions without accurate per-token or per-request pricing for each model tier. Guardrail: provide a structured model catalog variable with tier names, pricing, context windows, and capability descriptions. Update this catalog when pricing changes or models are deprecated.
Required Input: Complexity Assessment Rubric
What to watch: without a clear rubric, the model defaults to premium routing for ambiguous inputs, inflating costs. Guardrail: include a complexity rubric with concrete examples (e.g., simple lookup vs. multi-step reasoning vs. domain-expert analysis) and require the model to cite which rubric level applies before selecting a tier.
Operational Risk: Premium Creep Under Ambiguity
Risk: the model overestimates complexity when inputs are long, contain technical jargon, or mix multiple topics, routing everything to the most expensive tier. Guardrail: add a cost-escalation counter in your harness that tracks premium routing frequency and alerts when it exceeds a defined threshold (e.g., >30% of requests).
Operational Risk: Stale Pricing Data
Risk: model pricing changes, new tiers launch, or old tiers are deprecated, but the prompt still references outdated costs, producing incorrect routing decisions. Guardrail: version your model catalog alongside the prompt and add an eval that checks routing decisions against current pricing. Fail the eval if decisions reference deprecated models or incorrect costs.
Copy-Ready Prompt Template
A copy-ready prompt template for selecting the optimal model tier based on input complexity and cost constraints.
The following prompt is designed to be pasted directly into your routing middleware. It instructs the model to act as a cost-aware router, classifying an incoming request's complexity and selecting the most appropriate model tier from a predefined catalog. The prompt uses a strict rubric to justify its selection, ensuring that a premium model is only used when the complexity genuinely warrants the additional expense. Before deployment, you must replace all square-bracket placeholders with your specific model catalog, pricing, and budget constraints.
textYou are a cost-aware routing classifier. Your task is to analyze the following user request and select the most appropriate model tier based on its complexity and our defined budget constraints. ### COMPLEXITY RUBRIC Evaluate the request against these criteria: - **Low Complexity:** Simple factual lookup, single-step instruction, well-defined format conversion, or common knowledge query. No multi-step reasoning required. - **Medium Complexity:** Multi-step reasoning, comparison of a few entities, summarization of a single document, or generation with specific stylistic constraints. - **High Complexity:** Multi-document synthesis, complex logical deduction, advanced code generation with multiple dependencies, or creative tasks requiring deep domain expertise. ### MODEL TIER CATALOG - **tier: "lightweight"** model_id: [LIGHTWEIGHT_MODEL_ID] cost_per_1k_tokens: [LIGHTWEIGHT_COST] suitable_for: "Low Complexity" - **tier: "standard"** model_id: [STANDARD_MODEL_ID] cost_per_1k_tokens: [STANDARD_COST] suitable_for: "Medium Complexity" - **tier: "premium"** model_id: [PREMIUM_MODEL_ID] cost_per_1k_tokens: [PREMIUM_COST] suitable_for: "High Complexity" ### BUDGET CONSTRAINT - **Hard Cost Cap:** The selected tier's cost must not exceed [MAX_COST_PER_1K_TOKENS]. - **Default Tier:** If no tier satisfies the constraints, default to the "lightweight" tier. ### USER REQUEST [USER_INPUT] ### INSTRUCTIONS 1. Assess the complexity of the user request using the rubric. 2. Select the cheapest model tier that is suitable for the assessed complexity and does not violate the hard cost cap. 3. Output your decision in the following JSON format. Do not include any other text. ### OUTPUT SCHEMA { "complexity_assessment": "Low" | "Medium" | "High", "complexity_rationale": "A brief, one-sentence justification for the complexity score.", "selected_tier": "lightweight" | "standard" | "premium", "selected_model_id": "The model_id from the chosen tier.", "cost_justification": "A brief explanation confirming the selection is the cheapest suitable option within the budget." }
To adapt this template, start by populating the MODEL TIER CATALOG with your actual model IDs and per-token costs. The COMPLEXITY RUBRIC should be tuned to match the observed performance boundaries of your specific models; you may need to adjust the definitions of 'Low,' 'Medium,' and 'High' based on your own evaluations. The OUTPUT_SCHEMA is designed for direct parsing by your application's routing logic. Ensure your router reads the selected_model_id field and dispatches the [USER_INPUT] to that model's API endpoint. The complexity_rationale and cost_justification fields are critical for logging and debugging routing decisions, allowing you to audit why a premium model was selected for a given request.
Prompt Variables
Every placeholder in the prompt template and how to configure it for reliable routing.
| Placeholder | Purpose | Example | Validation Notes |
|---|---|---|---|
[USER_REQUEST] | The raw input text to be classified for complexity and routed to a model tier. | Summarize the quarterly earnings call transcript and identify the top 3 risks. | Required. Non-empty string. Must pass a length check (> 10 chars) to avoid empty routing. |
[COMPLEXITY_RUBRIC] | A structured definition of what constitutes low, medium, and high complexity for the domain. | LOW: Simple fact retrieval. MEDIUM: Multi-step reasoning. HIGH: Requires synthesis of conflicting sources. | Required. Must be a valid JSON object with 'low', 'medium', 'high' keys. Schema check before prompt assembly. |
[MODEL_TIER_DEFINITIONS] | A catalog of available models, their tiers, and per-token pricing. | [{"tier": "light", "model": "gpt-3.5-turbo", "input_cost_per_1k": 0.0005, "output_cost_per_1k": 0.0015}] | Required. Must be a valid JSON array. Each object requires 'tier', 'model', 'input_cost_per_1k', 'output_cost_per_1k' fields. |
[COST_BUDGET_CAP] | The maximum allowable cost for the entire request, in USD. | 0.05 | Required. Must be a positive float. If null, treat as no budget cap and flag for review. |
[LATENCY_TARGET_MS] | The target maximum latency for the initial response, in milliseconds. | 2000 | Required. Must be a positive integer. If null, default to a system-wide value of 5000ms. |
[OUTPUT_SCHEMA] | The strict JSON schema the model must use to return its tier selection and justification. | {"type": "object", "properties": {"selected_tier": {"type": "string"}, "complexity_score": {"type": "string"}, "justification": {"type": "string"}}} | Required. Must be a valid JSON Schema object. The 'selected_tier' field must be constrained by an enum matching the tiers in [MODEL_TIER_DEFINITIONS]. |
[FALLBACK_CHAIN] | An ordered list of model tiers to try if the primary selection fails or times out. | ["light", "standard"] | Optional. Must be a valid JSON array of strings. If null or empty, no fallback is attempted and the system should escalate to a human review queue. |
Implementation Harness Notes
How to wire the Model Tier Selection Prompt into a production routing layer with validation, retry, logging, and fallback.
This prompt is designed to sit inside a model routing middleware layer—code that intercepts every user request, classifies its complexity, and dispatches it to the appropriate model tier. The prompt itself is stateless and should be treated as a pure function: it receives a request payload and a cost configuration, and it returns a tier selection with justification. The surrounding harness is responsible for enforcing the decision, not the prompt. This means the application layer must own the actual model dispatch, cost accounting, and any overrides based on user tier or system state.
Validation and retry logic are critical because a malformed tier selection can silently route a complex request to a lightweight model, producing a poor user experience. The harness should validate the output against a strict schema: tier must be one of the defined enum values (lightweight, standard, premium), confidence must be a float between 0.0 and 1.0, and justification must be a non-empty string. If validation fails, retry the prompt once with the validation error appended as a [CONSTRAINTS] update. If the retry also fails, log the failure and fall back to the standard tier as a safe default—never fall back to premium to avoid cost runaways, and never fall back to lightweight for unclassified requests. Logging should capture the input complexity signals, the selected tier, confidence score, justification, and any validation failures for later cost and quality analysis.
Model choice for the router itself matters. This prompt performs classification, not generation, so a fast, cheap model (e.g., GPT-4o-mini, Claude Haiku, or a fine-tuned small classifier) is usually sufficient. Avoid using your premium tier model to decide whether to use the premium tier—that defeats the cost-saving purpose. Tool use and RAG are not required for this prompt in its basic form, but if your complexity rubric references external knowledge (e.g., domain-specific complexity heuristics), inject that context via the [COMPLEXITY_RUBRIC] variable rather than relying on the model's training data. Human review is not needed per routing decision, but you should implement a periodic audit where a sample of routing decisions is reviewed for accuracy, especially for requests near complexity boundaries. Set up a dashboard tracking premium-tier utilization rate, lightweight-tier failure rate (requests that later required escalation), and average cost per request to detect routing drift.
Fallback and circuit breaker patterns protect against router failure. If the routing prompt consistently fails validation or times out, the harness should open a circuit and route all requests to the standard tier while alerting the on-call engineer. Do not let a broken router block user requests. Additionally, implement a cost cap enforcement layer outside the prompt: track cumulative spend per time window, and if the premium tier is being selected more frequently than budgeted, inject an updated [BUDGET_CONSTRAINT] into the prompt to tighten the cost threshold. The prompt should never be the sole guardrail on spend—the application layer must enforce hard limits.
Expected Output Contract
The exact fields, types, and validation rules your middleware should enforce on every response from the model tier selection prompt.
| Field or Element | Type or Format | Required | Validation Rule |
|---|---|---|---|
selected_tier | string enum: [LIGHTWEIGHT, STANDARD, PREMIUM] | Must match one of the allowed tier identifiers exactly. Reject on case mismatch or unknown value. | |
complexity_score | integer 1-5 | Must be an integer within the inclusive range 1 to 5. Reject if float, string, or out of range. | |
complexity_rationale | string | Must be non-empty and contain at least one reference to a complexity factor from the rubric. Reject if null or whitespace only. | |
estimated_input_tokens | integer | Must be a positive integer. Reject if zero, negative, or non-numeric. Warn if value exceeds [MAX_INPUT_TOKENS]. | |
estimated_output_tokens | integer | Must be a positive integer. Reject if zero, negative, or non-numeric. Warn if value exceeds [MAX_OUTPUT_TOKENS]. | |
estimated_cost | number | Must be a positive number with up to 6 decimal places. Reject if negative. Validate against [MODEL_PRICING_CONFIG] using estimated tokens. | |
budget_compliant | boolean | Must be true or false. If true, estimated_cost must be less than or equal to [COST_BUDGET]. Reject on mismatch. | |
fallback_triggered | boolean | Must be true or false. If true, selected_tier must differ from the tier that would have been chosen without budget constraints. Reject on mismatch. |
Common Failure Modes
What breaks first when using a model tier selection prompt in production and how to guard against it.
Complexity Underestimation Routes to Cheap Models
What to watch: The prompt misclassifies a nuanced, multi-step request as 'simple' and routes it to a lightweight model that hallucinates or produces incomplete output. This often happens when input length is used as a proxy for complexity. Guardrail: Include explicit complexity markers in the rubric (multi-hop reasoning, domain rarity, output precision requirements) and log all tier assignments with the justification for spot-checking.
Budget Exhaustion Causes Silent Failures
What to watch: A hard budget cap triggers early termination or fallback to a model incapable of the task, but the system returns a degraded result without signaling the budget constraint to the caller. Guardrail: Always include a budget_status field in the output schema. When the budget is exhausted or a downgrade occurs, set a degraded flag and surface the reason so the application can decide to queue, notify, or abort.
Prompt Drift After Model Pricing Updates
What to watch: Model pricing changes in your infrastructure, but the prompt still references stale per-token costs. The router makes decisions based on outdated economics, defeating the purpose of cost-aware routing. Guardrail: Inject the current model catalog with pricing as a variable at runtime. Never hardcode prices in the system prompt. Add a validation step that compares the injected catalog against a source of truth before deployment.
Overfitting to a Single Cost Metric
What to watch: The prompt optimizes exclusively for cost-per-token and ignores latency, throughput, or quality requirements. A request that needs sub-second response gets routed to a cheap but slow model. Guardrail: Make the routing decision multi-objective. Include latency targets, quality thresholds, and cost constraints as weighted inputs. If any hard constraint is violated, the router should escalate rather than silently break the SLA.
Adversarial Inputs Trigger Premium Routing
What to watch: A user crafts input designed to appear highly complex, forcing the router to select the most expensive model for every request. This is a cost-exhaustion attack. Guardrail: Implement a per-user or per-session spend counter. If premium model usage spikes anomalously, throttle or flag for review. The prompt should also include a complexity_confidence score; low-confidence high-complexity assessments should default to a standard tier with a review flag.
Missing Fallback When Premium Model Is Unavailable
What to watch: The router selects the premium tier, but that model is over capacity or returns a 503. Without a defined fallback, the request fails entirely. Guardrail: The prompt output must include an ordered fallback chain, not just a single selection. The application layer should iterate through the chain. The prompt should also define acceptable degradation: which capabilities can be sacrificed at each fallback tier.
Evaluation Rubric
How to test routing quality before shipping. Run these checks against a labeled dataset of requests with known correct tier assignments.
| Criterion | Pass Standard | Failure Signal | Test Method |
|---|---|---|---|
Tier Classification Accuracy |
| Accuracy below threshold on golden dataset | Run prompt against 200+ labeled examples; compute exact-match accuracy |
Over-Routing to Premium Tier | <5% of requests routed to premium when standard is correct | Premium routing rate exceeds threshold on non-premium examples | Filter test set to requests labeled standard; measure premium selection rate |
Under-Routing to Lightweight Tier | <3% of requests routed to lightweight when standard or premium is correct | Lightweight routing rate exceeds threshold on complex examples | Filter test set to requests labeled standard or premium; measure lightweight selection rate |
Budget Compliance | 100% of routing decisions stay within [COST_BUDGET] per request | Any routing decision exceeds per-request cost cap | Parse model tier selection; multiply by tier pricing; assert total <= [COST_BUDGET] |
Complexity Justification Quality |
| Generic justifications without input-specific evidence | LLM-as-judge eval: does justification reference concrete features of the input? |
Latency Target Adherence |
| Tier selected has p95 latency exceeding target | Cross-reference selected tier against latency profile table; flag violations |
Fallback Chain Correctness | Fallback triggered only when primary tier unavailable or over-budget | Fallback used when primary tier is available and within budget | Trace routing decisions; verify fallback activation conditions match [FALLBACK_RULES] |
Confidence Score Calibration | Binned confidence scores match actual accuracy within ±5% | High-confidence bins show accuracy below 90% | Group predictions by confidence decile; compare per-bin accuracy to expected calibration curve |
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Adapt This Prompt
How to adapt
Start with the base prompt and a small model catalog (2-3 tiers). Use hardcoded pricing in the prompt body rather than external config. Skip the complexity rubric and rely on the model's own judgment for complexity assessment. Accept free-text tier selection without strict output schema enforcement.
Prompt modification
Remove [MODEL_CATALOG_JSON] and inline a short table:
codeTier: lightweight | Model: gpt-3.5-turbo | Cost: $0.50/1M tokens Tier: standard | Model: gpt-4o | Cost: $5.00/1M tokens Tier: premium | Model: gpt-4-turbo | Cost: $30.00/1M tokens
Replace [BUDGET_CAP] with a fixed value like $0.02 per request. Drop [OUTPUT_SCHEMA] and ask for a plain text recommendation.
Watch for
- Model hallucinating pricing or tier names not in your catalog
- No cost enforcement—the prompt suggests but doesn't guarantee budget compliance
- Complexity assessment drifting toward "premium" for simple requests
- No logging, so you can't measure tier selection accuracy

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us