A Practical Guide to LLM Selection and Implementation for AI Engineering Teams

    Choosing a large language model is not about finding the single strongest one, but about matching hard constraints to business needs. This article presents a six-dimension evaluation framework covering long-document and multimodal understanding, structured instruction following, retrieval-augmented generation decision logic, executable code assessment, context management, and API openness and ecosystem. It includes reusable test methods, a sample nested prompt, a real engineering case built under a limited budget, and a practical selection checklist. The key takeaway: keep an abstraction layer so models stay replaceable, and rely on testing and observability for correctness.

    1. Why “Which Model Has the Most Potential” Is the Wrong Question

    When selecting a model, many teams default to asking “which model is the strongest.” From an engineering implementation perspective, that question is not actionable. Model capability is a multi-dimensional vector, not a single scalar: long-document understanding, structured instruction following, knowing when to trigger retrieval augmentation, code generation accuracy, context stability, how open the API is, and ecosystem and community activity. These dimensions carry completely different weights depending on the business scenario.

    A more useful question is: in my business, which capabilities are hard constraints and which are nice-to-haves? For a team building contract review, long-document parsing and key-point extraction are hard constraints. For a team building a low-code platform, code capability and structured output are hard constraints. For a team building a personal knowledge base, API availability and context management are hard constraints. Define the constraints first, then compare quality; otherwise selection gets stuck in a parameter-comparison swamp.

    2. A Six-Dimension Evaluation Framework

    2.1 Long-Document and Multimodal Material Understanding

    Real business inputs are rarely clean plain text. They are complex-layout PDFs, scanned files, and materials mixing tables with prose. Three things matter during evaluation. First, layout reconstruction: can the model correctly recognize multi-column pages, headers and footers, and table structures? Second, recall and precision of key-point extraction: does it miss critical clauses in information-dense documents? Third, output organization: can it restructure information into a “conclusion, evidence, items to confirm” format instead of simply copying excerpts?

    A reusable test method is to prepare three documents: one well structured, one with messy layout, and one containing many tables. Run the same prompt across all three and compare output quality. The larger the gap, the weaker the model’s robustness against real-world dirty data.

    2.2 Structured Instruction Following

    A structured prompt usually contains blocks such as a role definition, task constraints, output format, and few-shot examples. Early domestic models tended to “drop constraints” under multi-layer nested instructions, responding only to the last one. To evaluate this, design a three-layer nested prompt and observe whether the model respects format, length, and content constraints at the same time.

    An illustrative prompt structure:

    1. [Role] You are a backend architecture review expert
    2. [Task] Review the proposal below and point out risks
    3. [Constraints] Output JSON only; field is a risks array; each item contains level and reason; no more than 5 items
    4. [Example] {"risks":[{"level":"high","reason":"..."}]}
    5. [Input] {{proposal text}}

    Whether the model can reliably emit parseable JSON is the dividing line for whether it can enter an automated pipeline.

    2.3 Retrieval-Augmented Generation Call Decisions

    Strong retrieval augmentation does not mean retrieving every single time. A mature implementation performs an intent check first: time-sensitive and factual questions go to retrieval, while pure reasoning, text rewriting, and code generation go straight to the model. This decision logic usually lives in the application layer, implemented with rules plus a lightweight classification model rather than relying entirely on the LLM’s own judgment.

    In engineering terms, make the retrieval path observable: log whether each request triggered retrieval, which sources were hit, and how cited fragments map to the final answer. That makes it easier to tune recall strategy and prompts later.

    2.4 Realistic Assessment of Code Capability

    Code capability cannot be judged only by “can it produce code that looks right.” A more reliable assessment introduces executable verification: given a requirement, have the model produce code, then run unit tests and static checks, and track the first-pass rate and number of repair rounds. For complex requirements, models often produce code that is “structurally correct but logically wrong,” which means the application layer must have testing as a safety net rather than entrusting correctness entirely to the model.

    2.5 Context Management and Session State

    Models “forgetting earlier context” in long conversations is common, and the causes may include context window truncation, summarization compression strategy, and session segmentation strategy. Context should be managed explicitly in engineering: apply rolling summaries to history, inject key constraints at the top, and retrieve long materials in segments instead of stuffing everything in. Whether an explicit context switch is provided does not matter much; what matters is that the application layer holds control of the state.

    2.6 API Openness and Ecosystem

    How open the API is directly determines whether you can build a localized knowledge base or an automated pipeline. Look at whether there is a stable server-side API, whether concurrency and rate-limiting policies are clear, whether historical session retrieval is available, and whether the community has reusable examples and accumulated answers to common problems. With a less thriving ecosystem, the cost of hitting pitfalls rises significantly for the team.

    3. A Real Engineering Case: A Self-Service Space Mini Program on a Limited Budget

    One team wanted a WeChat mini program for self-service board game rooms, billiards halls, and KTV venues for internal use. An initial quote from a third-party outsourcing vendor was about 110,000 RMB, which exceeded the budget, so they decided to build it in-house.

    For tooling, they started with an AI coding tool and later switched to a terminal-based AI assistant. Both call general-purpose LLM capabilities from different vendors, and both are paid subscription models; several conversational assistants and command-line agents were used in supporting roles. The key lesson here: do not bind productivity to a single tool. Tools are replaceable; model capability is the underlying variable.

    The backend uses Node with Express and MongoDB, deployed on a cloud server to provide API services for the whole SaaS system. Capabilities such as store setup, booking, billing, and device control map to general cloud product categories: object storage for images and credentials, a message queue for booking and session-start events, a container platform to host backend services, and logging plus monitoring and alerting for observability.

    This case shows that model selection must serve the engineering goal: when the budget is limited, prioritize API stability, controllable context, and verifiable code instead of chasing single-point capability rankings.

    4. An Actionable Selection Checklist

    1. Test long-context handling with real business documents and record key-point recall.
    2. Test structured output stability with a three-layer nested prompt and require parseable results.
    3. Check whether retrieval augmentation includes intent judgment rather than indiscriminate retrieval.
    4. Measure code first-pass rate with unit tests.
    5. Verify context retention and summarization strategy in long sessions.
    6. Confirm the server-side API, rate limiting, historical retrieval, and community resources.
    7. Keep a replaceable abstraction layer in the application layer to avoid vendor lock-in.

    5. Conclusion

    Domestic LLMs have made clear progress in long-document understanding, structured instruction following, and retrieval augmentation, while code capability and ecosystem maturity are still catching up. For developers, the safest strategy is to build your own evaluation baseline and abstraction layer, treat the model as a replaceable capability component, and leave correctness to testing and observability. Baidu AI Cloud offers a general capability matrix in model services and engineering support, which can serve as one reference option when a team builds such an abstraction layer.