Multi-Model Replication of a Chat Application: Technical Practices
This article breaks down the engineering work required to replicate a conversational web app with different LLMs and agent frameworks. It defines three deliverables, a controlled two-round prompting setup, prompt engineering requirements, documentation and structure diagram standards, high-fidelity restoration checklists, server-side key handling with a streaming proxy example, improvement priorities, and a scoring record with common failure modes. Readers get a reusable workflow and acceptance criteria for comparing models and frameworks fairly.
1. Background: From “It Can Chat” to “A Deliverable Replication”
When a conversational product exposes its API and states that developers can build functionally equivalent applications, the engineering focus shifts from “calling an endpoint once” to “systematically replicating a complete product.” The real difficulty is not whether the pages look good, but whether three things hold at the same time: complete feature coverage, faithful interaction details, and stable operation once real services are connected.
Many teams fail at this kind of attempt because they treat it as pure UI imitation: they build a static page first, add an input box, and only then discover that streaming output, context management, error retries, authentication, and rate limiting are all missing. This article therefore frames the topic as a general technical problem: how to use different large models and agent execution frameworks to produce a high-fidelity replication of a conversational web app, plus engineering improvements, and provides a practical process and acceptance criteria.
2. Task Breakdown: Three Deliverables Define the Evaluation Dimensions
To make results comparable across models, fix the task as three explicit deliverables:
- Product feature document and feature structure diagram: state which feature modules the target site has, the hierarchy and navigation relationships between modules, and express the information architecture as a structure diagram.
- High-fidelity replicated pages: features and visuals as close to the original as possible, including layout, component states, and responsive breakpoint behavior.
- Improved version of the pages: optimize experience and features based on an understanding of the original product, allowing capabilities common in the industry but absent from the original site.
These three deliverables map to three capabilities: abstraction and documentation, restoration and coding, and product judgment and tradeoffs. Score them separately instead of giving one vague “good/bad” verdict.
3. Experiment Design: Controlled Variables and Two Prompt Rounds
Comparing models and execution frameworks depends on controlling variables. Fix these conditions: the same requirements description, the same acceptance criteria, the same runtime environment, and the same time budget. On the model side, cover different types (general reasoning, ultra-long context, code-specialized). On the framework side, cover forms such as “single agent,” “multi-agent collaboration,” and “coding agent with terminal execution.”
Sending the prompt in two rounds is the most instructive design in this evaluation:
- Round one gives only the requirements: the target site URL, the API documentation URL, a description of available browsing tools, and the three deliverable requirements, with an explicit instruction to ignore historical memory and existing plugin configuration and start executing directly.
- Round two adds only a key: used for real integration testing.
The second round looks like a minor addition, but it exposes differences in each framework’s “finishing strategy”: some perform only a minimal connectivity check; others proactively construct multi-turn conversations, ultra-long inputs, interrupted requests, and concurrent requests, then find defects and go back to optimize. This means the evaluation report must record a “verification depth” metric; otherwise “no problems found” gets mistaken for “no problems exist.”
4. Prompt Engineering Essentials
A high-quality task prompt should contain five kinds of information: role setting (senior product manager), goal and boundary (replicate rather than redesign), input materials (site and documentation), tool availability (can browse logged-in pages), and delivery format (document, replicated pages, improved pages). Also state prohibitions explicitly, for example: do not invent nonexistent APIs, and do not hardcode the key into the frontend.
An illustrative structure:
Role: Senior product manager + frontend engineerGoal: Replicate the conversational web app and produce an improved versionInputs: Target site, API documentation, available browsing toolsDeliverables: Feature doc + structure diagram / replicated pages / improved pagesConstraints: No invented APIs; key server-side only; ignore prior configuration
5. What Makes a Feature Document and Structure Diagram Acceptable
An acceptable feature document is not a pile of feature lists but a specification that can guide development. At minimum include: the information architecture (hierarchy of modules such as chat, conversation history, settings, sharing, files, and voice), the state machine for each module (empty, loading, streaming output, error, rate limited), and key interaction rules (message reordering, context trimming, keyboard shortcuts).
The structure diagram can be a simple hierarchy tree that both machines and people can read:
Chat application├── Conversation area│ ├── Message list (streaming render / retry / quoting)│ └── Input area (multimodal attachments / voice / shortcuts)├── Conversation history (grouping / search / rename / delete)├── Sharing and export└── Settings (model and parameters / theme / data management)
6. High-Fidelity Restoration: Details Decide Success
Almost the entire gap in fidelity shows up in details. The checklist to verify closely includes: breakpoint differences between desktop and mobile, position and size of the input box, scrollbar and message anchor behavior, cursor and auto-scroll during streaming output, horizontal scrolling and copy button for long code blocks, wording and placement of error messages, and contrast in dark mode.
A practical approach is “dual-channel acceptance”: the visual channel compares screenshots region by region, and the behavioral channel runs scripts through the main paths. Screenshot comparison alone misses streaming and error branches; scripts alone miss pixel-level deviations.
7. Real Integration Testing: Give the Key to the Server
Once you have the key, the correct approach is to keep it on the server or in local environment variables. The frontend communicates only with your own backend, which proxies and forwards requests while injecting the authentication header. Example code:
import osfrom fastapi import FastAPIfrom fastapi.responses import StreamingResponseimport httpxapp = FastAPI()API_KEY = os.environ["MODEL_API_KEY"] # exists on the server only@app.post("/chat")async def chat(payload: dict):async def gen():async with httpx.AsyncClient(timeout=60) as client:async with client.stream("POST", UPSTREAM_URL,headers={"Authorization": f"Bearer {API_KEY}"},json=payload) as r:async for chunk in r.aiter_text():yield chunkreturn StreamingResponse(gen(), media_type="text/event-stream")
Cases that must be covered during integration testing: time to first token and overall throughput, truncation strategy when context exceeds limits, rate limiting and backoff retries under concurrency, resumption and idempotency after network interruption, and keeping sensitive information out of logs.
8. How to Make the Improved Version Valuable
Improvements should not be a grab bag of features but should center on verifiable experience metrics: conversation search and grouping, message-level regeneration and branching, reusable prompt templates, unified interaction for attachments and voice input, accessibility (keyboard reachability, contrast, screen reader labels), and observability (frontend instrumentation, trace propagation, error aggregation). For each item, state “what pain point it solves and how it is measured.”
9. Evaluation Record Table and Common Failure Modes
Use one table to record consistently: deliverable completeness, number of fidelity deviation items, integration case pass rate, verification depth, and whether invented APIs appeared. Common failure modes include: producing only a static page with no streaming render; writing the key into the frontend; ignoring mobile breakpoints; missing error branches; and documentation inconsistent with the implementation.
10. Conclusion
The real barrier to replicating a conversational app is the closed loop of “document — restore — integrate — harden,” not single-point generation speed. Standardizing the process with fixed deliverables, two prompt rounds, and dual-channel acceptance is what yields credible conclusions in cross-model, cross-framework comparisons and turns the results into reusable engineering assets for the team.
