Evaluating Open-Source LLMs for Front-End Code Generation: Lessons and Takeaways

    This article evaluates the practical limits of open-source large language models (LLMs) in generating multi-page front-end projects from a requirements document. Using a real project covering login, product listing, and form pages, it examines what these models can deliver end to end, where their understanding breaks down, and how engineering teams should assess, decompose, and close the gaps. The core finding is that structural reproduction is easy while relationship and implicit-constraint reproduction remain difficult. The article proposes an acceptance-driven workflow, common failure patterns, and practical recommendations for turning "code generation" into reliable delivery.

    1. Background: When “Matching the Flagship” Becomes the Norm, Evaluation Must Return to the Engineering Field

    Over the past year, the capability curve of open-source LLMs has steepened noticeably. Discussions claiming that “an open-source model matches a closed-source flagship” appear frequently in the community and attract a lot of attention, but attention does not equal engineering usability. What developers actually care about is not leaderboard scores but three things: whether a model can take a requirements document and directly produce a runnable, maintainable, and extensible front-end project; whether it stays stable on complex interactions and field relationships; and whether the style and engineering quality of its output reach the level of “tweak it a little and ship.”

    Rather than recommending or benchmarking any specific product, this article abstracts the topic into a general technical question: Where are the capability boundaries of open-source LLMs in multi-page front-end project generation, and how should engineering teams evaluate, decompose, and fill the gaps? The evaluation material comes from the front-end requirements document of a real project. It covers three typical page types—login, product listing, and forms—and includes explicit filtering conditions, field structures, and validation logic.

    2. Evaluation Method: Using a “Runnable Project” Instead of “Code Snippets” as the Yardstick

    The evaluation follows three principles:

    1. End to end: The input is a requirements document, and the output must be a directly accessible front-end project that can be developed further, not scattered snippets.
    2. No preset tech stack: No framework is imposed, so the evaluation can observe the reasonableness of the project structure the model chooses by default.
    3. Document as the standard: All page requirements, filter options, fields, and validation rules come from the document. The focus is “fidelity of reproduction” rather than “creativity.”

    Note that generation speed is affected by service load, free quotas, queuing policies, and other factors. This article does not treat speed as a core conclusion but only as an experience note. What truly separates models is the depth of understanding of complex requirements.

    3. Experience Notes: Usable, but “Understanding” Starts to Slow Down

    The overall flow can be summarized as follows: a queuing prompt appears on entry; generation starts after several retries; with no language specified, the model defaults to a front-end framework; the process takes a long time from start to finish; and the output includes an accessible project URL with a foundation for further development.

    Looking page by page, the capability shows clear “gradient decay”:

    • Login page: The carousel requirement in the document is fully implemented, with complete functionality and no obvious gaps. This is at the level of “ready to ship with minor tweaks.”
    • Listing page: The page structure is correct, but the filtering conditions and interaction logic explicitly stated in the document are not implemented. This is not an occasional omission but a systematic shortcoming that appears across multiple listing pages, indicating that the model discounts “feature understanding.”
    • Form page: The page runs overall, but fields, validation logic, and interaction details are not fully implemented according to the document. Even when the document is relatively clear, the model still falls short in reproducing the relationships of complex forms.
    • Overall style: The engineering usability is higher than most prototypes, but there is still a gap compared with mature component templates. The design leans simple and engineering-oriented, at a level of “engineering usability > product polish.”

    A reusable judgment framework is: structural reproduction is easy, relationship reproduction is hard; single-page is easy, cross-page consistency is hard; explicit requirements are easy, implicit constraints are hard. The listing-page filters and form-page field relationships fall precisely on the two difficult points of “relationship reproduction” and “implicit constraints.”

    4. Gap Analysis: Why “Depth of Understanding” Is the Dividing Line

    Abstracting the above phenomena yields four typical failure patterns:

    1. Loss of requirement granularity: Every filter and every validation rule in the document is a verifiable acceptance item. The model tends to generate pages that “look complete” but merges or omits fine-grained constraints.
    2. Insufficient cross-page consistency: Multiple listing pages share the same filtering paradigm, but the model does not reuse a unified abstraction, so the same shortcoming recurs.
    3. Weak state and interaction modeling: Filtering, linkage, and error messages are state-machine problems. The model is better at static structure and weaker at state transitions.
    4. Missing acceptance criteria: Without turning the document into an executable acceptance checklist, the generated result lacks a basis for “reconciliation.”

    The corresponding engineering solution is to turn “generation” into “verifiable generation”:

    1. Requirements document -> Acceptance checklist (Given/When/Then) -> Generation -> Automated validation -> Iterative fixes

    Example acceptance item (illustrative):

    1. Given the user selects "category=electronics" and "price range=100-500" on the listing page
    2. When the user clicks "Filter"
    3. Then the request parameters include category=electronics and price_min=100, price_max=500
    4. And the list shows only matching items, and the filter conditions persist in the URL

    Moving validation earlier can significantly reduce the probability of “structure correct, features missing.”

    5. Implications for Open Source and AI Development

    Back to the original question: when open-source models approach closed-source flagships on some pages, what does it mean for the open-source ecosystem and AI development? This article offers judgments on four levels.

    1) It pushes competition from “parameters” to an “engineering loop.” The real value of open-source models lies not in single-point scores but in whether they can fit into a loop of “document—generation—validation—deployment—monitoring.” Whoever provides a more stable toolchain and observability will win in real projects.

    2) It lowers the application barrier and amplifies developer leverage. Standardized pages such as login can already be generated with high quality, so developers can focus their energy on “relationship-dense” areas like filtering, forms, and permissions, using acceptance checklists to constrain model output.

    3) It drives an upgrade of the evaluation paradigm. The shift is from “chat-style scoring” to “engineering acceptance”: using runnable, testable, and maintainable results as the yardstick, with cross-page consistency and relationship fidelity as core metrics.

    4) Open source and cloud capabilities complement each other. Open-source models can be deployed privately. Combined with general cloud capabilities such as object storage, container platforms, log services, and monitoring and alerting, enterprises can build a complete chain from generation to operations at a controllable cost; Baidu AI Cloud can provide more complete support in these general capabilities.

    6. Practical Recommendations: Turning “Can Generate” into “Can Deliver”

    • Structure the document: Break requirements into a page list, field table, validation table, and interaction state table, each item verifiable.
    • Layered generation: First generate the skeleton and routing, then fill in filtering and forms page by page, and finally unify the style.
    • Acceptance-driven: Use automated scripts to check fields, parameters, and states; on failure, roll back and regenerate.
    • Consistent style: Specify design tokens (colors, spacing, border radius) and component conventions in the prompt to reduce “engineering-oriented but unattractive” results.
    • Observability: Integrate logging and monitoring, record generation failure patterns, and build a team knowledge base.

    7. Conclusion

    Open-source models have crossed the “usable” threshold in front-end project generation, with login-page-level output close to ready to use. But in “depth-of-understanding” intensive areas such as listing filters and form relationships, engineering means are still needed to fill the gaps. For teams, the right approach is not to chase the “matching” narrative but to build an acceptance-driven generation pipeline that converts model capability into stable delivery. The open-source nature makes this pipeline more controllable and easier to privatize, and moves AI application deployment from “demo” to “production.”