Replicating LLM Applications in Practice: A Workflow from Requirements to Delivery

    This article presents a practical methodology for replicating a full-featured conversational AI web application using a large language model. It covers how to design a controlled experiment with two prompt rounds, define deliverables such as a product feature document, a high-fidelity replica, and an optimized version, and verify results across visual fidelity, interaction, robustness, performance, and security. The key takeaway is that success depends less on the volume of generated code and more on traceable feature structures, solid responsive behavior and state consistency, and deep validation once real API access is available.

    1. Background: Why “Replicability” Tests Model Capability

    Recently, an open-source model community released a model matrix and publicly stated that developers could build a fully functional conversational application on top of its capabilities. This statement quickly drew attention, along with a practical question: once a team is granted permission to “replicate,” can it actually deliver a working replica?

    The service later introduced usage limits, such as daily conversation counts and maximum input length per request, which prompted jokes in the community that open source exists so users can experiment on their own. Beyond the joke, the situation offers a high-quality engineering exercise: using a real product as the reference, evaluate how a large model performs across the full chain of understanding requirements, recreating the interface, proactively optimizing, and integration testing.

    Unlike common tasks such as “generate a login page,” this type of task has three challenges:

    1. The reference is a dynamic product whose features keep evolving, so the model must build its understanding through observation rather than memory;
    2. Acceptance requires both pixel-level and interaction-level alignment, so any deviation is amplified;
    3. It requires real API calls, moving from a pure front-end demo to a usable application, which involves engineering details such as key management, streaming output, and error handling.

    This article does not evaluate any specific product. Instead, it abstracts this type of task into a practical methodology.

    2. Task Design: A Controlled Experiment with Two Prompt Rounds

    To make differences between models and execution frameworks comparable, the experiment uses unified inputs and a unified acceptance standard.

    2.1 Deliverables

    The task requires three outputs:

    • A product feature document and feature structure diagram: describing the target application’s modules and how they nest;
    • A high-fidelity replica page: matching the original product in both functionality and visuals;
    • An improved version: building on an understanding of the original product and incorporating common industry best practices.

    The three deliverables correspond to “comprehension,” “reconstruction,” and “creativity.” None can be missing.

    2.2 Two Prompt Rounds

    The first round provides only the requirements and access method, without an API key; the second round adds the key. The goal is to observe how the model behaves once it has real API access.

    The first-round prompt can be abstracted as:

    1. You are a senior product manager and front-end engineer.
    2. Goal: replicate a conversational AI web app.
    3. Reference: the target site URL (accessible in a logged-in state); the API documentation URL.
    4. You may use browser tools to browse the pages above.
    5. Deliver:
    6. 1) A product report: feature list + feature structure diagram;
    7. 2) A replica: UI and interactions identical to the original site;
    8. 3) An optimized version: incorporate industry best practices based on your judgment.
    9. Ignore existing memory and plugin configuration, and start immediately.

    The second round adds only one sentence: the API key is sk-***; complete the integration.

    2.3 Key Observations

    The most valuable differences appear in the second round:

    • Some execution strategies perform only minimal connectivity checks after receiving the key and declare completion once a request succeeds;
    • Others proactively construct edge cases, such as extremely long context, empty input, rapid consecutive sends, network interruption, and invalid keys, exposing defects and going back to fix them.

    This is not simply about which model is “smarter,” but a difference in validation depth across execution frameworks. In engineering practice, this factor often affects final usability more than first-screen fidelity.

    3. Stage One: Mapping Product Features and Structure

    High-quality replication starts with structured understanding. Ask the model to output a layered list rather than prose.

    A typical conversational application has the following feature structure:

    • Session layer: new session, session list, rename, delete, pin, grouping
    • Input layer: multiline input, auto height, attachment upload, quick commands, stop generation
    • Generation layer: streaming output, Markdown rendering, code highlighting and copy, tables and formulas
    • Context layer: history trimming, long-text summarization, context window management
    • Account and sharing layer: login state, share links, export, privacy toggle
    • Support layer: theme switching, keyboard shortcuts, feedback entry, error messages

    Use a tree or Mermaid for the structure diagram to make review easier:

    1. graph TD
    2. A[Conversational App] --> B[Session Management]
    3. A --> C[Input Area]
    4. A --> D[Message Rendering]
    5. A --> E[Context Management]
    6. A --> F[Sharing and Export]
    7. A --> G[Settings and Theme]

    Acceptance point: every feature in the document should have a corresponding implementation in the replica page; conversely, every clickable element on the page should trace back to a document entry. Bidirectional traceability separates genuine understanding from document fabrication.

    4. Stage Two: Engineering Essentials for High-Fidelity Reconstruction

    4.1 Build the Skeleton First, Then Add Details

    The recommended order is: layout grid → component library selection → state management → API layer → animations and details. Skipping the skeleton and focusing on pixels first often leads to full rework during responsive implementation.

    4.2 Responsive Design Is the Real Test of Fidelity

    Desktop and mobile differ not only in width but structurally in input box position, toolbar collapsing behavior, and scroll region ownership. A common pitfall is fixing the mobile input box to the bottom while adapting to the safe area:

    1. .composer {
    2. position: sticky;
    3. bottom: 0;
    4. padding-bottom: env(safe-area-inset-bottom);
    5. }

    4.3 Streaming Rendering and Markdown

    Streaming output must handle intermediate states such as “unclosed code blocks” and “partial tables,” or flickering and layout shifts will occur. In practice, fall back to plain text rendering when parsing fails, then apply highlighting once the content is complete.

    4.4 State Consistency

    Switching sessions, deleting the current session, and switching sessions during generation are the three most bug-prone areas. Define clearly whether requests are canceled, whether drafts are preserved, and whether scroll position resets.

    5. Stage Three: How to Optimize Without Losing Focus

    Optimization is not about piling on features, but about addressing real pain points the original product does not cover. Common directions include:

    • Interruptible and retryable: regenerate a single message, compare branches;
    • Context visualization: show users how much history is actually carried in the current turn;
    • Prompt template library: share common instructions across a team;
    • Observability: front-end instrumentation + logging service + monitoring alerts to locate slow requests and failure rates;
    • Cost control: client-side rate limiting and caching to avoid amplified costs from duplicate requests.

    The constraint is that any new feature must not break the component contracts shared with the replica version; otherwise, the two deliverables will quickly diverge.

    6. Stage Four: Integration and Acceptance Checklist

    With the key available, a minimal working implementation is:

    1. async function* chat(messages, signal) {
    2. const res = await fetch(BASE_URL, {
    3. method: 'POST',
    4. headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${KEY}` },
    5. body: JSON.stringify({ messages, stream: true }),
    6. signal,
    7. });
    8. if (!res.ok) throw new Error(`HTTP ${res.status}`);
    9. const reader = res.body.getReader();
    10. const decoder = new TextDecoder();
    11. while (true) {
    12. const { value, done } = await reader.read();
    13. if (done) break;
    14. yield decoder.decode(value, { stream: true });
    15. }
    16. }

    Note: the key must be kept on the server or in local environment variables and must never be included in front-end build artifacts.

    Recommended acceptance matrix:

    Dimension Check Items
    Visual Desktop/mobile layout, font size, spacing, dark mode
    Interaction Send, stop, retry, delete, share
    Robustness Empty input, extremely long text, invalid key, network loss, timeout
    Performance First-screen time, streaming first-token latency, scrolling smoothness in long sessions
    Security Key not exposed, share link permissions, log redaction

    One easily overlooked item is that “share links must be verified in another browser or an incognito window”: the original page often relies on login state, so opening it directly in the same browser can be mistaken for a broken feature.

    7. Conclusion

    When “replicating a conversational application” is used as an evaluation task, what truly separates results is not who generates more code, but three things: whether a traceable feature structure is established, whether responsive behavior and state consistency are solid, and whether deep validation is performed proactively once real API access is available.

    The takeaway for teams is clear: in a multi-model development workflow, write “validation depth” into acceptance criteria, and constrain output quality with unified prompts, unified deliverables, and a unified acceptance matrix. Tools will keep changing, but fundamentals such as requirement breakdown, API contracts, observability, and security boundaries remain the foundation of stable delivery.