Replicating Conversational Web Pages: A Multi-Model Engineering Approach
This article introduces a repeatable engineering methodology for using multi-model collaboration and AI coding tools to replicate and improve conversational web applications. It covers defining core capabilities, implementing a two-round prompting strategy, creating architecture-driven documentation, building a minimal closed-loop system, formulating verifiable improvements, and conducting deep testing to evaluate true delivery quality under identical constraints.
Conversational web pages may seem like just an input box and a message list, but implementing them actually involves information architecture, streaming output, session state, key and quota management, failure retries, observability, and security boundaries. When using multiple large language models combined with AI coding tools to “replicate and improve” the same product, the comparison should not be based on marketing slogans, but on the delivery quality under identical constraints. The following text abstracts this type of experiment into a repeatable engineering method, allowing teams to use the same benchmark during tool selection, acceptance, and iteration.
1. Define Capabilities to Verify, Not Just Stack Models
The most common distortion in multi-model comparisons is when each group uses different prompts, acceptance criteria, and manual interventions. A more robust approach is to converge the experiment into three fixed deliverables.
First is the product functional documentation and architecture diagram. The document must clearly define roles, primary paths, exception paths, data objects, and non-functional requirements. The architecture diagram must express page partitions, state transitions, and external dependencies, rather than just a single homepage wireframe.
Second is the replicated conversational web page based on requirements. It should cover session creation, multi-turn messaging, streaming or segmented display, stop generation, error prompts, and basic history. The standard for replication is behavioral alignment, not pixel-perfect visual copying.
Third is the improved version based on engineering experience. Improvements should involve clear trade-offs, such as ensuring keys are not included in the frontend bundle, failures can be retried, long answers can be interrupted, and key operations can be tracked. Simply changing the skin or copywriting should not be considered a valid improvement.
These three outputs correspond to “whether the product is understood,” “whether a closed loop can be implemented,” and “whether engineering judgment is present.” Looking at only one output makes it easy to misjudge results—like favoring well-written but non-runnable code, or runnable code that lacks boundary handling.
2. Use Two Rounds of Prompts to Separate “Understanding” and “Integration”
It is recommended to fix two rounds of inputs and avoid adding personalized guidance midway.
The first round provides only requirements: target users, core scenarios, mandatory features, explicitly out-of-scope items, delivery format, and acceptance criteria. No access credentials are provided at this stage. This helps determine if the model will first produce a reviewable plan rather than rushing to write non-functional API call code.
The second round provides test keys or a gateway address, declaring that they are for this verification only, must not be committed to the repository, and must not appear in plaintext logs. This stage evaluates post-integration behavior: whether it performs minimal smoke tests, constructs multi-turn and exception cases, and modifies the implementation based on failures.
The operator must maintain a consistent set of actions: identical requirement text, identical key distribution timing, identical allowed modification scope, and identical deadlines. Observed differences should be attributed to the model and execution framework strategies—such as whether it proactively adds tests, narrows changes after failures, or over-refactors—rather than manual ad-hoc prompt supplementation.
3. Documentation and Architecture Diagrams Must Guide Implementation
Functional documentation is recommended to follow an “Object-Process-Constraint” structure, rather than just listing features by page.
Core objects should include at least: User, Session, Message, Model Configuration, and Generation Task. Messages must distinguish role, content, status, and time; Generation Tasks must have states like queued, in-progress, completed, canceled, and failed. If the product supports attachments or tool calls, permissions and timeouts should be listed separately instead of being stuffed into the message body.
The main process can be condensed to: create session, send user message, request generation, incremental rendering, end or interrupt, and persistence. Exception processes should cover at least: invalid credentials, upstream timeout, context too long, concurrent clicks on send, and state recovery after page refresh.
The architecture diagram needs only three layers. The Presentation Layer includes the session list, message area, and input area. The Application Layer includes session services, generation orchestration, and error normalization. The Dependency Layer includes the model invocation gateway, object storage, logs, and monitoring. Each arrow in the diagram should mark whether it is synchronous or asynchronous. Without this diagram, the subsequent “improved version” can easily become boundaryless feature stacking.
4. The Replicated Version Should Pursue a Runnable Minimal Closed Loop
When replicating the web page, prioritize ensuring a repeatable path for demonstration: open the page, create a session, send a question, see incremental results, and still be able to read the history after a refresh. The UI can be plain, but the state must be honest. During generation, repeat sending should be disabled or explicitly queued; on failure, user input should be retained to prevent content loss; the stop operation should notify both frontend rendering and backend tasks, not just hide the loading animation.
Keys and addresses should not be compiled into static assets. The browser should only access its own backend; the backend then accesses the model gateway and maps error codes to user-friendly prompts. An illustration is as follows:
Browser --HTTPS--> Application Backend --Intranet or dedicated line--> Model Gateway|--> Session Storage|--> Logs (desensitized)
The frontend can use event streams or chunked transfer to receive incremental text. Regardless of the protocol, end markers, error events, and heartbeat timeouts must be defined. A streaming connection without a timeout will appear to be “thinking forever” during a brief network interruption.
For storage, relational tables can initially be used to save sessions and messages, with large objects placed in object storage. Do not introduce too many middleware components in the first version. Message queues, caches, and retrieval systems should only be added when concurrency, retries, or knowledge bases become actual bottlenecks; otherwise, the comparison experiment will be overwhelmed by architectural complexity.
5. The Improved Version Must Clearly State “What Changed and Why It’s Better”
Improvements should not deviate from the replication goal. Relatively robust directions that do not depend on specific vendor capabilities include:
- Input: Limit single input length, prompt truncation strategy, avoid silently dropping user content.
- Output: Separate incremental rendering from final persistence, mark incomplete answers after interruption.
- Reliability: Use bounded backoff for retriable errors; fail immediately for authentication failures without meaningless retries.
- Security: Store keys only in server-side key management; desensitize logs; disable downloads and sharing by default.
- Observability: Record request ID, duration, status, and error category for each generation to facilitate regression testing.
- Experience: Empty states, retry buttons, and historical session naming to reduce the “usable but hard to find” problem.
Every improvement should be describable using an acceptance statement. For example, “Returns to an input-enabled state within 30 seconds after an upstream timeout, and the original question remains in the input box.” Improvements that cannot be observed should not count toward the evaluation score.
6. Shallow vs. Deep Testing Will Reveal the Gap
After receiving the keys, some execution strategies only run a single success path: sending a short greeting and claiming completion upon seeing a reply. This proves connectivity, but not the product.
Deeper verification should at least include: whether multi-turn referencing causes cross-talk; whether excessively long inputs result in a clear failure; whether consecutive rapid sends generate duplicate messages; whether refreshing during generation produces half-records; whether error keys expose internal information to the page; and whether generation continues to incur costs or write to the database after being stopped. AI agent division of labor or longer context may run a few more boundary cases, uncovering vulnerabilities in state machines and prompts; however, this is not an inherent advantage. Longer context may also lead to deviation and over-modification. Evaluation records should separately note “issues discovered” and “unauthorized scope expansion.”
It is recommended to prepare a fixed test case table: ID, preconditions, operation, expected result, actual result, and whether it is a blocker. All models use the same table. Human testers only supplement objective phenomena and do not change requirements midway through testing. This way, strategic differences are revealed by data, rather than being amplified by presentation rhetoric.
7. How to Interpret Results and Implement Them
Do not treat a single generation’s quality as the model’s entire capability. The success of a conversational product depends more on whether constraints are executed: whether the documentation is traceable to the UI, the UI to the API, and the API to the logs. If a result has complete documentation but cannot run, it should be judged as passing the planning phase but failing the implementation phase; if it runs but lacks exception handling, it should be judged as passing the demonstration but failing the engineering phase.
Teams can solidify the above method into a checklist: frozen requirements, two-round prompts, three types of outputs, unified test cases, keys not in the frontend, reproducible failures, and verifiable improvements. During deployment, a container platform can be used to host the backend, and logging services with monitoring alerts can observe timeouts and error rates. If using general cloud resources like Baidu AI Cloud, planning should also be based on categories like object storage, containers, and logs, rather than tying evaluation conclusions to unmeasured performance figures.
Before having unified samples, time limits, and failure classifications, it is unwise to declare that one approach is comprehensively superior. More valuable conclusions usually are: which strategy is more likely to proactively find defects in the second round, which strategy is better suited to produce reviewable documents first, and exactly which line the team’s acceptance threshold is written on. Clarifying these three points turns multi-model replication from an experience share into a repeatable engineering practice.
