Replicating LLM Applications: A Complete Methodology from Requirements to Delivery

    This article presents a practical methodology for replicating a mature conversational web application using different LLMs and agent frameworks. It covers how to design a controlled evaluation with fixed variables, a two-round prompt injection strategy, a six-dimension scoring model, and key engineering practices for streaming output, long-context handling, and voice pipelines. It also outlines common failure modes and explains why self-driven testing depth matters more than single-turn generation speed when selecting models and frameworks.

    1. Background: Why “Replicability” Is a Test of Model Capability

    A notable trend has recently emerged in the industry: a model service provider has opened up its API capabilities while publicly stating that developers can use these APIs to build fully functional conversational applications on their own. From an engineering perspective, this is not “generosity” but a deliberate technical decision. Exposing capabilities such as conversation, retrieval, file parsing, speech transcription, and speech synthesis as APIs essentially decouples the “product shell” from the “model capabilities.” The shell can be replaced; the capabilities are the real moat.

    The accompanying rate limits also make sense. Opening up capabilities targets the developer ecosystem and real business scenarios, whereas an interactive product must handle public trials and the pressure of compute scheduling. The two have fundamentally different resource models. Rather than interpreting this as “open source so users can go play on their own,” it is better understood as a clear layering: the platform provides atomic capabilities, and developers handle scenario-specific packaging.

    This leads to a highly valuable engineering question: If you want to replicate a mature conversational web application, where do different combinations of models and agent frameworks differ in performance, and how can that difference be quantified? This article strips away specific product attributes and focuses only on the general methodology.

    2. Test Design: Turning Subjective Impressions into Comparable Engineering Metrics

    A meaningful replication evaluation must first fix the “variables” and “invariants.”

    Invariants (identical for all tested objects):

    • The same requirements prompt and the same turn-by-turn pacing;
    • The same browsing and debugging environment, with the same login state;
    • The same deliverables list and acceptance criteria;
    • The same method of injecting keys/credentials for each turn.

    Variables: the underlying model capability tier, context length strategy, agent orchestration framework (harness), and whether collaborative multi-agent teamwork is enabled.

    The deliverables are fixed as three items:

    1. A product functional specification document plus a functional structure diagram;
    2. A high-fidelity interface that aligns with the reference in both structure and visuals;
    3. An improved version based on the prototype (optimizing experience and information architecture).

    These three items cover three different capabilities: information extraction and structured writing, pixel-level frontend replication, and product judgment. Testing only the first would overestimate models that are good at writing documents; testing only the second would overestimate models that are good at copying styles.

    3. Prompt Engineering: The Design Intent of Two-Round Injection

    A two-round prompt approach is used to simulate a real development rhythm: first the requirements, then the resources.

    Round 1 (requirements and role):

    1. You are a senior product manager and frontend engineer. Goal: replicate a general-purpose conversational web application.
    2. Reference: a publicly available conversational product (already logged in, accessible via browser tools).
    3. Available materials: the product's open API documentation (conversation, file input, speech transcription, speech synthesis, etc.).
    4. Deliverables:
    5. 1) A product specification document with a feature list and functional structure diagram;
    6. 2) An interface highly consistent with the reference in structure and visuals;
    7. 3) An improved version based on your judgment, with reasonable features supplemented by public research.
    8. Constraints: do not rely on any preset memory, skills, or external orchestration; execute directly.

    Round 2 (resource injection): only access credentials are provided, without repeating the requirements.

    The value of this design lies in observing behavioral differences once resources are in place. Some implementations perform a single minimal connectivity check and then declare completion; others proactively construct boundary cases and test long text, extremely long contexts, concurrency, and exception branches, thereby exposing defects and going back to fix them. The former delivers quickly but is fragile; the latter delivers more slowly but is trustworthy. This difference is related to model capability and is also strongly tied to the orchestration framework’s default strategy—making it the most important signal to watch during selection.

    Dimension Focus How to Judge
    Documentation quality Completeness of the feature list, correctness of diagram hierarchy Item-by-item comparison against real functionality
    Fidelity Layout, spacing, responsive breakpoints, control sizing Screenshot comparison across multiple resolutions
    Functional completeness Session management, streaming output, attachment parsing, voice pipeline End-to-end test case pass rate
    Self-driven depth Whether it proactively tests and fixes defects Commit history and number of closed defect loops
    Improvement reasonableness Whether new features solve real pain points Requirement-to-solution correspondence
    Stability Whether it crashes under long sessions and abnormal inputs Stress and exception test cases

    Among these, “self-driven depth” is the most easily overlooked, yet it best predicts delivery quality in real projects.

    5. Key Engineering Practices and Sample Implementation

    Streaming output is central to the experience and must handle incremental concatenation and interruption:

    1. async function streamChat(payload, onDelta, signal) {
    2. const resp = await fetch('/api/chat/completions', {
    3. method: 'POST',
    4. headers: { 'Content-Type': 'application/json' },
    5. body: JSON.stringify({ ...payload, stream: true }),
    6. signal,
    7. });
    8. const reader = resp.body.getReader();
    9. const decoder = new TextDecoder();
    10. let buffer = '';
    11. while (true) {
    12. const { value, done } = await reader.read();
    13. if (done) break;
    14. buffer += decoder.decode(value, { stream: true });
    15. const lines = buffer.split('\n');
    16. buffer = lines.pop() ?? '';
    17. for (const line of lines) {
    18. if (!line.startsWith('data:')) continue;
    19. const data = line.slice(5).trim();
    20. if (data === '[DONE]') return;
    21. onDelta(JSON.parse(data).delta ?? '');
    22. }
    23. }
    24. }

    Long context and attachment parsing should be layered: first perform type detection and truncation strategy, then apply retrieval augmentation, avoiding stuffing extremely long content into the context all at once, which would cause latency and cost to spiral out of control.

    The voice pipeline should decouple transcription and synthesis into independent services, use a message queue to smooth out peaks, store audio files in object storage, and send logs and metrics to logging and monitoring/alerting systems—making it easier to pinpoint first-token latency and failure rates.

    6. Common Failure Modes

    • Replicating only the visuals while ignoring state management, so sessions are lost on refresh;
    • Missing mobile breakpoints, with incorrect handling of input box position and keyboard occlusion;
    • Share/export flows that depend on same-origin sessions and break when switching browsers—such issues must be explicitly listed in the acceptance checklist;
    • Improved versions that pile on features, making the information architecture worse instead of better.

    7. Conclusion

    Replicating a conversational application is essentially a full-chain assessment of “requirement understanding—structured output—engineering implementation—self-verification.” When selecting models and frameworks, you should not look only at single-turn generation speed; instead, incorporate self-driven testing depth, replication precision, and documentation completeness into the same scorecard. For teams that want to build intelligent conversational applications quickly, building an observable and scalable engineering foundation with the models and container platforms, object storage, logging services, and monitoring/alerting capabilities offered by Baidu AI Cloud delivers more long-term value than chasing a single model’s benchmark score.