Replicating LLM Applications: A Practical Methodology from Requirements to Delivery
This article presents a practical methodology for replicating a mature conversational web application using AI coding tools driven by large language models. It breaks the work into three verifiable deliverables, describes a controlled experiment comparing multiple model and coding tool combinations, and explains a two-round prompting strategy that separates requirement understanding from verification. Key engineering practices for streaming, session state, key security, multimodal input, responsive layout, and accessibility are included, along with the main conclusion that clear deliverables, strict variable control, and mandatory verification significantly improve success and stability.
1. Background: Why Replicating a Conversational Product Is a High-Value Exercise
When an open-source model community published a complete list of application-layer capabilities—deep-thinking retrieval, file input, speech synthesis and speech recognition interfaces—and stated that developers could build a functionally equivalent conversational application themselves, work that normally belongs to a product team was compressed into an engineering experiment that could be finished in a few hours. A subsequent adjustment to usage limits was a reminder that a persistent tension exists between open interfaces and product experience, driven by resources and cost.
For developers, the value of this kind of task is not “copying a page.” Instead, it covers a full set of typical engineering problems: frontend fidelity, state management, streaming output, session persistence, multimodal input, and key security. This article therefore strips away the specific product attributes and frames the task as a general question: given a mature conversational web application, how can an LLM-driven AI coding tool complete a high-fidelity replication within a controlled process and then deliver an improved version?
2. Task Breakdown: Three Deliverables That Define Acceptance Boundaries
High-quality replication starts with turning vague requirements into verifiable artifacts. In practice, three types of deliverables should be fixed:
- Product feature document and structure diagram: This must list the information architecture, page hierarchy, core interaction paths, and state transitions. The structure diagram should show the main relationships among the input area, session list, message stream, and settings panel.
- High-fidelity replicated pages: UI layout, spacing, font sizes, corner radii, dark mode, and the position and size of the mobile input box must all align with the reference implementation. Core flows—creating a session, sending a message, streaming rendering, stopping generation, renaming, deleting, and sharing—must work.
- Independently optimized version: The tool is allowed and encouraged to search online for common design patterns and fill in capabilities missing from the reference implementation, such as a keyboard shortcut system, message branching, export formats, and accessibility support.
The order of these three items cannot be reversed: the document comes first to ensure a shared understanding, replication comes second to ensure fidelity, and optimization comes last so that innovation does not break the baseline.
3. Experiment Design: Comparing Multiple “Model + AI Coding Tool” Combinations
To observe differences in strategy, around six combinations of “LLM + AI coding tool/client” can be compared side by side, covering different orientations such as long-context, strong-reasoning, and general-purpose conversational models. What matters more than the number of models is variable control:
- Unified environment: the same starting directory, the same dependency versions, and the same browser-based acceptance environment.
- Unified prompts: a two-round setup, where the first round provides only the requirements and the reference URL, and the second round injects the access key.
- Unified scoring: equal weighting across five dimensions—fidelity, feature completeness, code runnability, test depth, and documentation quality.
A sample evaluation record can be expressed as a simple checklist:
run_id: exp-01combo: long_context_model + agent_tooldeliverables:doc: passclone: 0.92 # self-assessed structural similarity to the reference implementationimproved: passverification:cases_total: 24cases_passed: 19notes: the mobile input area has a 2px deviation
4. Two-Round Prompting: Separating “What to Build” from “How to Verify”
The first-round prompt only describes the role and the goal, for example: “Assume you are a senior product manager. Based on the public pages and open API documentation of a conversational application, produce one feature document with a structure diagram, one replicated page, and one optimized page. You may use a logged-in browser tool to access the pages. Ignore existing skills and plugin configurations, and start immediately.” This round assesses requirement understanding and planning.
The second-round prompt only adds the key information and assesses verification and self-repair. The difference observed in testing was significant: some combinations ran only the simplest flow after receiving the key and declared the task complete, while others proactively constructed edge cases—extremely long input, concurrent sessions, stream interruption and reconnection, empty responses, and illegal characters—thereby exposing defects and iterating on fixes. This shows that the gap between “can generate” and “can deliver” is determined mainly by test depth.
5. Key Engineering Checklist
- Streaming rendering: append chunks rather than replacing the whole block, and pair this with a cancellable request controller to avoid partial content when generation is stopped.
- Session state: store the session list and the message stream separately, use stable unique identifiers, and keep the local cache in sync when deleting or renaming.
- Key security: keys must exist only in runtime environment variables or a backend proxy layer and must never be written into frontend artifacts; the frontend forwards calls through its own backend.
- Multimodal input: file and voice input need defined size limits, type whitelists, and fallback paths for transcoding failures.
- Responsive layout: rely mainly on flexbox and relative units, and verify the height calculation of the input area and scroll container on mobile first.
- Accessibility: semantic tags, focus order, contrast, and keyboard reachability should be part of acceptance.
6. Conclusion: Turning a Demo into a Reusable Process
The final conclusion of the comparison is not that one model is the strongest. Rather, when deliverables are clearly defined, variables are strictly controlled, and verification is enforced up front, the success rate and stability of replication tasks improve significantly. Teams can turn this process into a template for internal prototype validation, migration assessment, and engineering standard checks. Combined with general capabilities such as the container platform, object storage, log service, and monitoring and alerting offered by Baidu AI Cloud, a one-off experiment can also be extended into a continuously observable online service.
