Inferensys

Prompt

Model Suitability Decision Prompt for AI Routing

A practical prompt playbook for using Model Suitability Decision Prompt for AI Routing in production AI workflows.
Developer doing prompt engineering on laptop, prompt variations visible on screen, casual coding session.
PROMPT PLAYBOOK

When to Use This Prompt

Define the job, the user, and the operational boundaries for the Model Suitability Decision Prompt.

This prompt is designed for AI platform and gateway teams who need to automate the selection of the most appropriate model for a given task from a constrained, internal catalog. The core job-to-be-done is to programmatically route an incoming request—along with its specific requirements for cost, latency, capability, and accuracy—to the best-fit model endpoint. The ideal user is a routing engine or an orchestration layer, not an end-user chatting with a model. This prompt acts as the decision function within a model gateway, consuming a structured task description and outputting a strict, machine-readable routing decision.

Use this prompt when you have a predefined set of available models, each with a known profile of strengths, weaknesses, costs, and latency characteristics. It is appropriate when the routing logic is too complex for simple if/else rules but must remain fully deterministic and auditable. The prompt requires a well-structured input that includes the task's functional requirements, a non-functional requirements block (cost budget, latency ceiling), and the full model catalog with capabilities. It is not a general-purpose recommendation engine. Do not use this prompt to compare models for a one-off research task or to generate a human-readable report; its output is a single, constrained decision object meant for machine consumption.

Before implementing, define the failure modes for your system. The prompt must include a fallback model selection strategy for when no model perfectly meets the criteria. The output schema should enforce a mandatory fallback_model field and a rationale that justifies the trade-off. You must pair this prompt with a validation layer that rejects any output containing a model ID not present in the provided catalog. In high-stakes environments where a routing error could cause a compliance issue or a significant cost overrun, log the full routing decision and rationale for audit, and consider a human-in-the-loop review step for requests that fall below a configurable confidence threshold.

PRACTICAL GUARDRAILS

Use Case Fit

Where the Model Suitability Decision Prompt works, where it breaks, and what you must provide before wiring it into an AI routing gateway.

01

Good Fit: Constrained Model Catalog

Use when: you have a fixed, curated set of 3–15 models with known cost, latency, and capability profiles. Guardrail: provide the full model catalog as a structured list inside the prompt. If models are added or removed dynamically, update the catalog via a template variable rather than hardcoding.

02

Bad Fit: Open-Ended Model Discovery

Avoid when: the task requires the model to recommend a model it was not explicitly given, or to compare models outside the provided catalog. Guardrail: add an explicit constraint that the output must only reference models from the provided list. Reject any response that invents a model name not present in the input catalog.

03

Required Inputs

What you must provide: a structured task description, a model catalog with capability tags, and explicit evaluation weights for cost, latency, and capability. Guardrail: if any of these inputs are missing, the prompt should return a structured error object rather than guessing. Validate input completeness before calling the model.

04

Operational Risk: Stale Model Data

What to watch: the model catalog embedded in the prompt becomes outdated as models deprecate, pricing changes, or new models launch. Guardrail: treat the model catalog as a runtime-injected variable sourced from a live registry. Add a last_updated timestamp to the catalog and reject decisions made with data older than your freshness threshold.

05

Operational Risk: Cost vs. Capability Drift

What to watch: the prompt consistently over-prioritizes capability and routes too many requests to expensive models, or under-prioritizes capability and routes complex tasks to cheap models that fail. Guardrail: log every routing decision with the input task, selected model, and eval scores. Run weekly audits comparing actual task success rates against the selected model tier. Adjust eval weights if drift is detected.

06

Fallback Model Selection

What to watch: the primary model is unavailable, over capacity, or returns an error. Guardrail: require the prompt to output both a primary model selection and a ranked fallback list. The gateway should automatically try the next fallback if the primary fails. Include a final catch-all fallback that prioritizes availability over capability.

PROMPT PLAYBOOK

Copy-Ready Prompt Template

A reusable prompt template with square-bracket placeholders for selecting the optimal model from a constrained catalog based on task requirements, cost, latency, and capability constraints.

