Lightweight LLM Selection for Office Workloads: Balancing Cost and Quality

    This article explains how to choose lightweight large language models for high-volume office applications by looking beyond sticker price. It covers billing structures, input and output token costs, caching, monthly cost estimation, benchmark design, quality metrics, effective cost per acceptable output, task-specific model requirements, cache-friendly prompt design, a practical selection workflow, and production considerations such as data compliance, version locking, and monitoring.

    Lightweight LLM Selection for Office Workloads: Balancing Cost and Quality

    1. Why Unit Price Alone Is Not Enough

    Office applications typically involve high call volumes and relatively manageable per-task complexity. Meeting-note generation, email drafting, table-field extraction, and policy-document Q&A may generate thousands to millions of requests per day. At this scale, small differences in per-call cost can become significant monthly expenses.

    However, model unit price is only one part of the cost. The actual cost of a task is determined by input volume, output volume, cache hits, concurrency limits, and retry counts. If a model has a lower unit price but requires longer prompts or more retries to produce usable results, its final cost may not be lower. Selection should therefore distinguish three levels: the listed unit price, the actual cost per task, and the effective cost per acceptable output.

    2. Breaking Down the Billing Structure

    2.1 Input, Output, and Caching

    Most LLM services bill by token and price input and output separately. Output tokens usually cost more than input tokens, so for tasks that generate long content, output often becomes the main cost driver.

    Some services support input caching. When the prefix of multiple requests is identical, the service can reuse the already-computed portion and bill it at a lower rate. Cache hits depend on prefix consistency. If the application design cannot guarantee a stable prefix, the caching benefit is difficult to realize.

    Some services also use differentiated pricing by time period. Cost estimates should separately model peak and off-peak usage rather than hiding fluctuations behind a single average price. Pricing, time-period rules, and package details change over time, so estimates should be based on the provider’s latest official pricing.

    2.2 Example Monthly Cost Estimate

    The following function shows how to combine request volume, token usage, cache hit rate, and unit prices into a monthly cost estimate. It can be used directly as an evaluation template.

    1. def estimate_monthly_cost(
    2. requests_per_day: int,
    3. avg_input_tokens: int,
    4. avg_output_tokens: int,
    5. cache_hit_ratio: float,
    6. price_input: float, # Uncached input price, CNY per million tokens
    7. price_input_cached: float, # Cached input price, CNY per million tokens
    8. price_output: float, # Output price, CNY per million tokens
    9. days: int = 30,
    10. ) -> float:
    11. """Estimate monthly inference cost based on unit prices."""
    12. total_requests = requests_per_day * days
    13. total_input = total_requests * avg_input_tokens
    14. cached_input = total_input * cache_hit_ratio
    15. uncached_input = total_input - cached_input
    16. total_output = total_requests * avg_output_tokens
    17. cost = (
    18. uncached_input * price_input
    19. + cached_input * price_input_cached
    20. + total_output * price_output
    21. ) / 1_000_000
    22. return cost

    The following hypothetical values demonstrate the calculation. These numbers are only for illustrating the method and are not real prices for any service.

    • Daily requests: 10,000, or 300,000 requests over 30 days
    • Average input: 2,000 tokens, for about 600 million total input tokens
    • Cache hit rate: 40%, or about 240 million cached tokens and 360 million uncached tokens
    • Average output: 300 tokens, for about 90 million total output tokens
    • Assumed prices: CNY 1.0 per million uncached input tokens, CNY 0.1 per million cached input tokens, and CNY 4.0 per million output tokens

    Based on these values, cached input costs about CNY 24, uncached input about CNY 360, and output about CNY 360, for a monthly total of about CNY 744. Output cost and uncached input cost are in the same order of magnitude. Optimizing prompt length and controlling output length are therefore as important as choosing a model with a lower unit price.

    3. Measuring Real Cost Through Task Quality

    3.1 Building an Evaluation Set

    The credibility of an evaluation depends on whether the samples come from real business scenarios. Sample from production logs and prepare at least 50 examples for each task category, covering the following cases:

    • Long and short text distribution: include both short sentences and long documents close to the context limit.
    • Format requirements: for example, JSON output, fixed-field tables, or specified paragraph structures.
    • Edge cases: missing information, input with typos, and multiple formulations of the same question.
    • Reference answers or scoring criteria: extraction tasks can provide expected field values, while generation tasks should have a scoring rubric.

    3.2 Evaluation Dimensions

    Model performance can generally be evaluated across six dimensions:

    1. Correctness: whether the output is consistent with facts or the reference answer.
    2. Format compliance rate: whether the output can be parsed directly by downstream programs.
    3. Instruction-following rate: whether constraints such as length, tone, and prohibited content are satisfied.
    4. Hallucination rate: whether the model fabricates information not present in the input.
    5. Response latency: time to first token and overall completion time.
    6. Stability: the degree to which results remain consistent across multiple calls with the same input.

    3.3 Effective Cost

    The cost of a single call does not directly reflect business cost. If a model has a low pass rate, manual correction or retry overhead increases quickly. An effective cost metric can therefore be introduced:

    Effective cost = cost per call ÷ pass rate

    For example, if a call costs CNY 0.01 and the pass rate is 80%, the effective cost per acceptable output is about CNY 0.0125. If the pass rate falls to 50%, the effective cost doubles. This metric puts unit price, quality, and retry rate on the same scale for comparison.

    3.4 Example Evaluation Script

    The following example code shows the basic structure of an evaluation workflow. call_model is a placeholder function that must be replaced with the actual invocation logic; check_format and check_answer should be implemented according to business rules.

    1. import time
    2. from statistics import mean
    3. def run_benchmark(models, samples, call_model, check_format, check_answer):
    4. report = {}
    5. for model in models:
    6. passed, latencies = 0, []
    7. for sample in samples:
    8. start = time.perf_counter()
    9. output = call_model(model, sample["prompt"])
    10. latencies.append(time.perf_counter() - start)
    11. if check_format(output) and check_answer(output, sample["expected"]):
    12. passed += 1
    13. report[model] = {
    14. "pass_rate": passed / len(samples),
    15. "avg_latency_s": round(mean(latencies), 3),
    16. }
    17. return report

    After evaluation, summarize pass rate, average latency, and cost per call in the same table, then calculate the effective cost for each model. Comparisons between models on the same task are meaningful only when the input samples and scoring criteria are exactly the same.

    4. Office Task Profiles and Model Requirements

    Different office tasks place different demands on model capabilities. Task classification should come before model selection.

    • Summarization: such as meeting notes and long-document summaries. These require strong long-context handling and information coverage. Output length is often large, which has a clear impact on cost.
    • Extraction: such as extracting fields from contracts or expense reports. These have the highest requirements for format stability and field accuracy, and are best combined with structured-output constraints and validation scripts.
    • Rewriting: such as polishing emails and standardizing tone. These are sensitive to language quality and also need controlled edits that avoid changing the original meaning.
    • Q&A: such as internal policy lookup. Results depend heavily on retrieval quality and context assembly; the model itself is only one part of the system.
    • Classification and routing: such as ticket assignment and intent recognition. Outputs are usually very short and latency-sensitive, making these tasks suitable for lightweight models handling high-volume calls.

    After classification, set an independent quality threshold for each task category, then choose the model that meets the threshold and has the lowest effective cost, rather than using the same model for all tasks.

    5. Cache-Friendly Prompt Design

    Cache hit rate depends heavily on how prompts are organized. A common practice is to place static content first and dynamic content later.

    1. [System instructions: fixed content, cacheable]
    2. [Business rules, output format, and examples: fixed content, cacheable]
    3. [User input or retrieval results: dynamic content, not cached]

    In practice, note the following:

    • Fixed system instructions and examples should remain word-for-word identical. Any extra space or line break may cause a prefix mismatch.
    • Avoid inserting timestamps, request IDs, or random fields at the beginning of prompts, because these make every request prefix different.
    • Version-control request templates for the same business, update them consistently when templates change, and record version numbers in logs.
    • Keep the number of examples to what is necessary. Too many examples increase input cost on every request.

    6. Selection Decision Workflow

    The following steps are recommended, with a checkable output at each stage.

    1. Define task categories and quality thresholds. For example, extraction tasks may require a pass rate no lower than a certain threshold.
    2. Run the full evaluation set on candidate models and record pass rate, latency, and cost per call.
    3. Calculate the effective cost of each model and filter for candidates that meet the quality threshold.
    4. Run a small-traffic canary validation and observe correction rates and complaint rates in real user scenarios.
    5. Design a fallback strategy: switch to a backup model when the primary model times out, is rate-limited, or returns an异常? Actually English: returns an abnormal response, and record the degradation ratio.

    A simple comparison table can be created for decision-making, with one row per task category and columns for pass rate, effective cost, and latency, making it easier for the team to align.

    7. Production Implementation Considerations

    7.1 Data Compliance

    Model inputs may contain personal information or confidential enterprise data. Before launch, complete the following work:

    • Mask fields such as ID numbers, phone numbers, and bank account numbers.
    • Confirm the provider’s data retention and usage policies and compare them with the enterprise’s compliance requirements.
    • Based on data sensitivity levels, decide whether to use public services, private deployment, or a hybrid approach.

    7.2 Version Locking

    Model version updates may change output format or style. Production environments should pin model version numbers and rerun the evaluation set before upgrades. Unverified silent upgrades are a common cause of production quality fluctuations.

    7.3 Monitoring and Alerting

    After launch, continuously record the following metrics:

    • Daily token usage and cost, with alerts for budget thresholds.
    • Response latency percentiles and timeout rate.
    • Format validation failure rate and manual correction rate.
    • Number and reasons for fallback switches.

    These metrics can be handled by a general monitoring and alerting system. When pass rate or cost metrics deviate from the baseline, the team can quickly determine whether the cause is a prompt change, a model version change, or a shift in business traffic composition.