Testing Open-Source LLMs for Frontend Code Generation: It Runs, but the Business Logic Is Missing
Large language models can now generate complete frontend projects from a requirements document. But how do they handle real business needs? We tested an open-source model with a spec covering a login page, a list page, and a complex form, and compared the results with those of a top closed-source model. This article breaks down what worked, what was lost, and how to run a reproducible evaluation of your own.
Testing Open-Source LLMs for Frontend Code Generation: It Runs, but the Business Logic Is Missing
Large language models can now generate a complete frontend project from a requirements document. But how well do they handle real business requirements? We ran a hands-on test using a spec that included a login page, a list page, and a form page, then compared the results with those of a top closed-source model.
1. Can the Pages Run Out of the Box?
The login page was the easiest part to pass. The document specified standard form inputs plus a carousel effect, and the model produced a page with a complete structure and essentially all the required components. It returned a full set of project files along with build and startup instructions, rather than scattered code snippets—evidence that the model can scaffold a project on its own.
That said, code that runs is not code that’s ready for production. Styles, routing, and data requests still need to be verified item by item. For basic pages, “usable with minor tweaks” is a fair assessment, but it shouldn’t be shipped as-is.
2. Why Did the Filtering Logic Go Missing?
Performance dropped noticeably on the product list page. The requirements document defined multiple filter conditions and the linkage rules between them. The generated page skeleton was correct—table, pagination, and a basic query entry were all in place—but the filter fields were never actually wired into the data query logic.
This wasn’t a one-off. The same omission appeared across multiple list pages. The takeaway: the model pays insufficient attention to key business rules buried in a long document. It failed to map each filtering rule onto state changes and API parameters. Human developers read a document line by line and cross-check each rule; the model tends to implement only the main structural skeleton.
3. Why Is Complex Form Validation So Hard to Reproduce?
Forms are where the details matter most. In this test, the generated form could submit normally overall, but on closer inspection there were deviations in field mapping, front-end validation, and interaction feedback. Some field dependencies weren’t implemented as specified, some validation rules were missing, and others were written too loosely.
The model handles simple CRUD forms well. Business forms with linked validation are different—for example, when one field is required only if another field has a certain value, or when two dates must follow a specific order. These rules depend on business context. The model tends to generate a generic form template and fill in the fields, so domain-specific constraints get lost along the way.
4. UI Quality vs. Engineering Usability: Which One to Prioritize?
In terms of visual results, the output was usable. It was more polished than a rough prototype sketched quickly by a typical developer, but still fell short of what a mature component library can deliver. Layouts were mostly reasonable, but visual hierarchy and detail refinement were weak, and there was no unified design language.
So these results are better suited for internal tools, admin prototypes, or project starting points. User-facing product pages still need a designer involved. In short: engineering usability beats visual completeness.
5. Open-Source vs. Top Closed-Source: Where’s the Gap?
The same requirements document had previously been given to a top closed-source model, making a direct comparison possible:
- Basic pages: Similar completion levels; both produced proper skeletons and basic components.
- List page filtering: The closed-source model understood the filter conditions and linkage logic much more completely; the open-source model showed clear omissions.
- Form validation and field mapping: The closed-source model reproduced dependencies, validation rules, and interaction feedback more accurately.
- Generation time: The closed-source model typically finished within a few minutes; the open-source model took noticeably longer in this test. The difference may relate to compute scheduling or model architecture, but we didn’t dig further into the cause.
The core gap lies in the depth of business requirement understanding and the precision of instruction following—not in the code writing itself.
6. How to Make This Kind of Evaluation Reproducible?
An evaluation is only useful if others can reproduce it. If you run your own tests, we recommend recording the following:
- Model name, version, and whether it’s open source
- Frontend framework, dependency versions, and runtime environment
- The complete prompts, including whether clarification was added across multiple turns
- A breakdown of requirements, with one acceptance item per business rule
- Scoring criteria—for example, whether the page runs, whether each filter works, and how many validation rules are covered
- Number of reviewers and scoring method, with dual independent scoring where possible
- Generation time and number of retries
With this documentation in place, comparisons between models actually mean something.
7. The Value and Risks of Open-Source Models
Open-source models lower the barrier to adoption. Companies can deploy them in their own environments and fine-tune them on business data. This gives smaller teams access to strong code generation capabilities while reducing dependence on a single vendor. Deployment options range from self-hosted inference services to third-party cloud or inference platforms, depending on data compliance requirements and budget.
Our test also surfaced some risks. Generated code needs a security review—especially around input validation, authentication logic, and dependency sources. Licenses for both the model and its dependencies should be checked to avoid incompatible terms. Prompts and configuration files may contain secrets or internal API endpoints; these should be stored via environment variables or a secrets management service, never hardcoded or written to logs.
8. Conclusion and Recommendations
Today’s open-source models can already scaffold basic frontend projects, but they still fall short on complex filtering, linked validation, and fine-grained fidelity to the spec. Teams can use them effectively by:
- Using them for basic pages and prototypes, then reviewing interactions and data flows page by page.
- Breaking business rules in the requirements into an acceptance checklist, with a verification method for each rule.
- Running security reviews and regression tests on generated code before merging it.
Model capabilities are evolving fast. Turning your evaluation into a reproducible process will help your team decide when a model is ready for adoption far better than any one-off conclusion.