This prompt template is designed to be dropped directly into an AI routing gateway or model selection layer. It forces the model to reason over a predefined catalog of available models, match task requirements against model capabilities, and output a structured decision with explicit justification. The template uses square-bracket placeholders that your application must populate at runtime: the task description, the available model catalog with capabilities and cost profiles, the evaluation criteria weights, and any hard constraints like maximum latency or budget caps.

text
You are a model routing decision engine. Your job is to select the most appropriate model from the [MODEL_CATALOG] for the given task, applying the evaluation criteria and constraints specified below.

## Available Models
[MODEL_CATALOG]
<!-- Format each model as:
- model_id: string
- provider: string
- capabilities: list of supported task types
- context_window: integer (tokens)
- cost_per_1k_input_tokens: float
- cost_per_1k_output_tokens: float
- typical_latency_ms: integer (p50)
- max_output_tokens: integer
- supports_tools: boolean
- supports_structured_output: boolean
- availability_tier: "ga" | "beta" | "deprecated"
- recommended_for: list of task categories
-->

## Task Description
[TASK_DESCRIPTION]
<!-- Describe the task in detail: input type, required output format, complexity, domain, and any special requirements like tool use, structured output, or multimodal inputs. -->

## Evaluation Criteria
[EVALUATION_CRITERIA]
<!-- Specify weighted criteria, for example:
- capability_match: weight 0.4
- cost_efficiency: weight 0.25
- latency_requirement: weight 0.2
- reliability_and_availability: weight 0.15
-->

## Constraints
[CONSTRAINTS]
<!-- Hard constraints that must be satisfied:
- max_latency_ms: integer or "none"
- max_cost_per_call: float or "none"
- required_capabilities: list of mandatory capabilities
- min_context_window: integer or "none"
- require_structured_output: boolean
- require_tool_support: boolean
- exclude_providers: list of providers to exclude
- availability_tier_minimum: "ga" | "beta"
-->

## Output Schema
Return a JSON object with this exact structure:
{
  "selected_model": {
    "model_id": "string",
    "provider": "string",
    "confidence": 0.0-1.0,
    "rationale": "string explaining why this model was selected over alternatives"
  },
  "fallback_model": {
    "model_id": "string",
    "provider": "string",
    "trigger_condition": "string describing when to fall back"
  },
  "alternatives_considered": [
    {
      "model_id": "string",
      "rejection_reason": "string explaining why this model was not selected"
    }
  ],
  "risk_flags": [
    "string describing any risks or concerns with the selection"
  ],
  "estimated_cost_per_call": float,
  "estimated_latency_ms": integer
}

## Decision Rules
1. Eliminate any model that violates a hard constraint before scoring.
2. Score remaining models against the weighted evaluation criteria.
3. If no model satisfies all constraints, return the closest match with risk_flags explaining the gap.
4. Always provide a fallback model from a different provider when available.
5. If multiple models score within 5% of each other, prefer the lower-cost option.
6. Never select a deprecated model unless no alternative exists.

## Examples
[EXAMPLES]
<!-- Provide 2-3 example inputs and expected outputs showing correct decision-making across different scenarios: cost-sensitive, latency-sensitive, capability-constrained. -->

Now evaluate the task and return your decision.

To adapt this template, start by defining your [MODEL_CATALOG] as a structured data object your application can serialize into the prompt. Keep the catalog current—stale model data produces routing decisions that waste money or break latency SLAs. The [EVALUATION_CRITERIA] weights should reflect your actual production priorities; if you say latency matters but weight cost higher, the model will optimize for cost and you'll get slow responses. Populate [EXAMPLES] with real decisions your team would make manually, including edge cases where no model is perfect. The output schema includes risk_flags and fallback_model fields because routing decisions fail in production—plan for degradation before it happens.

Before deploying this prompt into a routing gateway, validate that your application layer can parse the JSON output and act on the fallback_model field when the primary model returns errors or exceeds latency budgets. Log every routing decision with the full prompt context and model response for debugging. If your routing decisions affect regulated workflows, add a human review step for low-confidence selections where confidence falls below your threshold. Test the prompt against your catalog weekly as models deprecate and new ones launch—a routing prompt that recommends a retired model is worse than no routing at all.

