Full-Stack Delivery with Open-Source LLM Agents: A Practical Guide

    This guide breaks down end-to-end delivery with open-source LLM agents into four layers: intent parsing, generation, runtime, and validation. It shows how to write structured prompts as machine-readable specs, turn visual storytelling into configurable templates, make the backend truly run with state machines and atomic persistence, and build automated quality checks that turn demos into regression-safe systems. It also covers common failure modes and a recommended path for reproducing the workflow in your own environment.

    1. The Real Technical Challenge: From Writing Code to Delivering a System

    Open-source large models have recently drawn attention for their performance on public benchmarks, but benchmark scores are only one side of the result. The question that actually matters to developers is this: can an agent powered by an open-source model complete an end-to-end delivery with minimal human intervention—understanding business intent, producing visuals and interactions, filling in backend logic, and persisting state?

    Broken down, delivery capability spans at least four layers:

    1. Intent parsing: turning natural-language requirements into structured specs (page lists, data entities, state transitions).
    2. Generation: producing frontend structure, a styling system, interactive components, and backend API skeletons.
    3. Runtime: making data actually persist and making concurrency and capacity constraints take effect.
    4. Validation: verifying functionality, boundaries, and regressions automatically.

    Most “impressive-looking” demos only cover the first two layers, while the engineering value concentrates in the third and fourth. The sections below lay out a practical approach for each of the four layers.

    2. Prompts as Specs: Constraining Generation with Structured Descriptions

    The prerequisite for high-quality delivery is writing vague requirements as machine-consumable specs. A four-part structure is recommended—role + goal + constraints + acceptance—with data entities and the state machine declared explicitly.

    1. # spec.yaml — structured requirements handed to the agent
    2. goal: low-earth-orbit travel booking site
    3. entities:
    4. Flight: {date, seats_total: 6, seats_left}
    5. Booking: {flight_id, seat_no, passenger, created_at}
    6. state_machine:
    7. seat: [available, held, locked]
    8. constraints:
    9. - max 6 seats per flight, auto-lock when sold out
    10. - booking data must persist and survive restarts
    11. acceptance:
    12. - date selection -> seat selection -> details -> persist, end to end
    13. - no seat is sold twice under concurrency

    The key is to write business rules such as “6 seats per flight, lock when full” as explicit constraints rather than leaving them to the model’s discretion. The more decidable the constraints, the easier the downstream automated validation.

    3. Engineering the Visual and Narrative Layer

    The cases in the original text (space, deep-sea, and perfume sites) are essentially three combinations of “narrative rhythm + data density,” which can be abstracted into reusable templates:

    • Hero section: full-screen visual background plus key status indicators (such as a system-online breathing dot or a flight data panel).
    • Middle section: vertical timeline narrative, with each node bound to a key metric and a scene image.
    • Lower section: a parameter card matrix (such as vehicle propulsion and observation window size) and a byline area (role-based authors such as researchers or directors).

    Engineering-wise, these should be broken into configurable items to avoid rewriting each time:

    1. {
    2. "hero": {"bg": "full-bleed-video", "telemetry": ["altitude", "velocity"]},
    3. "timeline": [{"t": "T-60:00", "metric": "pressure", "asset": "scene_01"}],
    4. "cards": {"repeat": 3, "fields": ["propulsion", "viewport_size"]},
    5. "type": {"display": "serif", "mono_for_data": true}
    6. }

    Typographic conventions—monospace fonts for data, serif fonts for brand names—should be written into the design spec and followed uniformly by the agent, rather than negotiated page by page.

    4. Making the Backend Actually Run: State Machines and Persistence

    The dividing line between a demo and a product is the runtime layer. Taking seat booking as an example, the core is a state machine + atomic operations + persistence.

    1. -- use an atomic database update instead of "read then write" to prevent overselling
    2. UPDATE flight
    3. SET seats_left = seats_left - 1
    4. WHERE id = :flight_id AND seats_left > 0;
    5. INSERT INTO booking(flight_id, seat_no, passenger, created_at)
    6. VALUES (:flight_id, :seat_no, :passenger, now());

    Recommended supporting measures:

    • Unique constraint: build a unique index on (flight_id, seat_no) as a fallback against duplicate sales.
    • Inventory as the source of truth: seat availability is determined by the database; caching is only for read acceleration.
    • Idempotent writes: introduce an idempotency key for booking requests to avoid multiple records from repeated submissions.
    • Capacity and elasticity: for unpredictable traffic peaks, use a general-purpose container platform for elastic scaling, a message queue for peak shaving, object storage for large static files such as images and videos, and logging and monitoring services for observability.

    5. Quality Validation: Turning “It Can Demo” into “It Can Regress”

    Generation without validation is just a draft. At least three layers of automation are recommended:

    1. API layer: contract tests for creating, querying, and canceling bookings, covering boundaries such as sold out, duplicate seats, and invalid dates.
    2. Concurrency layer: load-test the same flight with multiple threads and assert that the number sold does not exceed the limit.
    3. Visual regression: screenshot comparison for key pages to prevent style drift.
    1. # pseudocode: concurrent sold-out validation
    2. def test_no_overbooking():
    3. with ThreadPool(50) as pool:
    4. results = pool.map(lambda _: book("F-001", "A1"), range(200))
    5. assert count_success(results) == 6 # limit is 6; successes must equal exactly 6

    Putting acceptance criteria into the spec upfront (see Section 2) allows the agent to generate the validation scripts as well, forming a closed loop.

    6. Common Failure Modes and How to Avoid Them

    • Frontend shell only: backend logic is missing and data is not persisted. Avoidance: make persistence a hard acceptance metric.
    • Rules left to “free play”: seat counts and lock conditions get rewritten by the model. Avoidance: explicit constraints plus a unique index as a fallback.
    • Concurrent overselling: the classic race condition of read-then-write. Avoidance: atomic database updates.
    • Unmaintainable visuals: styles scattered everywhere. Avoidance: centralized design tokens.
    • No regression means: changing one thing breaks everything. Avoidance: put screenshot comparison and contract tests into the repository.

    7. Implementation Recommendations

    To reproduce this capability in your own environment, the recommended path is: first write requirements as a structured spec, then have the agent produce the frontend, APIs, and tests separately; next, integrate general-purpose cloud capabilities (a container platform to host services, object storage for media, a message queue for peak shaving, and logging and monitoring for observability); finally, gate the result with three checkpoints—contract tests, concurrency load tests, and visual regression. The general-purpose cloud product categories offered by Baidu AI Cloud can serve as the hosting and operations foundation, letting teams focus on business rules and experience design rather than repeatedly building infrastructure.