LLM Selection Guide: Pricing, Capabilities, and Agent Practices

    This guide reframes large language model selection as a constrained optimization problem rather than a leaderboard ranking. It breaks down four key dimensions—context window, input modalities, output budget, and billing logic—and explains how to translate vendor specifications into practical engineering constraints. It also covers Agent-specific requirements such as tool-call reliability, proactive context management, failure recovery, and cost observability, followed by a reusable evaluation and rollout workflow. The goal is to help teams choose models based on real workloads and per-task cost instead of headline numbers.

    1. The Real Problem: Constraint Solving, Not Ranking

    In engineering practice, the most common mistake when choosing a general-purpose LLM service is treating selection as a performance ranking and trying to find the single “strongest” model. A more useful perspective is to treat it as a constrained solving problem: given the task type, context size, output length, latency budget, and cost ceiling, find the option that satisfies the constraints at the lowest overall cost.

    The subjects of most discussions are often reduced to a few numbers: whether the context is million-token scale, what the single-response output limit is, and whether image or video input is supported. This information matters, but it is only part of the constraints. What really determines engineering success is how these constraints trade off against one another, and how much tolerance the business has for different failure modes.

    One easily confused point needs clarification first: the “K” and “M” notations used by vendors are not consistent across documentation. Some use decimal approximations, while others use binary conversion, so numbers from different sources should not be treated as exactly equal. The safer engineering approach is to run a small-scale load test with real samples from your own workload, and use the measured usable context and stable output length as the design baseline, rather than treating the peak values on marketing pages as usable capacity.

    2. Four Key Dimensions: Translating Specs into Engineering Language

    2.1 Context Window: Nominal Capacity vs. Effective Capacity

    A million-token context does not mean you can stuff in unlimited material at once. Effective capacity is usually eroded in three ways. First, the maximum input limit is often smaller than the nominal total window, compressing the space left for output and system prompts. Second, recall stability for mid-context information tends to degrade under long contexts—the widely observed “lost in the middle” effect. Third, the first-token latency and cost growth from long sequences are nonlinear.

    Context design should therefore follow a “layered supply” principle: place stable content (system instructions, tool definitions, output specifications) at the front; place retrieval fragments strongly related to the current question in the middle-to-late section; and pre-summarize extremely long material into structured form before injecting it. An illustrative assembly logic is shown below:

    1. def build_prompt(system_spec, tools, retrieved, question):
    2. # Stable layer first, dynamic layer after; control total length
    3. head = system_spec + render_tools(tools)
    4. body = "\n".join(f"[{i}] {chunk}" for i, chunk in enumerate(retrieved))
    5. prompt = f"{head}\n\nReferences:\n{body}\n\nQuestion: {question}"
    6. assert token_len(prompt) < EFFECTIVE_WINDOW * 0.8 # Reserve output and redundancy
    7. return prompt

    2.2 Input Modalities: Multimodal Support Is Not Enough

    Supporting text, image, and even video input only means the interface can accept them; it does not mean business results meet expectations. Three points need engineering attention: how image resolution and tiling strategy affect recognition accuracy; the fact that video input is usually frame-sampled, where sampling density directly determines temporal understanding quality; and the fact that mixed-modality input significantly raises per-request cost. If the workload is primarily text, choosing multimodal capability only adds unnecessary cost and complexity.

    2.3 Output Budget: Whether an Agent Can “Finish in One Pass”

    The single-response output limit is the most underestimated constraint in Agent scenarios. If the output budget is too small, long-workflow tasks are forced into multiple rounds, and more rounds mean repeated context transmission, error accumulation, and higher total latency. If the output budget is too large, verbose output and runaway costs become likely. The practical recommendation is to set separate limits for “thinking output” and “non-thinking output,” and to enforce hard truncation and continuation strategies at the business layer to prevent a single request from expanding indefinitely.

    2.4 Billing Logic: From Unit-Price Comparison to Per-Task Cost

    A lower unit price does not mean a lower total cost. Real cost should be calculated on a per-task basis:

    1. Per-task cost ≈ (input tokens × input price + output tokens × output price) × average retry rounds

    The average retry rounds are often overlooked. A model with a slightly higher unit price but a higher first-attempt success rate is often better in total cost. It is advisable to build a cost dashboard that tracks input/output distribution and retry rates by business line, and adjust based on data.

    3. Practical Points for Agent Scenarios

    The core characteristics of an Agent are “multi-turn, multi-tool, long trajectory,” which place different demands on model capability than single-turn Q&A.

    First, tool-call stability takes priority over prose quality. During selection, focus on validating the legality rate of structured output (such as JSON), the accuracy of parameter extraction, and the ability to keep tool definitions from drifting in long contexts.

    Second, context management must be proactive. A “rolling summary + externalized key state” approach can be used: write task state to external storage (such as object storage or a database), inject only the necessary fragments each round, and avoid unbounded context growth.

    Third, failures must be recoverable. Set timeouts and idempotency keys for each tool call, and combine logging services with monitoring and alerting to form a traceable call chain; introduce secondary confirmation for high-risk write operations.

    Fourth, cost and latency must be observable. Bring token consumption, rounds, and tool error rates into unified monitoring, and set budget thresholds for automatic degradation (for example, switching to a lighter general-purpose model or falling back to rules).

    4. A Reusable Selection Workflow

    1. Define the task profile: single-turn Q&A, long-form generation, multimodal understanding, or multi-step Agent.
    2. List hard constraints: input modalities, context lower bound, output upper limit, and latency and cost red lines.
    3. Build an evaluation set: use 50–200 real business samples covering typical and boundary cases.
    4. Run dual-track evaluation: record both effectiveness metrics (accuracy, legality rate) and engineering metrics (latency, per-task cost).
    5. Canary and rollback: roll out to a small traffic share, keep an abstraction layer that allows fast switching, and avoid strong coupling to a single vendor.

    Architecturally, it is recommended to encapsulate calls through a unified model gateway that hides differences between services and keeps switching costs manageable; this layer can also handle rate limiting, caching, auditing, and degradation. If you use the relevant general-purpose capabilities from Baidu AI Cloud, you can combine a container platform to host the gateway, object storage to store corpora, and logging and monitoring services for full-chain observability, turning selection from a one-time decision into a continuous optimization process.

    In summary, there is no once-and-for-all answer to model selection. Translating spec numbers into engineering constraints, and letting real samples and per-task cost speak, is what makes technical selection truly serve business goals.