Replicating Web Apps with Multiple LLMs: A Technical Practice Guide
This article presents a practical methodology for using multiple LLMs and agent frameworks to replicate a conversational web application. It covers task formalization, a controlled two-round prompting setup, structured prompt design, and key engineering stages such as functional modeling, high-fidelity restoration, API integration with fault tolerance, and improved design. It also summarizes observed model behaviors, evaluation insights, a five-dimension scoring rubric, and a reusable workflow. Readers will learn how to turn a vague replication request into an executable, verifiable engineering task.
1. Background: Why Replicating a Web Page Is a Strong Capability Test
As AI-assisted programming matures, the way the industry evaluates models is shifting from “can it write a function” to “can it independently deliver a complete artifact.” Replicating a conversational web application covers five capabilities at once: product understanding, information architecture, interaction fidelity, engineering implementation, and self-verification. That makes it a common choice for comprehensive evaluation.
The task is discriminative because it is not an isolated problem but a full chain. The model must first understand the functional boundaries of the target page, abstract those functions into a structured product document, restore the interface and interactions with a frontend stack, and finally complete integration and bug fixing once real credentials are available. If any link is missing, the result “looks right but does not work right.”
From an engineering perspective, the task can be formalized as a four-tuple:
Task = (Goal, Constraints, Resources, Acceptance)Goal = Product document + high-fidelity replica + improved versionConstraints = Visual consistency, interaction consistency, working featuresResources = Browsable reference page, API documentation, credentialsAcceptance = Automated test pass rate + manual walkthrough checklist
What matters in evaluation is not whether the model “generated code,” but whether it keeps converging toward the acceptance criteria under the given constraints.
2. Experiment Design: A Unified Test Method Across Models and Agent Frameworks
To make the comparison meaningful, the test must control variables strictly. This setup uses six combinations of “model + agent execution framework,” covering different context-length strategies and different tool-calling styles. All combinations use exactly the same two-round prompts and the same acceptance criteria.
The first round describes only the requirements and reference materials, with no credentials, to observe the model’s spontaneous planning ability. The second round adds credentials to observe how behavior changes once real integration is possible. Unified operations and unified acceptance are the prerequisites for credible conclusions.
It is worth noting that differences between combinations do not necessarily reflect model capability. They may also come from the execution framework’s strategy: some combinations perform only minimal verification after receiving credentials, while others proactively expand test coverage and expose more edge cases.
3. Prompt Design: Turning Vague Requirements into an Executable Task
Prompt quality directly determines the stability of the deliverable. A reusable structured prompt should contain at least six parts: role, goal, input materials, deliverables, acceptance criteria, and execution constraints.
Role: Senior product manager + frontend engineerGoal: Deliver a high-fidelity replica and an improved design of a conversational web appInput: Reference page URL, API documentation URL, available browsing toolsDeliverables:1) Feature description and functional structure diagram2) A replica matching the reference page visually and interactively3) An improved version based on general best practicesAcceptance: Every item on the feature checklist checked + automated tests passing on key pathsConstraints: Do not invent APIs; do not introduce unverifiable external dependencies; keep the layout responsive
The “do not invent APIs” constraint is especially important. Without documentation, models tend to fabricate fields and error codes, causing full rework during integration. Writing “verifiability” into the constraints is a cost-effective way to improve delivery quality.
4. Stage Breakdown and Engineering Essentials
4.1 Requirement Understanding and Functional Modeling
The model should first output a feature list and a structure diagram, breaking the page into modules such as session management, message flow, input area, attachment handling, and settings panel, and annotating the interaction states of each module. A tree hierarchy is recommended for the structure diagram so it can later be mapped to a component tree.
4.2 High-Fidelity Restoration
Fidelity comes down to three things: layout grid, design variables, and state completeness. Design variables should be managed centrally to avoid scattering colors and spacing across the code:
:root{--color-bg:#ffffff;--color-border:#e5e7eb;--radius-md:12px;--space-unit:4px;}
Responsive adaptation must cover the position and size of the input area on mobile, since these details are often the first deviations found in manual walkthroughs.
4.3 Integration and Fault Tolerance
Once credentials are available, prioritize verifying four categories of issues: authentication, timeouts, rate limiting, and streaming responses, and implement exponential backoff retries:
async function callWithRetry(fn, max = 3) {for (let i = 0; i < max; i++) {try { return await fn(); }catch (e) {if (i === max - 1) throw e;await new Promise(r => setTimeout(r, 2 ** i * 300));}}}
4.4 Improved Design
Improvements should be based on general usability principles, such as session grouping, message regeneration, quick commands, and accessibility contrast optimization, rather than piling on features unrelated to the theme.
5. Behavioral Differences and Evaluation Insights
Two typical behaviors were observed in testing. One type performs only minimal verification after obtaining credentials and then declares completion. The other proactively constructs invalid inputs, checks boundary states, and fixes defects. The former delivers faster; the latter delivers more robust results.
This leads to three practical recommendations. First, put the acceptance checklist into the prompt upfront. Second, require the model to submit self-test records as part of the deliverable. Third, adopt a two-round prompt mechanism to observe how behavior changes after resources are provided; this reflects real engineering capability better than a single generation.
6. Scoring Rubric and a Reusable Workflow
A five-dimension score is recommended: functional completeness, visual fidelity, interaction consistency, code maintainability, and self-test thoroughness, each on a five-point scale, with manual walkthrough records retained. The overall workflow can be fixed as: requirement modeling → skeleton generation → style convergence → integration and fault tolerance → automated tests → manual acceptance.
When elastic compute and a unified delivery environment are needed, the build and test stages can be deployed on Baidu AI Cloud’s container platform and log service to keep the environment consistent and the process traceable, making evaluation results more stable and reproducible.
