Engineering Open-Source LLM Agents: From Code Generation to Deliverable Software

    This article explains how to move open-source LLM agents from benchmark scores to production-ready delivery. It covers reading evaluation results correctly, turning vague requirements into executable specifications, reproducing frontend visual effects, handling state and concurrency in the backend, building a controlled delivery pipeline, and managing cost and risk. Readers will find practical acceptance criteria, code examples, and a checklist for stable, verifiable output.

    1. From Answering Questions to Shipping Products

    Recent progress in open-source large models has shifted the discussion from “is the answer correct?” to “can it deliver a complete product?” The recurring keyword in the source material is not a score but “it runs”: a commercial spaceflight website with virtual cabin seat selection and flight booking, a deep-sea research institute site, and a perfume brand showcase page were all produced within a single task, complete with visual systems and interactive logic.

    The engineering takeaway is clear: the unit of value for an agent is not tokens but an acceptance-ready deliverable. To judge whether an AI coding tool is usable, look at whether it can close the loop: understand requirements, generate code, run and verify, and fix errors.

    2. How to Read Benchmark Scores

    Public leaderboards (such as high-difficulty general knowledge tests, software engineering bug-fixing benchmarks, and terminal command operation benchmarks) are often used for comparison, but three caveats matter in practice:

    1. Benchmarks are not equivalent to real scenarios. Fix-oriented benchmarks measure locating and patching defects in an existing repository; building a site from scratch tests architecture choices and visual design. The two skill sets only partially overlap.
    2. Scores are an upper-bound reference, not a delivery guarantee. Context length, dependency complexity, and private conventions in real projects all reduce effective performance.
    3. Build your own evaluation set. Turning your team’s historical requirements into 20–50 automatically verifiable tasks is more useful than tracking external rankings.

    An example internal evaluation record:

    1. {
    2. "task_id": "site_booking_001",
    3. "acceptance": ["build_pass", "e2e_pass", "a11y_score>=0.9"],
    4. "attempts": 3,
    5. "human_minutes": 12
    6. }

    3. Turning Vague Requirements into Executable Specifications

    Descriptions like “premium feel” and “extreme aesthetics” in the source cases were implementable because they were translated into verifiable constraints. A recommended requirement template has five sections:

    • Goal and audience: brand positioning, target devices;
    • Visual tone: color range, font families, motion pacing;
    • Information architecture: hero section, narrative sections, detail page hierarchy;
    • Functional contract: inputs, outputs, boundary conditions;
    • Acceptance criteria: checks that can run automatically.

    For example, “spacecraft seat selection” written as a contract:

    1. Input: flight number, date, passenger count
    2. Constraints: capacity 6 per flight; selected seats cannot be reused; lock when sold out
    3. Output: order ID + persisted record
    4. Acceptance: no overselling under 20 concurrent requests

    4. Reproducing Frontend Expressiveness Reliably

    The “cinematic feel” that recurs in the cases is a decomposable technical combination, not something mystical:

    • Full-screen dynamic background: video or sequence frames as the base layer, with a static image fallback via prefers-reduced-motion;
    • Scroll-driven narrative: timeline anchors (such as T-60:00 to T+92:00) trigger section transitions, and key data uses monospace fonts to reinforce an instrument-panel feel;
    • Vector interactive graphics: the seat map is drawn in SVG, with state exposed to accessibility tools and test scripts through aria-selected and data-state;
    • Light and texture: caustics, gradients, and highlights are implemented with CSS gradients and blend modes, avoiding uncontrolled use of large images.
    1. .seat[aria-selected="true"] { fill: #ff7a1a; }
    2. @media (prefers-reduced-motion: reduce) {
    3. .bg-video { display: none; }
    4. }

    5. The Key to Full-Stack Delivery: State and Concurrency

    What really separates a “demo” from something that can go live is the backend. Persistence, capacity limits, and duplicate submissions are the three things that must be handled.

    1. # Pseudocode: ordering under a capacity constraint
    2. async def book(flight_id, seat, user):
    3. async with db.transaction():
    4. row = await db.lock(flight_id) # row-level lock
    5. if row.sold >= row.capacity: # capacity 6
    6. raise SoldOut()
    7. if await db.exists(flight_id, seat):
    8. raise Conflict()
    9. await db.insert_order(flight_id, seat, user)
    10. row.sold += 1

    The key points: acquire the lock before validating, use a unique index as a backstop against duplicates, and keep the order and inventory updates in the same transaction. Missing any of these leads to overselling or double-booked seats under high concurrency.

    6. The Delivery Pipeline: Keeping Agents on a Controllable Track

    It is advisable to fix the process into a four-stage pipeline, each with a point where humans can intervene:

    1. Specification generation: produce the requirements document and acceptance checklist for human confirmation;
    2. Code generation: produce output module by module, with frontend and APIs separated;
    3. Automated verification: build, unit tests, end-to-end scripts, accessibility and performance checks;
    4. Fix loop: feed failure logs back to the model and cap the maximum number of iterations to prevent infinite loops.

    In the Baidu AI Cloud environment, this pipeline is typically hosted on a container platform for build and runtime, with object storage holding static assets and materials, logging and monitoring/alerting services providing observability, and a message queue used for peak shaving and asynchronous task decoupling. Evaluate such services by general capability category rather than binding to specific interfaces.

    7. Cost and Risk Checklist

    • Context cost: feed only relevant files and interface definitions, and load retrieval on demand;
    • Hallucinated dependencies: run dependency audits and license checks uniformly after generation;
    • Security baseline: input validation, parameterized queries, and no secrets in the code repository;
    • Compliance requirements: asset licensing, privacy notices, and data retention periods must be confirmed upfront;
    • Rollback capability: keep a version snapshot for each generation and support one-click rollback.

    8. Conclusion

    The maturity of open-source models and agents has made “generate a runnable site from a description” a routine operation. Real competitiveness lies in engineering constraints: turn aesthetics into specifications, turn specifications into acceptance criteria, and make concurrency and state handling solid. Replacing the pursuit of leaderboards with a verifiable pipeline is the path to stable output.