Replicating LLM Applications in Practice: A Complete Methodology from Requirements to Delivery
This article presents a practical methodology for using large language models to replicate a conversational web application, from requirements understanding to a runnable deliverable. It breaks the task into three deliverables—product documentation, high-fidelity UI cloning, and an experience-improved version—and defines five fixed acceptance dimensions for fair comparison. It then details a two-round prompting experiment, key findings on why modeling states before coding improves stability, a six-element prompt design pattern, cloud engineering essentials, and common pitfalls with mitigations. Readers will gain a repeatable, comparable framework for building AI applications with LLMs.
1. Background and Problem Definition
A recent industry practice exposes model capabilities through APIs and encourages developers to build their own conversational applications. This decouples “model capability” from “product form”: the model provides atomic capabilities such as inference, retrieval, file parsing, and speech transcription and synthesis, while the interface, session management, permissions, and billing are organized by the developer. This raises a question with real engineering value: if a large model is asked to replicate a mature conversational product on its own, can it close the loop from requirements understanding to a runnable deliverable? And where exactly do different models and execution harnesses differ on this task?
This article does not evaluate any specific vendor product. Instead, it abstracts the problem into a general technical proposition: using a conversational web application as the target, verify the capability boundaries of large models across three deliverable types—product documentation generation, high-fidelity interface reproduction, and autonomous improvement—and provide a transferable methodology.
2. Task Breakdown: Three Deliverables and Acceptance Dimensions
Splitting the replication task into three deliverable types is the first step in controlling complexity.
- Product feature documentation and structure diagram: The model must first organize the information architecture and output a feature list, hierarchy, and page flow. This step tests abstraction and generalization.
- High-fidelity interface replication: The visual result and interactions should stay as close as possible to the original product, including layout grids, component sizing, responsive breakpoints, and state feedback. This step tests attention to detail and front-end engineering.
- Experience-improved version: Building on an understanding of the original product, the model may optimize the experience and add features. This step tests aesthetic judgment, tradeoff decisions, and engineering feasibility.
The acceptance dimensions should be fixed at five: feature coverage, fidelity, code runnability, interaction completeness, and improvement reasonableness. Fixed dimensions are the prerequisite for meaningful horizontal comparison.
3. Experiment Design: Two Prompting Rounds and Unified Operations
To keep the comparison fair, the experiment uses a two-round prompting design:
- The first round provides only the requirements and a reference entry point, with no keys, to observe the model’s autonomous exploration and clarification behavior.
- The second round adds access credentials to observe how behavior changes once the model has “usable resources.”
A clear divergence appears in practice: some models perform only a minimal connectivity check after receiving credentials and then declare completion; others proactively construct boundary inputs, exception paths, and long-session scenarios, exposing defects and going back to fix them. This difference is not about capability level but about strategic orientation—the former favors fast convergence, the latter favors deep validation. Unified operations, unified dimensions, and changing only the model and harness variables are what make the conclusions credible.
A schematic evaluation record structure can be abstracted as:
{"run_id": "exp-001","model_slot": "A","harness": "agent-team","rounds": 2,"deliverables": ["doc", "clone", "improved"],"scores": {"coverage": 0,"fidelity": 0,"runnability": 0,"interaction": 0,"improvement": 0},"observed_defects": []}
4. Key Finding: Stability Comes from “Model First, Then Build”
Overall, the most stable performer was not the one that produced the most code, but the one that built a complete functional model in the documentation phase before writing code. It showed two observable traits: first, it proactively annotated acceptance notes in the documentation (for example, that share links need to be verified in a different browser or after clearing the cache), showing awareness of environment differences; second, the replica matched the reference implementation closely on details such as the position and size of the input box on mobile, with the core flow fully functional.
This confirms an engineering lesson: most interface-replication failures are not because the model “cannot write components,” but because it “did not figure out which states exist.” Empty conversation state, loading state, streaming output state, error state, history list scrolling and positioning, attachment upload progress, and shortcut-key conflicts—if these states are not enumerated during modeling, they will inevitably be missed during coding.
5. Prompt Design Pattern
A high-quality prompt should contain six elements: role definition, target deliverables, reference information, constraints, execution method, and delivery format. It can be abstracted as:
You are a senior product manager and front-end engineer.Goal: produce (1) feature documentation and a structure diagram, (2) a high-fidelity replica page, and (3) an improved version of the page.Reference: the target site and open API documentation (access method provided by the user).Constraints: use only a native front-end stack; do not introduce unavailable resources; ensure it runs offline.Execution: first output the feature and state list, then code after confirmation; provide self-test results at the end of each round.Delivery: directory structure + startup instructions + known-defects list.
Among these, three items have the greatest impact on final quality: “list before coding,” “self-test each round,” and “explicitly list known defects.”
6. Engineering Implementation Essentials
To turn a replication result into an operable application in the cloud, focus on these general capability categories:
- Access layer: use load balancing and a gateway for authentication, rate limiting, and canary releases.
- Session storage: use a structured database to store sessions and messages, and a cache service to handle hot sessions.
- Asynchronous tasks: use a message queue for long-running tasks such as file parsing and speech transcription.
- Object storage: store uploaded files and static assets.
- Observability: use logging and monitoring with alerts covering time-to-first-token, failure rate, and queue backlog.
- Cost control: set quotas by token and concurrency to avoid unexpected costs during debugging.
On Baidu AI Cloud, all of these capabilities have corresponding general product categories that can be combined directly, with no need to build the entire infrastructure stack yourself.
7. Common Pitfalls and Mitigations
- Incomplete state enumeration: use a checklist to force listing every page state and check them off one by one.
- Responsive design limited to desktop: include narrow-screen and mobile breakpoints in the acceptance checklist.
- Stopping short after receiving credentials: require constructing exception and boundary cases in the prompt.
- Uncontrolled scope growth in the improved version: cap the number of improvements and require a rationale for tradeoffs.
- Missing runnability instructions: deliverables must include startup steps and dependency notes, or they are considered incomplete.
8. Conclusion
Having a model replicate a conversational application is essentially a stress test of the closed-loop capability of “requirements modeling—tool use—self-validation.” The outcome does not depend on the amount of code generated in a single pass, but on whether a complete state model is established first, whether there is awareness of environment differences, and whether the model proactively digs for defects after gaining access to resources. By fixing the evaluation dimensions, consolidating the prompt design pattern, and combining cloud engineering capabilities by general category, teams can obtain a repeatable, comparable, and deliverable AI application development process at relatively low cost.
