LLM Selection Testing: Performance, Rate Limits, and Off-Peak Pricing
Leaderboard rankings are not enough for LLM selection. This article outlines an executable evaluation workflow that compares cost, latency, and correctness on your own tasks, with guidance on long-context stability, multimodal tests, off-peak pricing, rate-limit troubleshooting, and safety-test boundaries.
Model selection should not rely on leaderboards alone. Developers need to test candidates on their own tasks and compare cost, latency, and correctness in the same table. The following is an evaluation method that can be executed directly.
1. Define Tasks and Budget First
Before evaluating, write down three things clearly: the task type to be completed, the acceptable response latency, and the budget cap per month or per batch run. Task types can be divided into code generation, code review, document summarization, structured extraction, and image understanding. Prepare 30 to 50 real samples for each category, covering common cases and edge cases. Too few samples make conclusions vulnerable to individual cases.
The budget should be calculated in tokens, not in number of calls. A single call may use only a few hundred tokens, or it may reach hundreds of thousands of tokens because it carries the context of an entire code repository.
2. Record Results in the Same Table
All candidate models should run with the same set of inputs and the same parameters. For each run, record at least the following fields:
| Field | Meaning | How to record |
|---|---|---|
| Model and version | Full model ID provided by the provider | Use the model ID returned by the actual API call |
| Task type | Category from step 1 | E.g., code refactoring, document summarization |
| Input tokens | Includes system prompt and context | Record from API response |
| Output tokens | Model-generated portion | Record from API response |
| Latency | From request sent to complete response received | Seconds |
| Cost | Calculated from published unit prices and discounts | CNY |
| Correctness rate | Proportion passing tests or manual review | Passed samples / total samples |
Passed tasks per unit cost can be calculated as follows:
Passed tasks per unit cost = number of passed tasks / total cost
This metric reflects both quality and price. When two models have similar correctness rates, the model with the higher passed tasks per unit cost is more cost-effective.
Cost is calculated as follows:
Cost = input tokens / 1,000,000 × input unit price + output tokens / 1,000,000 × output unit price, then multiplied by the discount factor
Input unit price and output unit price are usually different, so record them separately. The discount factor should follow the provider’s current announcement, and the date should be noted in the record.
3. How to Test Long-Context Stability
Long-context testing should check two things: whether the model remembers instructions at the beginning, and whether it can accurately extract information from the middle. To do this, use a very long document as context, randomly insert task-irrelevant paragraphs in the middle, and then ask a question at the end. Record two results: whether the model still follows the format requirements from the beginning, and whether the extracted facts are correct.
Context length can start at 10,000 tokens and gradually increase to the model’s supported limit. Repeat multiple times at each length, because the same question may produce different results across runs. Running only once makes it difficult to distinguish occasional errors from stable defects.
For code repository analysis, ask the model to identify which files reference a given function, then verify manually. The proportion of correct references says more about its understanding of the code than the suggested prose the model provides.
4. How to Test Multimodal Capabilities
Do not use only clean screenshots or standard charts for multimodal testing. In real scenarios, images are often blurry, reflective, have complex backgrounds, and may contain very small targets. Prepare three types of samples:
- Clean flowcharts or architecture diagrams, to check whether the model can reconstruct nodes and edges.
- Photos of paper sketches or whiteboards taken with a phone, to check whether lighting and skew affect recognition.
- Images with small targets in industrial or retail scenarios, such as surface scratches or a single product on a shelf, to check small-target recall.
For flowchart-to-code tasks, ask the model to output a JSON state machine definition, then use a script to validate whether fields are complete and whether states are reachable. This approach is faster than reading the output manually and makes errors easier to find.
5. How to Use Off-Peak Token Pricing
Some providers offer lower token unit prices late at night. Whether to use this window depends on whether the task requires immediate response.
Tasks suitable for off-peak hours include:
- Log cleaning and offline data analysis
- Batch generation of documents or test cases
- Batch review of historical code
- Model evaluation that requires running a large number of samples
Unsuitable tasks include:
- User-facing online Q&A
- Interactive programming where a person waits for results
- Online incident troubleshooting with a clear deadline
You can split tasks into a real-time queue and an asynchronous queue. The real-time queue runs at standard prices to guarantee response speed. The asynchronous queue submits jobs during off-peak hours, writes results to storage, and lets business systems read them later.
When measuring, run the same batch of samples once during the day and once at night, then compare total cost and correctness rate. Comparing only the unit price difference ignores the extra overhead caused by retries and failed samples.
6. Troubleshooting Rate Limits and Stability
During concentrated batch runs, the API may queue requests or return rate-limit errors. Start troubleshooting with three metrics: request success rate, P95 latency, and retry count. If retry count increases significantly, concurrency usually exceeds the quota.
For production environments, consider the following:
- Set a concurrency cap on the client and use exponential backoff for retries.
- Set circuit breakers for critical requests. After consecutive failures, switch to a backup model or return a degraded response.
- For latency-sensitive workloads, deploy call entry points in two regions and record the historical availability of each region.
Circuit-breaker thresholds and retry counts should be determined through load testing; directly applying rule-of-thumb values is not recommended.
7. Boundaries of Safety Testing
Evaluations sometimes need to check a model’s refusal behavior, for example, whether it can refuse to generate malicious code. Such tests should only be conducted in authorized environments and must comply with the provider’s usage policies and the team’s security standards.
Record the refusal rate and whether the refusal rationale is reasonable. Do not save directly usable attack samples. Test results should be archived in a controlled location, with access limited to personnel responsible for security assessment.
8. Execution Checklist
- Write down the task type, latency requirement, and budget cap.
- Prepare 30 to 50 real samples for each task type, including edge cases.
- Fix inputs and parameters, and record model, tokens, latency, cost, and correctness rate in the same table.
- Compare candidate models using passed tasks per unit cost.
- Test long-context stability by gradually increasing context length and repeating runs.
- Test multimodal capabilities across clean, blurry, and small-target images.
- Run the same samples during the day and at night, and calculate actual total cost.
- Split tasks into real-time and asynchronous workloads, and move asynchronous parts to off-peak hours.
- Set rate-limit, retry, and circuit-breaker parameters based on load-test results.
Completing one evaluation round with this checklist gives you a selection basis grounded in your own workloads. Provider prices and quotas may change, so selection conclusions should be reviewed periodically.