IMPLEMENTATION TABLE

Prompt Variables

Required and optional inputs for the Model Suitability Decision Prompt. Each placeholder must be populated before the prompt is sent to the router model. Missing or malformed inputs are the most common cause of incorrect routing decisions.

PlaceholderPurposeExampleValidation Notes

[TASK_DESCRIPTION]

Natural language description of the task the user wants to perform

Summarize a 50-page legal contract and extract all obligation clauses

Must be non-empty string. Check for minimum 10 characters. Reject inputs that describe multiple unrelated tasks without clear primary intent.

[MODEL_CATALOG]

JSON array of available models with their capabilities, cost profiles, and latency characteristics

[{"model_id": "claude-3-opus", "strengths": ["legal", "long-context"], "cost_per_1k_tokens": 0.015, "avg_latency_ms": 1200}]

Must parse as valid JSON array. Each entry requires model_id, strengths array, and cost_per_1k_tokens. Reject if catalog is empty or missing required fields.

[CONSTRAINTS]

JSON object specifying hard limits on cost, latency, and required capabilities

{"max_cost_per_call": 0.50, "max_latency_ms": 3000, "required_capabilities": ["legal", "long-context"]}

Must parse as valid JSON object. All numeric fields must be positive. required_capabilities must be a non-empty array of strings matching capability labels in the model catalog.

[PRIORITY_WEIGHTS]

JSON object defining relative importance of cost, latency, and capability match when multiple models satisfy constraints

{"cost_weight": 0.3, "latency_weight": 0.2, "capability_weight": 0.5}

Must parse as valid JSON object. All weights must be floats between 0.0 and 1.0. Sum of weights should equal 1.0. Validate sum and warn if outside 0.95-1.05 range.

[FALLBACK_POLICY]

String enum specifying behavior when no model satisfies all constraints

select_closest_match

Must be one of: select_closest_match, escalate_to_human, return_no_suitable_model, use_default_fallback. Reject unknown values. If use_default_fallback is selected, [DEFAULT_FALLBACK_MODEL] becomes required.

[DEFAULT_FALLBACK_MODEL]

Model ID to use when fallback policy is use_default_fallback

gpt-4o-mini

Required only when [FALLBACK_POLICY] equals use_default_fallback. Must match a model_id present in [MODEL_CATALOG]. Validate presence in catalog before prompt execution.

[PREVIOUS_ROUTING_DECISIONS]

Optional array of recent routing decisions for the same task type to improve consistency

[{"task": "legal summarization", "model_selected": "claude-3-opus", "timestamp": "2025-01-15T14:30:00Z"}]

Null allowed. If provided, must parse as valid JSON array. Each entry requires task, model_selected, and timestamp fields. Timestamps must be ISO 8601. Entries older than 7 days should be flagged for staleness.

PROMPT PLAYBOOK

Implementation Harness Notes

How to wire the Model Suitability Decision Prompt into a production AI routing gateway with validation, fallbacks, and observability.

This prompt is designed to be the decision layer inside an AI gateway or model router. It should not be called directly by end users. Instead, wrap it in an application service that receives an incoming task specification, enriches it with current capability and cost data from your model catalog, and then calls the prompt to produce a structured routing decision. The output of this prompt is a JSON object containing a primary model selection, a fallback model, and a justification block. Your application must parse this JSON, validate it against the expected schema, and then use the primary_model_id to dispatch the actual inference request to the correct model endpoint.

Before calling the prompt, assemble the [MODEL_CATALOG] input by querying your live model registry. This catalog must include each model's model_id, capabilities (as a list of supported task types), cost_per_1k_tokens, avg_latency_ms, context_window, and availability_status. Do not hardcode this list; it must reflect current deployment state. The [TASK_REQUIREMENTS] input should be derived from the incoming user or system request and must specify task_type (from a controlled vocabulary matching your catalog's capability tags), priority (latency, cost, or quality), max_budget_tokens, and any required_capabilities. The [CONSTRAINTS] block should include your organization's routing policies, such as "prefer_private_deployment": true or "max_cost_per_1k_tokens": 0.02. After the prompt returns, validate the primary_model_id and fallback_model_id against your catalog to prevent hallucinated model identifiers. If validation fails, log the invalid output and retry once with a stricter prompt that includes the validation error message. If the retry also fails, escalate to a human operator and route to a safe default model.

