Multi-Model Replication of a Chat App: An Engineering Practice Guide

    This article walks through a controlled experiment in rebuilding a mature conversational AI web app with multiple LLMs paired with AI coding clients. It covers the two-round prompting design, why the second round exposes real capability gaps, key implementation details for high-fidelity UI replication, retry and cost-control patterns, and practical recommendations for teams that want to isolate model differences behind an adapter layer.

    1. Background and Problem Statement

    An open-source model community recently floated an appealing proposal: since it had publicly exposed a complete set of application interface capabilities — conversational features such as deep reasoning retrieval and file input, plus audio capabilities such as speech synthesis and speech recognition — developers should in theory be able to build a functionally equivalent chat application on their own. The community later revised its free tier, capping daily conversation turns and single-request input length. That change turned “self-hosting” from a hobby into a practical requirement.

    Setting aside the specifics of any particular product, this article addresses one general engineering problem: given a mature conversational AI product, how do you get multiple LLMs to work with AI coding tools to automatically complete the full loop of “understand the product — reproduce the product — improve the product,” and use a consistent standard to judge which combination is more reliable?

    Three deliverables are required:

    1. Product documentation and a functional architecture diagram;
    2. A high-fidelity web reproduction (UI and interactions as close as possible to the original);
    3. A new version optimized with engineering judgment (experience and features may both change).

    2. Test Design and Variable Control

    The point of the evaluation is not “who writes code fastest,” but “who makes fewer mistakes when information is incomplete.” Variables therefore have to be controlled.

    Model and tool combinations (6 groups): each pairs a flagship reasoning model from a different vendor with a mainstream AI coding client, covering ultra-long context mode, standard context mode, and multi-agent collaboration mode. To avoid pointing at specific brands, the combinations are referred to below as Combination A through Combination F.

    A shared two-round prompt:

    • Round one provides only the requirements and access method, with no API key, to observe the model’s planning and decomposition ability;
    • Round two supplies the API key, to observe whether the model proactively verifies, finds defects, and fixes them.

    Shared constraints: models are required to ignore existing memory, skill plugins, and external extensions and execute directly, reducing the incomparability introduced by external assistance.

    Prompt skeleton:

    1. You are a senior product manager and front-end architect tasked with replicating a conversational AI web app.
    2. The target site and API documentation are provided by the user, and you already have browser access with an authenticated session.
    3. Deliver:
    4. 1) A product report: feature list + functional architecture diagram;
    5. 2) A replica: UI and interactions identical to the original site;
    6. 3) An optimized version: UI/UX and feature improvements based on your own judgment.
    7. Do not rely on any preset skills or plugins. Start immediately.

    3. Key Observation: The Second Round Reveals the Real Gap

    Once the API key was provided, the combinations diverged sharply — the most valuable finding of this evaluation.

    • Shallow connectivity checks only: sending a single request, confirming a normal response code, and declaring the task done. These combinations tend to surface broken streaming output, truncation on ultra-long contexts, and missing error retries in real use.
    • Proactive deep verification: constructing multi-turn conversations, very long text, concurrent requests, and malformed input, then locating defects and fixing them — for example adding request timeouts and exponential backoff, virtual scrolling for messages, and persisting sessions to local storage.

    The conclusion is clear: baseline generation ability has converged across models; the difference lies in whether a model keeps asking questions and proving itself after resources are handed over. This matches real development work — running is not the same as being deliverable.

    4. Implementation Notes

    4.1 Feature Mapping and Architecture Diagram

    Produce the information architecture first, then write code. A layered structure is recommended:

    1. Conversational app
    2. ├── Input layer: text, files, voice
    3. ├── Session layer: multi-turn context, branches, renaming
    4. ├── Capability layer: reasoning modes, web retrieval, tool calls
    5. ├── Presentation layer: streaming render, code highlighting, tables and charts
    6. └── Support layer: auth, rate limiting, logging, monitoring and alerting

    4.2 Details That Matter for High-Fidelity Replication

    • Manage layout grid and spacing through design variables instead of magic numbers;
    • Render streaming output incrementally, with skeleton screens and auto-scroll to the bottom;
    • The message state machine must cover five states: pending / streaming / success / error / aborted;
    • Do not skip keyboard shortcuts, paste-to-upload, drag-and-drop upload, or stop-generation interactions.

    4.3 Stability and Cost Control

    1. async function chat(payload, { retries = 3 } = {}) {
    2. for (let i = 0; i < retries; i++) {
    3. try {
    4. return await fetch(endpoint, {
    5. method: 'POST',
    6. headers: { 'Content-Type': 'application/json' },
    7. body: JSON.stringify(payload),
    8. signal: AbortSignal.timeout(30000),
    9. });
    10. } catch (e) {
    11. if (i === retries - 1) throw e;
    12. await new Promise(r => setTimeout(r, 2 ** i * 500));
    13. }
    14. }
    15. }

    Additional recommendations: place the API key behind a server-side proxy so the front end only calls your own gateway; enforce local quotas on token usage, concurrency, and per-user daily allowance; connect logs and metrics to a general-purpose logging service and monitoring/alerting so long-tail issues can be traced.

    5. Directions for the Optimized Version

    Building on the replica, four enhancements are worth prioritizing: in-session semantic retrieval with compressed history summaries, structured output (tables / charts / mind maps), multi-agent division of labor (planner + executor + reviewer), and explainable citation of sources. None of these depend on a single vendor’s proprietary interfaces; they are common industry practice.

    6. Evaluation Results and Recommendations

    Weighing feature completeness, replication fidelity, and self-discovered defect rate, the strongest performers were the combinations that were more stable with ultra-long contexts and tool calls and that proactively ran regression verification after receiving the API key. Combinations that did only shallow verification were not slow on the first draft, but their rework cost was higher.

    Three recommendations for teams: first, write “self-verification” into both the prompt and the acceptance checklist; second, always run two rounds — the second round is the dividing line; third, build a self-hosted gateway that handles authentication, rate limiting, and observability in one place, keeping model differences confined to the adapter layer, so switching model combinations later requires no rewrite of business code.