Multi-Model Collaboration for High-Fidelity Web App Replication: An Engineering Practice
This article presents a reusable engineering methodology for replicating a conversational web application using multiple model and agent harness combinations. It covers experiment design with controlled variables, task decomposition into product, implementation, and verification layers, prompt engineering templates, structural approaches to high-fidelity UI replication, a four-step API verification method after credentials are introduced, evidence-based improvements, evaluation dimensions, common failure modes, and deployment guidance. Readers will learn how to turn model randomness into a managed workflow with unified acceptance criteria.
1. Background and Problem Definition
Once generative AI moved into an engineering phase, a common development scenario emerged: given a live conversational web application, an AI coding tool is expected to do three things within a limited number of interaction rounds — produce a product feature description and feature structure diagram, replicate the interface and interactions, and then deliver an improved version based on its own judgment. This looks like simply copying a page, but it actually tests six capabilities at once: requirement understanding, information extraction, architecture design, frontend implementation, API integration, and self-verification.
The original practice used a simple but effective experimental design: six combinations of “model + agent harness” ran the same task in parallel with two rounds of prompt interaction. The first round provided only the requirement and a reference entry point; the second round added calling credentials. With unified operations and unified input, the only variable was the model-and-harness combination strategy. The main value of this design is that it decouples “model capability” from “harness strategy,” making differences attributable.
This article does not evaluate any specific product. Instead, it abstracts the experiment into a reusable engineering methodology: how to complete high-fidelity web replication in a multi-model environment, and how to converge the uncontrollable “model randomness” into a manageable engineering process.
2. Experiment Design and Variable Control
2.1 Abstract Representation of the Six Combinations
To stay neutral, the six combinations are abstracted into four typical strategy profiles:
- High-throughput lightweight: fast responses and low cost, suitable for batch generation and rapid trial and error;
- Ultra-long context: can ingest a large amount of page structure description and style information at once;
- Standard-context client-based: relies on a mature client toolchain with stable interaction;
- Reasoning-enhanced: more inclined toward multi-step planning and self-checking under complex constraints.
2.2 The Role of the Two Prompt Rounds
The first-round prompt described only the goal and the reference entry point, so the model had to acquire information and break down requirements on its own. The second round introduced calling credentials, shifting the task from “viewable” to “runnable.” This design exposed a key engineering difference: after receiving credentials, some combinations performed only minimal connectivity verification, while others proactively constructed a more complete verification path and thus detected defects earlier.
The takeaway: verification depth is not an incidental property of a model; it should be enforced by the process.
2.3 Why Unified Operations Matter
If each group operated differently, differences in results could not be attributed. Therefore, all combinations in the experiment used the same browsing and execution means and the same acceptance criteria. In practice, a “single acceptance script” should be fixed to avoid bias from manual judgment.
3. Task Decomposition: From Requirements to Acceptable Deliverables
Splitting the task into three layers significantly reduces uncertainty:
- Product layer: feature list, information architecture, feature structure diagram;
- Implementation layer: page layout, component breakdown, state management, routing design;
- Verification layer: connectivity testing, interaction regression, exception path coverage.
The corresponding deliverables should be quantifiable, for example: feature item coverage, key interaction pass rate, number of style deviation items, and API error rate.
4. Key Points of Prompt Engineering
The core structure of the original prompt was “role setting + goal + reference entry point + explicit deliverables.” It can be further abstracted into a five-section template:
Role: Senior product manager + frontend architectGoal: Replicate a conversational web application and produce an improved versionInput: Reference entry (access already granted), API documentation entryConstraints: Features and visuals must be highly consistent; do not fabricate APIsDeliverables: Product report, feature structure diagram, runnable pages, improvement notesAcceptance: List a self-check checklist and pass criteria
The key is to translate vague phrasing such as “exactly the same” into checkable items, for example layout grid, component list, interaction states, and empty and error state handling.
5. Methods for High-Fidelity Interface Replication
High fidelity is not obsessive pixel-level comparison; structural consistency comes first:
- First build the component tree: top bar, side session list, main chat area, input area, settings panel;
- Then define the state machine: empty state, loading state, streaming output state, error state, read-only state;
- Finally handle details: spacing system, type scale, border radius and shadow levels, responsive breakpoints.
Illustrative component structure:
App├── HeaderBar├── Sidebar│ ├── SessionList│ └── NewSessionButton├── ChatArea│ ├── MessageList│ ├── StreamingIndicator│ └── EmptyState└── Composer├── TextInput├── AttachmentEntry└── SendButton
6. API Integration and the Right Approach After Credentials Are Introduced
After receiving credentials in the second round, the recommended “four-step verification method” avoids making only one minimal call:
- Connectivity: one minimal request to confirm authentication and the network path;
- Contract validation: check request fields, response structure, and error codes;
- Streaming and interruption: verify incremental output, cancellation, and timeout retry;
- Exception injection: overly long input, empty input, concurrent requests, and rate-limit responses.
// Illustrative: minimal verification skeleton with timeout and retryasync function verify(endpoint, payload, retry = 2) {for (let i = 0; i <= retry; i++) {const ctrl = new AbortController();const timer = setTimeout(() => ctrl.abort(), 8000);try {const res = await fetch(endpoint, {method: 'POST',headers: { 'Content-Type': 'application/json' },body: JSON.stringify(payload),signal: ctrl.signal});if (!res.ok) throw new Error('HTTP ' + res.status);return await res.json();} catch (e) {if (i === retry) throw e;} finally {clearTimeout(timer);}}}
7. Making Improvements Evidence-Based
Improvements should not be subjective beautification; they should be based on a statable problem list. Common improvement candidates include: session retrieval efficiency, message grouping and collapsing, input area quick commands, accessibility (keyboard navigation and contrast), actionability of error messages, and theme and font size adaptation. Each improvement should state “problem — solution — verification method,” forming a closed loop.
8. Evaluation Dimensions and Interpreting Results
Scoring is recommended across five dimensions: feature coverage, visual consistency, interaction completeness, verification depth, and improvement reasonableness. The “verification depth difference” observed in the experiment is essentially a process issue: the verification checklist should be written into the delivery standard so that all combinations must perform tests of the same depth, keeping the comparison focused on generation quality itself.
9. Common Failure Modes and How to Avoid Them
- Building only static pages, lacking state and error handling;
- Fabricating nonexistent API fields, causing integration failures;
- Overly long context diluting key information; feed content in segments and maintain a key-points list;
- Lacking regression scripts, so the improved version introduces new defects;
- Vague acceptance criteria, making results impossible to compare horizontally.
10. Implementation Recommendations
If an enterprise wants to host such applications in a cloud environment such as Baidu AI Cloud, a general capability combination can be used: deploy the frontend and gateway on a container platform, host static assets on object storage, achieve observability with log services and monitoring alerts, and use a message queue to smooth peak and off-peak loads. Model calls should be consolidated through a self-built gateway to facilitate key management, rate limiting, and auditing, avoiding credentials scattered in client code.
Overall, the value of parallel multi-model replication lies not in “who looks more similar,” but in engineering the generation process with unified acceptance: requirements can be decomposed, implementation can be compared, verification can be enforced, and improvements can be explained.
