Evaluating Open-Source LLMs for Code Generation: From Working Pages to Deliverable Projects

    This article evaluates how well open-source large language models handle real-world code generation, moving beyond simple syntax checks to requirement coverage, interaction fidelity, generation stability, and iteration cost. Based on an end-to-end test using a requirements document for login, list, and form pages, it shares reproducible evaluation methods, observed capability gaps across page types, root-cause analysis, and practical engineering recommendations for integrating these models into a controlled delivery workflow.

    1. Background: From Generating Code to Delivering a Project

    As open-source large language models move into production use, developers are shifting their focus from “can it produce a runnable snippet?” to “can it deliver a complete, maintainable project based on a requirements document?” This shift changes the evaluation criteria significantly. Syntax correctness used to be the main metric; now the key dimensions are requirement coverage, interaction fidelity, generation stability, and iteration cost.

    In a real front-end project, the author used a requirements document covering three page types—login, list, and form—to run an end-to-end generation test with an open-source LLM. The overall conclusion can be summarized in one sentence: the page skeletons are usable, but detail comprehension is insufficient; engineering usability is stronger than product-level polish.

    It is worth noting that such tests are heavily influenced by prompt quality, the runtime environment, and the queuing and rate-limiting policies of free tiers. The findings should therefore be treated as observations under specific conditions, not as an absolute verdict on model capability.

    2. Evaluation Method: Making Results Reproducible

    For an evaluation to be useful, variables must be fixed. At minimum, fix the following four:

    1. Fixed input: Use the same requirements document without adding clarifications midway.
    2. Fixed tech stack: Specify the framework, styling approach, and directory structure conventions.
    3. Fixed acceptance criteria: Write the acceptance checklist in advance to avoid “it looks close enough.”
    4. Fixed records: Log generation time, number of failed retries, and locations requiring manual fixes.

    A sample acceptance checklist can be written as structured data for item-by-item scoring:

    1. {
    2. "page": "list",
    3. "checks": [
    4. {"item": "Filter condition rendering", "pass": false},
    5. {"item": "Filter-triggered requests", "pass": false},
    6. {"item": "Pagination and empty state", "pass": true},
    7. {"item": "Fields consistent with the document", "pass": true}
    8. ]
    9. }

    With a checklist, evaluation shifts from subjective impressions to comparable data.

    3. Observed Results: A Capability Gradient Across Three Page Types

    1. Login Page: High Completion

    The login page includes common elements such as a carousel, form validation, and submission feedback. The generated result was functionally complete and close to “ready to ship after minor tweaks.” The reason is that login pages are highly standardized, well represented in training data, and structurally unambiguous.

    2. List Page: Comprehension Starts to Degrade

    The main issue with list pages was missing filter conditions. The document clearly specified the filter items and interaction logic, but the generated result kept only the page skeleton. Notably, this was not a one-off omission; the same problem appeared across multiple list pages, indicating a capability gap rather than random variance.

    The engineering explanation is that the complexity of a list page lies not in layout but in state management—filter conditions, pagination parameters, request timing, and URL synchronization must work together. Models tend to generate static structures that “look complete” and are insensitive to implicit state constraints.

    3. Form Page: Insufficient Field and Validation Fidelity

    The form page ran, but the field set, validation rules, and interdependencies deviated from the document. A form is essentially a constraint system: field relationships and validation order are strongly dependent. When the document describes these in natural language rather than structured definitions, the model tends to fill gaps in ways that are “reasonable but wrong.”

    4. Visual Style: Engineering Usability Over Product Polish

    The generated UI leaned toward an engineering aesthetic, better than typical wireframes but still short of the consistency of a mature design system. This suggests that visual consistency is better enforced through an existing design system than left to the model’s free interpretation.

    4. Root Causes: Depth of Understanding, Not Generation Speed

    Compared with comparable closed-source solutions, the gap is not mainly about “whether it can produce code” but about the depth of understanding of constraint relationships in the document: completeness of filters and fields, and fidelity in restoring field dependencies and validation order. Differences in generation time are more related to the runtime environment, concurrent queuing, and quota policies, and should not be treated directly as capability metrics.

    This can be abstracted into a simple model:

    1. Delivery quality ≈ Requirement structuring × Constraint explicitness × Manual verification intensity

    If any of the three approaches zero, overall quality drops quickly.

    5. Engineering Recommendations: Put the Model in a Controlled Workflow

    1. Structure requirements: Rewrite natural-language descriptions into field tables, state tables, and API contracts to reduce ambiguity.
    2. Make constraints explicit: Put the tech stack, directory structure, design system, and naming conventions into the prompt to reduce degrees of freedom.
    3. Layered collaboration: Let the model generate standardized pages, while developers implement complex state and core business logic.
    4. Automate acceptance: Use checklists and automated tests as gates, turning “looks right” into “passes tests.”
    5. Build reusable assets: Turn reusable templates, components, and validation rules into team assets to continuously reduce generation deviations.

    When elastic compute and engineering support are needed, general-purpose capabilities such as Baidu AI Cloud’s container platform, object storage, log service, and monitoring and alerting can host the generation and verification workflow, but specific choices should still be based on your own load-testing results.

    6. Implications for the Open-Source Ecosystem and AI Development

    The value of open-source models lies not in single benchmark scores but in being privately deployable, fine-tunable, and auditable. When open-source solutions approach closed-source performance on standardized tasks, enterprises gain the option of keeping data within their own boundaries and controlling costs. The remaining gap on complex comprehension tasks suggests that evaluation systems should shift from “leaderboard scores” to “task-level delivery rates.”

    For developers, the pragmatic approach is to treat open-source models as efficient executors while keeping requirement definition and quality gating in human hands. This is both the optimal choice under current capability boundaries and a reliable path for building team expertise.