Code Generation with Open-Source LLMs: A Hands-On Evaluation from Requirement Understanding to Engineering Delivery

    This article presents a practical evaluation of an open-source LLM’s code generation capabilities using a realistic front-end project. It examines how well the model handles login, product-list, and order-form scenarios, compares its results with a leading closed-source model, identifies gaps in state management, conditional logic, validation, and data flow, and offers actionable guidance for developers on where open-source code generation models are ready for production use and where human oversight remains essential.

    Introduction: How Far Has Code Generation with Open-Source LLMs Progressed?

    Over the past year, the progress of large language models in code generation has been hard to miss. From early autocomplete for a single function to independently producing a complete front-end page or even a small application, AI-assisted programming has gradually moved from a toy to a practical tool. Recently, a Chinese open-source model entered the public spotlight with claims of flagship-level performance, and the industry widely views it as an important attempt by the open-source camp to compete with leading closed-source commercial models. However, there is often a gap between paper specifications and real-world performance: a high score on a standard benchmark does not mean the model will perform equally well in complex engineering environments.

    To answer the core question of how much real development work open-source models can actually handle, we designed a complete validation experiment. We selected a real front-end project containing typical modules such as login authentication, product-list filtering, and complex form submission. The model was used throughout the process to convert requirements into code, and we recorded its actual performance in task understanding, code generation, and detail restoration.

    Test Design and Methodology: Recreating a Real Development Scenario

    Sample Selection Criteria

    We deliberately avoided entry-level tasks such as “build a calculator” or “implement a to-do list” and instead chose a medium-sized front-end application closer to enterprise development scenarios. The application contained three typical pages:

    • Login page: required a carousel, form validation, responsive layout, and other common features.
    • Product list page: included multi-condition filtering, sorting, pagination, status labels, and other interaction logic.
    • Order form page: involved multiple field types, linked validation, dynamic row addition and removal, and other complex scenarios.

    API and Environment Configuration

    The test was driven by a natural-language requirements document. The developer wrote a complete product requirements document, and the model generated runnable code directly from it. For the front-end technology stack, we chose a component-library approach widely used by the community, without restricting a specific framework version, allowing the model to make its own choices. During the entire generation process, no human intervention or correction was applied, so that we could examine the model’s one-shot pass rate and understanding completeness.

    Scenario Results and Issue Analysis

    Login Page: Basic Capability Has Reached the Engineering-Usable Line

    Positive Results: Structured Output Is Satisfactory

    The login page output overall exceeded expectations. The model not only accurately implemented the carousel component described in the requirements document but also reasonably used a responsive grid system to adapt to different screen sizes. For the form, basic required-field validation, mobile-number format validation, password-strength prompts, and other logic were implemented. Overall page completion was above 85%, and the visual effect was unremarkable but sufficient.

    Hidden Concern: Weak Error-Handling Logic

    However, during code review we found that the model’s error handling for form submission APIs was relatively rough. It implemented only basic success and failure prompts and lacked exception branches that enterprise applications must consider, such as network timeouts, HTTP 500 errors, and token-expiry refresh. Interaction details such as border highlighting when an input gains focus and smooth animations for error prompts were also not implemented.

    This result is not surprising. In open-source model training data, the proportion of high-quality enterprise engineering code is relatively limited, especially when it comes to boundary-condition handling in business flows. The model output looks more like coursework than production code.

    Product List Page: Complex Logic Tests Comprehension

    If the login page was only an appetizer, the product list page is where the gap really begins to show. In the requirements document, we explicitly described three core interaction rules:

    1. Price-range filtering should support dual-end input for minimum and maximum values, and the two input boxes should perform linked validation.
    2. Category tags should be dynamic data, fetched from a back-end API with the first item selected by default.
    3. List data should be re-requested after filter conditions change, while maintaining the current page number.

    Result: Correct Structure but Degraded Functionality

    The list page generated by the model was visually complete. The sidebar filter area, top sorting area, and content-card area were laid out reasonably. But after actual execution, the filter items had no click events bound at all, meaning users could not trigger filtering through interaction. Further inspection showed that the data-request logic for dynamic tags was missing, and the page directly rendered static data. The detail of resetting the page number after filtering was completely ignored.

    This phenomenon of “correct page skeleton, missing functional logic” reveals a core weakness of current open-source models: insufficient deep understanding of state management and data flow. The model can imitate UI structure, but it cannot correctly associate page elements with the corresponding data operations, resulting in an awkward situation where it can draw the skin but not the bones.

    Form Page: Poor Restoration of Field Relationships

    The problems exposed by the form page are more fundamental. In our requirements, the order form contained a core business rule: “When the order type is set to ‘Enterprise Procurement,’ the ‘VAT Special Invoice Information’ section must be displayed, and the ‘Taxpayer Identification Number’ field in that section must be required. When ‘Personal Purchase’ is selected, that section must be hidden and not validated.”

    Test Conclusion: Conditional Linkage and Validation Logic Largely Missing

    The form page produced by the model rendered all fields in a flat layout. The enterprise invoice section was directly exposed on the interface for individual users. At the same time, the “Taxpayer Identification Number” field had no required indicator, and no field-cascade rules were implemented. Similarly, a dynamic rule in the form for “automatically calculating shipping based on weight” was ignored. The final output was a static form without functional depth.

    This case fully demonstrates that current open-source models are seriously lacking when handling complex field dependencies and business state transitions. Such logic usually requires developers to perform multiple rounds of reasoning to fully restore it from textual requirements, and the model clearly does not have this deep conversion capability from language to flowchart to code.

    Side-by-Side Comparison: The Real Gap Between Open-Source and Leading Models

    Task Completion Matrix

    To obtain a more intuitive sense of the difference, we submitted the same requirements document to an industry-recognized leading closed-source product and compared the results with those of the open-source model tested here. The results were as follows:

    Task Module Open-Source Model Leading Closed-Source Model Difference Analysis
    Login page 85 90 Basic functions are usable in both, but the closed-source solution handles animations and boundary cases more maturely.
    List page 55 85 The closed-source solution correctly implemented all filter interactions and data-request logic.
    Form page 40 80 The closed-source solution fully implemented field linkage and conditional validation rules.

    Core Divide: Differences in Depth of Task Understanding

    A clear conclusion can be drawn from the comparison: the dividing line is not code generation speed or code format, but the depth of understanding of natural-language requirements. Open-source models remain at “word-level understanding”: they can recognize explicit nouns such as “list” and “form” and generate the corresponding HTML skeleton. Leading closed-source models are closer to “intent-level understanding”: they can infer implicit requirements from context, such as “this list should have filtering functionality,” and proactively complete the full loop including data association and API requests.

    Performance and Environmental Factors

    In terms of running speed and token consumption, the open-source model’s inference latency under the same hardware conditions was about 3–5 times that of the leading closed-source solution. At the same time, because open-source models suffer from information decay in their context attention mechanisms, once the requirements document exceeds a certain length, the “forgetting rate” in generated code rises significantly. This is also a major technical reason for the missing functionality on the list page.

    Suitable Use Cases for Open-Source Models

    Based on this test, we believe that current code-generation open-source models are already qualified to enter production environments in the following scenarios:

    • Prototype building and demo creation: quickly implementing visually complete and interactive page skeletons for internal review or requirement confirmation.
    • Basic CRUD code generation: for create, read, update, and delete pages with settled back-end APIs and simple, direct fields, the model can provide an effective scaffold.
    • Code-snippet assistance and documentation generation: generating regular expressions, complex SQL, common utility functions, and other fine-grained code snippets.

    High-Risk Scenarios Requiring Human Fallback

    In the following scenarios, developers are strongly advised to maintain a “human-led, AI-assisted validation” model in their existing workflows rather than fully delegating to the model:

    • Functional pages involving financial accounts, user privacy, and other strong compliance requirements.
    • Complex business flows such as multi-role permissions and state-machine-driven processes.
    • Front-end performance optimization and timeout-retry mechanism design under high-concurrency requests.

    Future Iteration Directions

    From an industry-trend perspective, the next stage of code-generation models is evolving toward “multimodal requirement input”: not only supporting textual PRDs but also combining architecture diagrams, flowcharts, and even UI sketches for joint reasoning. At the same time, by introducing “compiler feedback signals” for reinforcement learning, models will gradually gain the ability to “self-correct after running,” which is a key path to solving the current problem of “correct structure but missing logic.” For the open-source community, the real dividing line is not parameter scale but how to build high-quality Chinese engineering datasets with strong logical closure.

    Actionable Recommendations for Developers

    1. The granularity of the requirements document directly determines output quality: breaking large blocks of natural language into structured, numbered feature-point lists can effectively improve the model’s hit rate on implicit logic. For example, refine “support filtering” into “after the filter button is clicked, obtain the selected condition values, update request parameters, call the API, and redraw the table using the returned values.”

    2. Adopt a layered validation strategy: after generating code, first perform a static review to check whether events are bound and whether APIs are called; then perform dynamic testing by clicking interactive controls to verify functional flow; finally perform exception-path testing for offline, empty-value, and timeout scenarios.

    3. Make good use of the model’s second-round correction capability: although the current model’s first-round output is not ideal, if the differences are clearly pointed out on the incorrect example, the quality of the second-round correction improves significantly. This “human review plus AI revision” collaboration model is currently the most cost-effective approach.

    4. Build an internal prompt asset library: for high-frequency scenarios such as list pages, form pages, and login pages, accumulate standard reverse-prompt templates and inject business rules in a strictly structured format to effectively avoid logic deviations caused by the model’s free interpretation.

    Conclusion

    Technological evolution often alternates between capability overflow and engineering adaptation. The weakness open-source models show today in complex logic is precisely proof that they are already competent at simple tasks. For the developer community, rather than indulging in the grand narrative that AI will replace programmers, it is more practical to establish a rational horizon for what kinds of tasks are suitable to hand to AI and what kinds of judgment must remain human. The advantage of the open-source ecosystem lies in iteration speed and community scale. As long as the data loop and evaluation system keep pace, the capability ceiling of code-generation models will continue to be raised. Every rigorous test and detailed feedback we provide today is, in fact, participating in defining the underlying logic of the next programming paradigm.