Implement a lightweight evaluation loop around this prompt. For every routing decision, log the input task requirements, the selected model, the justification, and the actual outcome metrics (latency, cost, success/failure) after the task completes. Periodically run a golden set of routing scenarios through the prompt and compare the decisions against expected selections. Flag any drift where the prompt starts over-prioritizing cost at the expense of capability or vice versa. For high-stakes routing decisions—such as those involving regulated data or customer-facing interactions—require a human approval step before the routing decision is executed. The approval UI should display the task summary, the prompt's recommended model, the justification, and a one-click override to the fallback model. Finally, treat the prompt template itself as a versioned artifact in your CI/CD pipeline. Any change to the model catalog schema, the task type vocabulary, or the routing policy should trigger a re-evaluation of this prompt against your golden test set before deployment.

IMPLEMENTATION TABLE

Expected Output Contract

Defines the strict JSON schema for the model routing decision. Every field must be validated before the routing action is executed. Any deviation should trigger a retry or fallback to the default model.

Field or ElementType or FormatRequiredValidation Rule

decision.primary_model_id

string

Must match an entry in the [MODEL_CATALOG] enum. Reject if not found.

decision.fallback_model_id

string

Must match an entry in [MODEL_CATALOG]. Must differ from primary_model_id.

decision.rationale

string

Must be 1-3 sentences. Must reference specific constraints from [TASK_REQUIREMENTS].

decision.confidence_score

number

Must be a float between 0.0 and 1.0. If < 0.7, escalate for human review.

decision.cost_estimate_usd

number

If present, must be a positive float. Null allowed if cost is unknown.

decision.latency_estimate_ms

integer

If present, must be a positive integer. Null allowed if latency is unknown.

decision.unsuitable_models

array[string]

List of model IDs from [MODEL_CATALOG] that were rejected. Must not be empty.

decision.rejection_reasons

object

Keys must match entries in unsuitable_models. Values must be short strings explaining rejection.

PRACTICAL GUARDRAILS

Common Failure Modes

When a model suitability prompt fails in production, it rarely fails silently. It routes to the wrong model, ignores cost constraints, or hallucinates a model that doesn't exist. These are the most common failure patterns and how to guard against them before they reach users.

01

Model Hallucination

What to watch: The prompt selects a model name that isn't in the provided catalog, fabricating capabilities or version numbers. This happens when the model catalog is large, poorly described, or when the task description uses language that triggers associations with specific public models. Guardrail: Require the output to match an exact model_id from the input catalog. Validate the response against the allowed list before routing. Add a post-generation check that rejects any output containing a model identifier not present in the input.

02

Cost-Ignorant Selection

What to watch: The prompt defaults to the most capable model for every task, ignoring explicit cost constraints or latency budgets. This is common when capability descriptions dominate the prompt and cost metadata is buried or presented as secondary. Guardrail: Include cost and latency as explicit, weighted decision criteria in the prompt instructions. Structure the output to require a cost_justification field that explains why the selected model meets the budget. Run periodic cost audits on routing decisions.

03

Capability Overestimation

What to watch: The prompt selects a model based on a surface-level capability match without verifying that the specific task requirements are fully supported. For example, routing a multimodal task to a text-only model because the model description mentions 'vision' in a different context. Guardrail: Structure the model catalog with explicit capability tags and required feature flags. Include a pre-selection checklist in the prompt that forces the model to verify each required capability against the candidate model's feature list before finalizing the selection.

04

Fallback Cascade Failure

