Replicating a Production-Grade AI Chat App with LLMs: A Full Workflow from Requirements to Delivery

    This article presents a vendor-neutral evaluation framework for measuring how well different LLMs and AI coding toolchains can replicate a mature conversational AI web application. It defines three required deliverables (a product feature document with a structure diagram, a high-fidelity replica, and an improved version), a two-round prompting strategy that withholds API credentials in round one and provides them in round two, and a reusable prompt skeleton. It also analyzes behavioral differences between conservative and exploratory toolchains, provides a runnable streaming chat implementation skeleton, and lists five scoring dimensions with an acceptance checklist. Finally, it outlines how to move the result to production using general cloud capabilities such as containers, object storage, message queues, and logging and monitoring.

    1. Background and Problem Definition

    The industry has recently seen a trend of packaging model capabilities into callable services and encouraging developers to build complete conversational applications on their own. This approach exposes interaction-layer capabilities that were previously locked inside a product—multi-turn dialogue, deep reasoning-based retrieval, file input, speech synthesis, and speech recognition—as interfaces, allowing developers to rebuild a feature-aligned conversational front end in their own environment.

    This raises an engineering question worth examining: once capabilities are exposed in a standardized way, how do you assess the real delivery quality of different models and AI coding toolchains on the task of replicating a mature chat application? The question is vendor-independent and essentially tests the intersection of three abilities:

    • Requirement understanding: extracting a complete feature list from a vague description.
    • Engineering implementation: producing runnable front-end and back-end code with a consistent information architecture.
    • Self-critique: being willing to run deep verification once credentials are available, rather than only getting a single minimal path working.

    This article reconstructs the evaluation methodology from a neutral perspective and provides implementation details you can apply directly.

    2. Evaluation Design: Tasks, Deliverables, and a Two-Round Prompt Strategy

    2.1 Three Required Deliverables

    Each “model + toolchain” group must produce all of the following:

    1. Product feature document and feature structure diagram: describing which modules the target application has and the hierarchy and navigation relationships between them.
    2. High-fidelity replica pages: interaction and visuals aligned with the original site.
    3. Improved version pages: on the basis of understanding the product positioning, autonomously adding reasonable features and optimizing the experience.

    The third deliverable is what separates the field. The first two test whether the model “understands and copies accurately”; the third tests whether it “thinks deeply and changes correctly.”

    2.2 Two-Round Prompt Strategy

    • Round one: requirements only, no credentials. Observe the model’s planning quality, directory structure design, and placeholder implementation when it lacks real calling ability.
    • Round two: add calling credentials. Observe whether the model actually issues requests, constructs boundary cases, and revises the implementation based on returned results.

    In practice the differences are stark. Some toolchains, after receiving credentials, validate only one basic Q&A path and declare completion. Others proactively construct scenarios such as extremely long context, malformed input, and concurrent requests, thereby exposing issues like timeouts, truncation, and missing error-code handling and going back to fix them. This is a difference in strategy rather than a simple matter of “capability level,” and the evaluation should record both behaviors separately.

    2.3 Prompt Skeleton (Reusable as Is)

    1. Role: Senior product manager + full-stack engineer
    2. Goal: Replicate a general-purpose conversational AI web application
    3. Inputs: Target site URL, capability documentation URL, available browsing and debugging tools
    4. Deliverables:
    5. 1) Product documentation + feature structure diagram (clear hierarchy)
    6. 2) Replica front end (features and visuals aligned)
    7. 3) Improved front end (autonomously added features with rationale for trade-offs)
    8. Constraints: Do not rely on prior memory or preset skills; execute directly; produce a plan before writing code

    The key is to define the role, define the deliverables, and define the constraints clearly, while not leaking any credentials in round one, so that the two rounds form a valid comparison.

    3. Typical Differences During Execution and Their Causes

    Observation point Conservative toolchain Exploratory toolchain
    Behavior after receiving credentials Gets the minimal path working and stops Proactively constructs boundary and exception cases
    Defect discovery Relies on human feedback Self-checks, finds issues, and fixes them
    Documentation quality Feature enumeration Includes state machines and exception-flow descriptions
    Delivery stability Fast but incomplete Slow but acceptable

    There are three causes. First, toolchains differ in their built-in verification habits. Second, context window and file retrieval strategies differ, affecting whether the toolchain can simultaneously hold the “requirements document + code + error logs.” Third, the prompt’s definition of “done” may not be strict enough. If the evaluator wants comparable results, they should unify the operating procedure and add explicit acceptance criteria to the prompt.

    4. A Runnable Implementation Skeleton

    A minimal usable chat front end typically consists of four parts: session management, streaming rendering, attachment upload, and voice input. Sample code:

    1. // Receive the stream and render incrementally to avoid blocking the main thread all at once
    2. async function streamChat(messages, onDelta) {
    3. const resp = await fetch('/api/chat', {
    4. method: 'POST',
    5. headers: { 'Content-Type': 'application/json' },
    6. body: JSON.stringify({ messages, stream: true })
    7. });
    8. const reader = resp.body.getReader();
    9. const decoder = new TextDecoder();
    10. while (true) {
    11. const { done, value } = await reader.read();
    12. if (done) break;
    13. onDelta(decoder.decode(value, { stream: true }));
    14. }
    15. }

    Engineering work must also cover: request cancellation and retry, mapping error codes to user-facing messages, truncation or chunking strategies for overly long input, local session persistence, and graceful degradation of capture and playback permissions in the voice path.

    5. Scoring Dimensions and Acceptance Checklist

    A five-dimension score is recommended, 1–5 points each:

    1. Feature coverage: whether core modules are missing.
    2. Visual and interaction consistency: layout, spacing, and state feedback.
    3. Code runnability: whether it starts locally with one command.
    4. Self-check depth: whether real defects are found and fixed.
    5. Improvement reasonableness: whether new features serve real scenarios rather than piling up.

    Example acceptance checklist:

    • Multi-turn context is preserved correctly and the session can be restored after refresh.
    • Streaming output can resume after interruption and can be canceled.
    • Clear messages appear when attachments exceed limits or use unsupported formats.
    • All external calls have timeout and fallback paths.
    • Features in the documentation map one-to-one to the code implementation.

    6. Deployment Recommendations on Baidu AI Cloud

    To move the replication result into production, it is recommended to build on a combination of general cloud capabilities: deploy front-end and back-end services on a container platform, store attachments in object storage, use a message queue to smooth peaks and decouple long-running tasks, and use logging services plus a monitoring and alerting system to track time to first token, failure rate, and timeout ratio. Baidu AI Cloud offers corresponding products in these general categories, and you can select based on actual scale, avoiding exposing the evaluation script directly as a production entry point.

    Three things should also be done well: centrally host credentials and rotate them regularly, enforce rate and quota control per tenant, and perform content safety checks on both input and output. These three points determine whether the application can move from “works for a demo” to “works long term.”

    7. Conclusion

    Replicating a mature chat application looks like front-end restoration on the surface, but in essence it is a combined test of three abilities: requirement decomposition, engineering implementation, and self-verification. A two-round prompt, a unified operating procedure, and explicit acceptance criteria are the prerequisites for comparable evaluation results; turning the result into an operable production system depends on the coordination of general infrastructure such as containers, storage, messaging, and logging and monitoring. With this methodology, teams can make side-by-side comparisons across any combination of models and toolchains and translate the conclusions directly into architecture decisions for their own applications.