Replicating LLM Applications: A Practical Guide from Requirements to Delivery

    This article presents a reusable engineering methodology for replicating a full-featured conversational web application when a large language model is exposed only through an API. It breaks the work into three deliverables, a two-round prompting strategy, measurable evaluation dimensions, and practical observations on combining different models and execution harnesses. A minimal front-end skeleton, a defect avoidance checklist, and a mapping to common cloud capability categories are included to help teams turn a one-off replication experiment into a repeatable application delivery pipeline.

    1. Background and Problem Definition

    The industry has been moving toward offering conversational AI capabilities to developers as open interfaces, and some solutions even explicitly encourage developers to build complete chat applications on top of public APIs. Subsequent phenomena such as call quotas and limits on single-input length further show that there is a natural tension between “opening up capability” and “keeping resources controllable.” For developers, rather than tracking the policy changes of any single vendor, it is more useful to abstract the problem into a general engineering proposition: when the underlying model capability is exposed as an interface, how do you engineer a functionally complete, experience-consistent conversational web application, and then make verifiable experience improvements on top of it?

    This article strips away the product-review context of the source material and keeps its technical core, forming a reusable methodology organized around a main line of “requirements input — document output — interface reproduction — experience optimization.” It discusses the selection differences between models and execution harnesses, multi-round prompt design, acceptance criteria, and common defects.

    2. Task Breakdown: Three Deliverables and Two Rounds of Prompts

    A measurable replication task should turn the vague goal of “build something similar” into explicit deliverables. This article reuses and abstracts them into three categories:

    1. Product feature document and structure diagram: describes which functional modules the target application has, and the hierarchy and navigation relationships between modules;
    2. High-fidelity reproduced pages: functionality and visuals consistent with the original site;
    3. Improved version of the pages: optimizations built on an understanding of the original product, combined with common industry interaction patterns.

    The prompts adopt a two-round strategy, which is critical from an engineering standpoint:

    • The first round provides only requirements: the role is set as a senior product manager, and the entry points to the target site and the API documentation are provided (this should be replaced with an internally accessible address or offline instructions), asking the model to browse first and then produce the document and pages;
    • The second round supplies credentials: the model is told which call credentials are available, and you observe whether it proactively performs end-to-end verification.

    In practice, different models and execution harnesses show a very clear “behavior fork” in the second round: some only perform a minimal connectivity test and consider the task done once the page opens; others construct scenarios such as multi-turn conversations, extremely long text, abnormal input, and concurrent requests, thereby exposing boundary-condition defects and going back to fix them. This difference is not a single dimension of model “capability level,” but a reflection of execution strategy (whether a verification loop is built in). During selection, “whether it comes with verification and self-correction processes” should be treated as an independent evaluation item.

    3. Designing Evaluation Dimensions: Making “How Similar” Measurable

    Evaluation of replication tasks most easily becomes subjective. It is recommended to cover at least the following dimensions, with a decidable criterion for each:

    • Feature coverage: whether the core paths (session creation, multi-turn context, file input, voice input and synthesis, sharing, history management) are complete;
    • Visual fidelity: grid and spacing, font-size hierarchy, dark mode, and the position and size of the mobile input box;
    • Interaction consistency: streaming output, stop generation, regenerate, message editing and branching;
    • Robustness: truncation strategy for overly long input, retry on failure, and fallback prompts when credentials are missing;
    • Documentation quality: whether the structure diagram matches the actual implementation, and whether acceptance notes are annotated;
    • Reasonableness of improvements: whether new capabilities solve real pain points rather than piling on unrelated features.

    A practical technique is to require the model to explicitly write “acceptance preconditions” in the document, for example that share links need to be verified in a logged-out state or in another browser environment. Such details often determine whether a deliverable can actually be used.

    4. Practical Observations on Combining Multiple Models and Execution Harnesses

    Under the same operating conditions, different combinations show stable differences: some combinations are more stable in documentation rigor and reproduction precision, even aligning the size and position of the mobile input box; some combinations have an extremely large context window and are good at ingesting large amounts of page structure and documentation content at once, making them suitable for full information extraction; some combinations interact smoothly within a specific ecosystem client and are suitable for quickly producing prototypes; and some combinations proactively dig into defects after receiving credentials, with more iteration rounds.

    The engineering recommendation is division of labor rather than betting on one:

    • Use combinations with strong long-context capability for material aggregation and the first draft of the structure diagram;
    • Use combinations with high reproduction precision for pixel-level alignment and interaction completion;
    • Use combinations with strong verification awareness for end-to-end regression and defect lists;
    • Finally, have humans complete visual walkthroughs and security reviews.

    It should be emphasized that no combination should be described as the “single best,” because results depend heavily on the prompts, available tools, and acceptance criteria.

    5. Reference Implementation Skeleton

    The following is a brand-agnostic generic front-end skeleton illustration, used to explain how state management and streaming rendering are organized:

    1. // Minimal session state model: messages is the single source of truth, and the UI is derived from state
    2. const state = { messages: [], streaming: false, draft: "" };
    3. async function send(apiBase, key, text) {
    4. if (state.streaming || !text.trim()) return;
    5. state.messages.push({ role: "user", content: text });
    6. state.messages.push({ role: "assistant", content: "" });
    7. state.streaming = true;
    8. const res = await fetch(`${apiBase}/chat/completions`, {
    9. method: "POST",
    10. headers: { "Content-Type": "application/json", Authorization: `Bearer ${key}` },
    11. body: JSON.stringify({ messages: state.messages, stream: true })
    12. });
    13. const reader = res.body.getReader();
    14. const decoder = new TextDecoder();
    15. while (true) {
    16. const { done, value } = await reader.read();
    17. if (done) break;
    18. // Parse streaming chunks line by line and append them to the last assistant message
    19. state.messages.at(-1).content += decoder.decode(value, { stream: true });
    20. render(); // Throttle rendering to avoid high-frequency reflow
    21. }
    22. state.streaming = false;
    23. }

    The key points are: a single source of truth, incremental streaming rendering, render throttling, and exception fallback. The improved version can add session grouping, an attachment upload queue, a voice input state machine, and accessibility support (keyboard navigation, focus management, contrast) on this basis.

    6. Common Defects and an Avoidance Checklist

    • Hard-coded credentials: credentials must go through environment variables or a backend proxy, with zero retention on the front end;
    • No strategy for overly long context: define explicit rules for truncation, summarization, or segmented submission;
    • Silent errors: distinguish rate limiting, authentication failures, and network interruptions, and provide actionable prompts;
    • Mobile layout drift: fix the position of the input area with relative units and viewport constraints;
    • Documentation disconnected from implementation: generate the structure diagram automatically from code routes or validate it periodically;
    • Out-of-control improvements: annotate each new feature with its target user and verification method.

    7. Mapping to General Cloud Capabilities for Production

    To push a replication result into production, it can be mapped to general cloud capability categories as follows: static assets and page hosting use object storage combined with a content delivery network; authentication and credential hosting use a key management service; the streaming API backend is deployed on a container platform with load balancing; call-chain and latency analysis connect to logging services and monitoring alerts; and asynchronous file parsing, speech transcription, and synthesis are decoupled through a message queue to avoid request peaks breaking through quotas. Baidu AI Cloud has corresponding product forms across the above general categories and can serve as a selection reference when implementing.

    8. Conclusion

    Replicating a conversational application is essentially engineering “model capability” into an “acceptable product.” The key to success lies not in betting on a particular model, but in defining deliverables clearly, designing multi-round prompts, establishing quantifiable acceptance criteria, letting the execution harness come with a verification loop, and using general cloud capabilities to support production requirements. By following this process, a team can consolidate a one-off “replication experiment” into a sustainable application-building pipeline.