What to watch: When the primary model is unavailable, the fallback logic selects an inappropriate alternative or enters an infinite retry loop. This often happens when fallback rules are implicit or when the prompt treats all models as always available. Guardrail: Define explicit fallback tiers in the prompt with clear degradation expectations. Require the output to include a fallback_chain array showing the ordered alternatives. Implement a maximum retry depth in the application layer, not just the prompt.

05

Ambiguous Task-to-Model Mapping

What to watch: The prompt cannot distinguish between similar tasks that require different models, such as 'summarize a legal document' versus 'summarize a customer support ticket.' Both are summarization, but the domain, accuracy requirements, and cost profiles differ significantly. Guardrail: Include domain context and task complexity signals in the input schema. Add few-shot examples that demonstrate correct routing for boundary cases. Test with deliberately ambiguous task descriptions to verify the prompt asks for clarification rather than guessing.

06

Constraint Conflict Deadlock

What to watch: The prompt receives conflicting constraints—lowest cost AND highest accuracy AND fastest response—and either returns no model or picks one arbitrarily without surfacing the trade-off. Guardrail: Define a constraint priority order in the prompt (e.g., accuracy > cost > latency). Require the output to include a trade_off_explanation field when constraints conflict. If no model satisfies all constraints, instruct the prompt to return the best partial match with a flag indicating which constraint was relaxed.

IMPLEMENTATION TABLE

Evaluation Rubric

Use this rubric to test the Model Suitability Decision Prompt before integrating it into your AI routing gateway. Each criterion targets a specific failure mode that breaks downstream automation.

CriterionPass StandardFailure SignalTest Method

Model ID Validity

Selected model_id exactly matches an entry in [MODEL_CATALOG]

Output contains a hallucinated model name or an ID not present in the provided catalog

Parse output and assert selected model_id is in the input [MODEL_CATALOG] list

Constraint Adherence

Selection respects all hard constraints in [CONSTRAINTS] (e.g., max_latency_ms, required_capability)

Selected model violates a stated constraint (e.g., picks a high-latency model when max_latency_ms is specified)

Validate output against each constraint field in [CONSTRAINTS]; fail if any constraint is breached

Fallback Specification

When no model satisfies all constraints, output includes a valid fallback_model_id and a non-empty justification

Output returns a primary model that violates constraints or omits the fallback field entirely

Test with an impossible constraint set; assert fallback_model_id is populated and primary model is null or flagged

Justification Grounding

justification field references specific attributes from [MODEL_CATALOG] (e.g., latency, cost, capabilities)

Justification contains generic reasoning or hallucinated model features not present in the catalog

Check justification text for substring matches against the selected model's catalog entry fields

Output Schema Compliance

Response is valid JSON matching the [OUTPUT_SCHEMA] with all required fields present

Response is missing required fields, contains extra invalid fields, or is not parseable JSON

Validate response against the JSON Schema; reject on schema validation errors

Cost-Latency Trade-off Logic

When multiple models satisfy constraints, selection favors the model with lowest cost unless [CONSTRAINTS] specify otherwise

Selection picks a more expensive model when an equally capable cheaper model is available without justification

Provide a catalog with tiered pricing; assert the cheapest valid model is selected unless overridden by constraints

Confidence Threshold

confidence_score is a float between 0.0 and 1.0 and reflects constraint satisfaction margin

confidence_score is missing, out of range, or 1.0 when constraints are barely met

Assert 0.0 <= confidence_score <= 1.0; test with tight constraints and verify score < 1.0

Empty Catalog Handling

When [MODEL_CATALOG] is empty, output returns null for model_id and a clear abstention reason

Output hallucinates a model or returns a non-null model_id when no models are available

Provide an empty catalog array; assert model_id is null and abstention reason is populated

ADAPTATION OPTIONS

Adapt This Prompt

How to adapt

Use the base prompt with a smaller model catalog (3-5 models) and relaxed validation. Replace the structured JSON output with a simple markdown table for quick human review. Focus on getting the reasoning chain right before locking down the schema.

Watch for

  • The model ignoring the constrained catalog and recommending models not on your list
  • Overly verbose justifications that bury the final selection
  • Inconsistent cost/latency trade-off reasoning across similar tasks
Prasad Kumkar

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.