LLM Selection: Evaluation Criteria, Vendor Risks, and Multi-Model Routing
A practical framework for selecting large language models based on business requirements, repeatable evaluations, and vendor risk. Learn how to test core capabilities, compare cost and performance consistently, and configure multi-model routing with fallback, privacy controls, and audit logging.
1. Define Business Goals Before Comparing Models
Before selecting a large language model (LLM), teams should answer three questions: What tasks must it handle? What request volume should it support? Which data must remain within the enterprise boundary? Without clear objectives, leaderboard scores offer little guidance for a business decision.
Break workloads into categories such as document summarization, code completion, complex reasoning, image-and-text understanding, and batch data cleaning. Each category places different weights on latency, accuracy, cost, and data compliance. A model that excels at complex reasoning may not be appropriate for high-volume, low-value data cleaning.
2. Build a Core Capability Evaluation Matrix
Subjective impressions can be distorted by individual examples. Establish a fixed evaluation dataset and define a test method and acceptance criteria for each dimension. The following matrix provides a starting point; adjust the weights to match business priorities.
| Use case | Evaluation metrics | Test method | Example acceptance criteria | Weight |
|---|---|---|---|---|
| Long-document summarization | Key information coverage, factual consistency | Select 50 documents of varying lengths and manually annotate key points | At least 85% coverage, with no clearly fabricated facts | 20% |
| Instruction following | Format compliance rate, constraint violation rate | Create prompts with formatting, word-count, and prohibited-term constraints | At least 95% format compliance | 20% |
| Code generation | Unit test pass rate, edge-case coverage | Run test suites against generated code in a private codebase | Pass rate meets the team’s defined threshold | 25% |
| Image-and-text understanding | Accuracy of data extraction from charts and tables | Use business samples containing tables and charts | At least 90% accuracy for key numerical values | 15% |
| Complex reasoning | Accuracy on multistep problems | Use an internally annotated reasoning dataset | Agreement with human reference answers meets the defined threshold | 20% |
These thresholds are examples, not universal requirements. Business and engineering stakeholders should agree on the actual acceptance criteria. Keep random seeds or temperature settings fixed and record model versions to support reproducible comparisons.
3. Evaluate Code Generation with Tests
Code generation should not be judged solely by whether a single output runs. A more useful approach is to ask the model to implement a function and validate it with tests written in advance.
The following example illustrates the cases a test suite should cover. It is illustrative code, not a production-ready implementation.
# Illustrative code showing how to design test casesimport pytest# candidate is the model-generated function, injected through a fixturedef test_empty_list(candidate):assert candidate([]) == []def test_duplicates(candidate):assert candidate([3, 1, 3]) == [1, 3, 3]def test_non_list_input(candidate):with pytest.raises(ValueError):candidate("abc")def test_mixed_types(candidate):# Requirements must define how to handle nonnumeric elements.# This example assumes they should be filtered out.assert candidate([2, "x", 1]) == [1, 2]
Tests should cover empty inputs, duplicate elements, invalid input types, and business-specific edge cases. Teams can also convert historical production defects into regression tests, gradually building a private evaluation suite.
Public benchmarks can provide useful reference points, but private tests are more representative of actual business workloads.
4. Assess Vendor Risks
A vendor’s terms of service and operating policies matter as much as model capability. Evaluate the following risks individually. Their severity depends on how the enterprise uses the service and on the applicable contract.
Quotas and Rate Limits
Some services impose limits on request frequency and token usage. Exhausting a quota can interrupt batch jobs and high-frequency automated workflows.
Confirm how quotas are calculated, what happens when a limit is exceeded, and whether higher limits can be requested.
Changes to Terms of Service or Account Status
Providers may change risk-control policies or supported regions. Account restrictions, revised terms, or tighter access policies can disrupt operations.
Assess service continuity and review contractual notice periods and exit provisions.
Data Use and Privacy
Contracts and technical settings should clearly establish how long the vendor retains input data and whether that data may be used for model training.
For source code, customer information, and trade secrets, review the data processing agreement first. Check whether the service offers options to exclude data from training or shorten retention periods.
Industry Compliance
Regulated sectors such as finance, healthcare, and government may have specific requirements for data residency, model auditing, and supply-chain traceability.
For these workloads, compliance review should be a prerequisite to selection—not a task deferred until after deployment.
5. Design a Multi-Model Routing Layer
To reduce dependence on a single vendor, place a routing layer between the application and model APIs. The router selects a model based on task type, cost limits, and service health, then falls back to another model when failures occur.
The following configuration is illustrative. Adapt field semantics to the platform being used.
{"routing_rules": [{"task_type": "complex_reasoning","preferred_model": "model_high_reasoning_api","fallback_model": "model_general_api","timeout_ms": 30000,"max_retries": 2,"retry_backoff_ms": [500, 1500],"cost_limit_per_request_usd": 0.5,"fallback_on_error": ["timeout", "rate_limited", "server_error"],"privacy_filter": {"enabled": true,"redact_fields": ["id_card", "phone", "api_key"]},"audit_log": {"enabled": true,"store_prompt_hash": true,"retention_days": 90}},{"task_type": "code_generation","preferred_model": "model_code_specialized_api","fallback_model": "model_general_api","timeout_ms": 20000,"max_retries": 1,"retry_backoff_ms": [500],"cost_limit_per_request_usd": 0.3,"fallback_on_error": ["timeout", "rate_limited"],"privacy_filter": {"enabled": true,"redact_fields": ["db_password", "internal_host"]},"audit_log": {"enabled": true,"store_prompt_hash": true,"retention_days": 30}}]}
Several settings deserve particular attention:
timeout_msandmax_retries: Set the waiting limit for each call and the number of retries, preventing requests from hanging indefinitely.cost_limit_per_request_usd: Sets a ceiling against which the router checks estimated cost before making a call. Requests exceeding the limit can be rejected or routed to a lower-cost model.privacy_filter: Redacts sensitive fields before a request is sent.audit_log: In this design, stores a prompt hash rather than the original prompt, supporting call traceability while reducing retention of sensitive content.
Fallback triggers must be explicit. The error types listed in fallback_on_error cause the router to switch to the fallback model.
Because fallback output may be lower quality, the application should flag results produced through fallback and require human confirmation in critical workflows.
6. Measure Cost, Latency, and Throughput Consistently
Model comparisons require consistent measurement methods. Otherwise, the numbers are not directly comparable.
- Cost: Calculate input and output costs separately using their respective prices per 1,000 tokens. Record average token usage per task rather than comparing unit prices alone.
- Latency: Measure both time to first byte and time to complete the response. Report P50 and P95, not just the mean.
- Throughput: Measure successful requests per second at a fixed concurrency level, and record the error rate.
Load tests should reflect production request distributions, including the mix of short and long inputs and peak concurrency.
Run tests during both business and off-hours, since vendor load fluctuations can affect latency. Retain the raw results for later review.
7. Implementation Checklist
- Define the objectives, request volume, and data sensitivity of each task category.
- Build a fixed evaluation dataset that includes private samples, and record model versions and test settings.
- Measure cost, latency, and throughput consistently, including latency percentiles.
- Review vendor data-use terms, quota policies, and contractual exit provisions.
- Deploy a routing layer with timeouts, retries, cost limits, redaction, and audit logging.
- Flag fallback results and retain human confirmation for critical workflows.
- Rerun the evaluation suite quarterly to check for changes in model performance and vendor policies.
8. Conclusion
LLM capabilities evolve quickly, and today’s best choice may soon be replaced. Teams should prioritize a stable evaluation process that brings business metrics, compliance requirements, and vendor risks into a single decision framework.
A routing layer then decouples the application from individual models, reducing the business impact of vendor policy changes or service disruptions. This approach requires upfront investment, but it gives engineering teams more control as models and services evolve.
