Open Source LLMs: A Practical Guide to Replicating AI Products with Prompts

    This article explores a practical methodology for evaluating open source large language models (LLMs) by replicating the UI and core features of open source AI products. It covers task design, prompt decomposition, evaluation dimensions, multi-model comparison methods, and engineering best practices to help developers objectively assess which model best fits their engineering scenarios.

    Open Source LLMs: A Practical Guide to Replicating AI Products with Prompts

    1. Background and Problem Definition

    The open source large language model (LLM) community has recently released complete model families—base models, chat models, reasoning models, and multimodal models across different parameter scales and capabilities, forming a comprehensive model matrix. For enterprise developers, the real concern is not how many models are released, but: What quality of code and UI can these models output in real engineering tasks?

    A direct way to test this is to ask the model to replicate the interactive interface and core features of an open source AI product. The comprehensive value of such a task lies in:

    • Requirement Understanding: The model needs to restore product intent from natural language descriptions.
    • Code Generation: Involves multi-layer capabilities like frontend layout, state management, and API calls.
    • Detail Restoration: Micro but crucial quality signals like input box position, sizing, and mobile adaptation.
    • Reporting and Self-Check: High-quality outputs are often accompanied by clear usage instructions and acceptance prompts.

    This article abstracts this practice into a reusable methodology, providing an evaluation framework and engineering recommendations.

    2. Task Design: From “Replication” to Verifiable Specifications

    2.1 Clarify the Replication Target

    Do not just tell the model “help me replicate a certain product.” You should first produce a structured specification yourself, for example:

    1. target: Conversational AI Product Frontend
    2. pages:
    3. - name: Main Chat Page
    4. components:
    5. - Sidebar (conversation list, new conversation)
    6. - Message Area (user/assistant bubbles, Markdown rendering)
    7. - Input Area (multi-line input box, send button, word count prompt)
    8. constraints:
    9. - Responsive: Mobile input box fixed at the bottom, width 100%
    10. - Compatibility: Latest two versions of mainstream browsers
    11. acceptance:
    12. - Visual fidelity: Consistent with reference screenshots
    13. - Functionality: Streaming output, conversation switching, history loading

    2.2 Decompose Prompts

    Breaking a large, all-encompassing replication into phased tasks can significantly improve stability:

    1. Layout Skeleton: Generate page structure and grid first.
    2. Component Details: Supplement styles and interactions for the input area, message bubbles, and sidebar.
    3. State and Data: Connect local mock data or real APIs.
    4. Adaptation and Polish: Handle mobile, dark mode, loading states, and error states.

    Each phase’s prompt should include: objective, constraints, acceptance criteria, and output format (single file/multi-file, tech stack constraints).

    3. Evaluation Dimensions: How to Judge “Who Replicates Best”

    3.1 Visual and Interaction Fidelity

    • Are layout proportions, white space, and font hierarchy close to the reference?
    • At mobile breakpoints, is the input box fixed at the bottom and sized correctly?
    • Interaction details: Enter to send, Shift+Enter for line break, button disabled states, etc.

    Empirically, the best comprehensive outputs often match the reference exactly even down to the position and size of the mobile input box—these details are signals of whether the model truly “understands” interface semantics, rather than just mimicking screenshot pixels.

    3.2 Functional Completeness

    Capability Checkpoints
    Conversation Management Create/switch/delete conversations, state persistence
    Message Rendering Markdown, code highlighting, tables, formulas
    Streaming Output Typewriter effect, interruption, error recovery
    Context History loading, length truncation strategy

    3.3 Engineering Quality

    • Is the code modular, maintainable, and type-defined?
    • Are loading and exception paths handled?
    • Are running instructions attached?

    3.4 Reporting and Self-Check Capability

    A noteworthy phenomenon: the best-performing models actively note precautions in their instructions upon delivery, such as “the share link needs to be verified in another environment/browser.” This indicates that the model not only generates code but also has the awareness to self-check the usage context of the deliverable. The clarity and risk prompts of the delivery report should be included as bonus items in the evaluation.

    4. Practical Methods for Multi-Model Comparison

    1. Unified Input: The same specification and prompts to avoid deviations caused by wording differences.
    2. Isolated Execution: Each output runs in an independent environment to prevent dependency conflicts.
    3. Double-Blind Evaluation + Checklist Scoring: Score across four dimensions: visual, functional, code quality, and report.
    4. Record Failure Modes: Form a team knowledge base for issues like layout collapse, mobile input boxes blocked by keyboards, and streaming rendering flicker.

    Example scorecard:

    1. Dimension Weight Score (1-5)
    2. Visual Fidelity 30% ___
    3. Functionality 30% ___
    4. Code Quality 20% ___
    5. Delivery Report 20% ___

    5. Engineering Implementation Recommendations

    5.1 Build a Prompt Asset Library

    Incorporate verified specification templates, phased prompts, and acceptance checklists into version control as team reusable assets. This allows for low-cost, comparable benchmark evaluations whenever a new model is released.

    5.2 Automated Acceptance

    Automate as much as possible for structurally checkable parts:

    • Use end-to-end test scripts to assert the existence and position of key elements (e.g., whether the input box is at the bottom of the viewport).
    • Use screenshot comparison tools to quantify visual differences.
    • Use build pipelines to verify that code compiles and runs.

    Example (pseudo-code):

    1. await page.setViewport({ width: 390, height: 844 }); // Mobile
    2. const box = await page.locator('.chat-input').boundingBox();
    3. assert(box.y + box.height <= viewport.height); // Fixed at bottom

    5.3 Human Judgment Remains Irreplaceable

    Automated metrics can capture “whether it is implemented,” but “does it look like the original product” and “is the interaction smooth” still require manual review. A tiered process of “automated initial screening + manual final review” is recommended.

    6. Common Pitfalls and Countermeasures

    • Prompts too vague: Models take liberties leading to low fidelity → Constrain with structured specs and acceptance criteria.
    • Generating all code at once: Long outputs are prone to truncation and style drift → Decompose into phases.
    • Ignoring mobile: Desktop effects mask adaptation issues → Explicitly require responsive design and verify separately.
    • Overlooking runtime environment differences: Generated artifacts may perform differently in shared/preview links due to browser or sandbox restrictions → Require the model to list environment requirements and acceptance notes in the delivery instructions.
    • Looking at code but not behavior: Code looks good but throws runtime errors → Always judge by runnable artifacts.

    7. Conclusion

    Using “replicating an open source AI product” as a comprehensive benchmark can simultaneously test a model’s code generation, interface understanding, detail control, and delivery awareness. Practice shows that truly excellent models don’t just pile up features; they accurately restore details like the position and size of the input box and proactively provide acceptance prompts. For enterprise teams, solidifying this methodology into a prompt asset library and automated acceptance pipeline enables a fast, objective answer to the question “which model is best for our engineering scenarios” amidst the continuous wave of open source model updates.