Evaluating Multi-Model AI Agents: A Methodology for Replicating Chat-Style Web Applications End to End
This article lays out an evaluation methodology that compares multi-model AI agents not by raw generation speed but by end-to-end delivery capability. It describes a controlled setup of six model-and-framework combinations, a two-round prompting strategy that withholds API credentials until the second turn, and the resulting split between minimal "declare success" behavior and deep, iterative verification. It then breaks down how to replicate a conversational web application—specification-first design, streaming event parsing, and context/cost management—and closes with a reusable acceptance checklist, common pitfalls, and practical recommendations for keeping verification loops mandatory in real projects.
1. Evaluation Goal: Not “Who Writes Faster,” but “Who Delivers Correctly”
In real engineering decisions, comparing generation speed or single-turn code quality in isolation has limited value. What actually determines return on investment is end-to-end delivery capability: can a model turn a vague requirement into an executable specification, autonomously gather information on an unfamiliar interface, complete real connectivity verification once external credentials are provided, and—when verification fails—locate the problem rather than declaring success?
With this in mind, the evaluation task was defined as “replicate a conversational web application,” with three required deliverables:
- Product feature document and structure diagram — page structure, interaction paths, state transitions, and interface contracts.
- Baseline implementation — a web application that faithfully reproduces the target interface and core interaction flow.
- Improved implementation — a version the model optimizes on top of the baseline based on its own judgment.
The second deliverable measures “fidelity”; the third measures “design judgment.” Only together do they distinguish “copying ability” from “engineering ability.”
2. Evaluation Design: Controlled Variables and a Consistent Baseline
2.1 Task Combinations
The evaluation covers six “model + runtime framework” combinations, spanning two variable types:
- Model dimension: a lightweight, high-speed version from an open-source large-model family (paired with maximum output and multi-agent collaboration mode); a long-reasoning mode of a general-purpose large model (paired with a standalone coding-agent framework); an ultra-long-context version (roughly a million-token context window, with standard context configuration); and a general-purpose flagship version (paired with its official client toolchain).
- Framework dimension: the agent runtime framework determines how complete the loop of tool invocation, file I/O, command execution, and self-verification is. The performance gap between the same model under different frameworks is often no smaller than the gap between different models.
This “cross-combination” design is the key to the evaluation: it exposes both “model reasoning ability” and “agent execution chain” as variables at the same time.
2.2 Two-Round Prompting: Requirements First, Credentials Later
The evaluation uses two rounds of interaction to mirror a real development scenario:
- First round: only the role setting and requirements are provided — reproduce the target web page from the perspective of a senior product manager, along with an accessible page URL and API documentation URL, allowing the model to use its built-in browsing capability on a logged-in session so it can observe the interface and read the calling conventions itself.
- Second round: API credentials (keys) are injected into the model, and the change in its behavior once it “has real calling capability” is observed.
No additional instructions are added between the two rounds. All models face identical constraints, tool permissions, and operating methods; the only differences come from the models’ and frameworks’ own strategic choices.
2.3 Prompt Template (Neutralized)
# RoleYou are a senior product manager and full-stack engineer. Your task is to replicate a conversational web application.# Reference Materials- Target page: {TARGET_URL} (the browser session is already logged in and accessible via the built-in browsing tool)- API specification: {DOC_URL} (includes authentication method, request body fields, streaming response format, and error codes)# Deliverables1. Product feature document: structure diagram, core interaction flow, state machine, and interface contract table2. Baseline implementation: a runnable web application that reproduces the page layout and chat flow3. Improved implementation: a version optimized based on your professional judgment, with an explanation of the improvements# Constraints- Both frontend and backend must be runnable, with complete dependency declarations- The key must be injected via an environment variable and must not be hard-coded- Streaming output, session persistence, and error messaging must be implemented# Second-Round AdditionThe key has been configured in the environment variable API_TOKEN. Use it to complete connectivity verification.
3. Key Observations: How Behavior Diverges Once Credentials Are in Hand
The most informative observation in the evaluation appears in the second round. Once the key is obtained, the different combinations exhibit two clearly distinct strategies:
Type A: minimal verification, then convergence. Some combinations run only a single simplest request test, and mark the task complete as soon as they confirm a “non-empty response.” Such implementations usually run, but issues like chat-history truncation, streaming-parse edge cases, timeout retries, and error-code branches are essentially never surfaced.
Type B: deep verification and iterative repair. Some combinations (typically the ultra-long-context version) proactively construct boundary inputs: empty messages, oversized text, concurrent requests, invalid tokens, network interruptions. They read the error information in the response bodies, return to the code to locate and fix issues. The code these deliver is noticeably higher in quality, and their self-test reports are reproducible.
Because the evaluation applied the exact same operating process to every group, this difference can only be attributed to strategic differences between the models and frameworks. Its causes can be summarized in four points:
- Whether the verification loop is internalized. Mature agent frameworks enforce “modify → run → read errors → modify again” as a mandatory loop rather than a one-off action.
- The ability to consume error feedback. Whether a model can interpret the key information in stack traces and response bodies determines whether repair is “guess-based” or “diagnosis-based.”
- Context-budget strategy. Long-context capability lets a model simultaneously hold the spec document, API specification, all source code, and runtime logs, enabling cross-file correlation analysis; with limited context, it tends to degrade into localized patching.
- Autonomous goal decomposition. Whether the model breaks “verification” into functional, performance, and exception sub-tasks and advances them separately.
4. Technical Breakdown of Replicating a Chat-Style Application
4.1 Specification First
Reliable implementations always start with a specification, not code. A recommended document skeleton:
1. Page structure: sidebar (conversation list), main message stream, bottom input area, model selector2. State machine: IDLE → SUBMITTING → STREAMING → (DONE | ERROR)3. Data model: Conversation(id, title, created_at)Message(id, conv_id, role, content, created_at)4. Interface contract:POST /v1/conversations create a conversationGET /v1/conversations list conversationsPOST /v1/chat send a message, return an event streamDELETE /v1/conversations/{id} delete a conversation5. Exception matrix: 401 invalid token / 429 rate limited / 5xx upstream unavailable
4.2 The Streaming Path Is the Most Error-Prone Part
The core of the chat experience is incremental rendering. The common approach is for the server to continuously push events via Server-Sent Events (SSE), while the client parses increments and appends to the render:
import json, os, urllib.requestdef stream_chat(messages, base_url, model):payload = json.dumps({"model": model,"messages": messages,"stream": True}).encode("utf-8")req = urllib.request.Request(f"{base_url}/v1/chat",data=payload,headers={"Content-Type": "application/json","Authorization": f"Bearer {os.environ['API_TOKEN']}",},method="POST",)with urllib.request.urlopen(req, timeout=60) as resp:buffer = ""for raw in resp:buffer += raw.decode("utf-8")# Events are separated by a blank line; data is marked with the data: prefixwhile "\n\n" in buffer:block, buffer = buffer.split("\n\n", 1)for line in block.splitlines():if not line.startswith("data:"):continuedata = line[5:].strip()if data == "[DONE]":returntry:delta = json.loads(data)["choices"][0]["delta"]except (json.JSONDecodeError, KeyError, IndexError):continue # heartbeat or malformed block; skip rather than abortif delta.get("content"):yield delta["content"]
Three error-prone points deserve emphasis: chunk parsing must handle the case where “half a JSON spans across packets”; heartbeat frames and the end marker must be handled distinctly; and malformed blocks should be skipped rather than allowed to break the entire stream. These three spots are exactly where Type A implementations most often fall short.
4.3 Context Management and Cost
The longer the conversation, the more critical the history-trimming strategy. A common engineering approach combines “keep the system prompt + the most recent N turns + a summary of earlier conversation,” which controls token consumption while preserving semantic continuity. The summary itself can be generated asynchronously by the model, avoiding blocking the main path.
5. A Reusable Acceptance Checklist
After the evaluation, it is advisable to score horizontally with a fixed checklist rather than relying on subjective impressions:
| Dimension | Check Items |
|---|---|
| Functional completeness | Conversation create/read/update/delete, message send/receive, streaming render, Markdown and code-block rendering |
| Robustness | Degradation paths for invalid tokens, rate limiting, upstream timeouts, empty input, and oversized input |
| Security | Key read only from environment variables, logs contain no sensitive fields, frontend exposes no credentials |
| Runnability | Complete dependency declarations, one-command startup, a minimal reproducible self-test script |
| Verification depth | Presence of boundary and exception cases, and a reproducible self-test report |
| Documentation quality | Structure diagrams and interface contracts consistent with the implementation |
Among these, “verification depth” and “documentation–implementation consistency” have the highest correlation with final code quality.
6. Common Pitfalls
- Treating “it runs” as “it’s usable”: a single successful request cannot expose streaming edge cases or concurrency problems.
- Hard-coding keys or writing them into the frontend: the most common and most dangerous anti-pattern.
- Skipping the specification and coding directly: this distorts documentation and implementation in both directions, sharply increasing later maintenance cost.
- Ignoring the context budget: in long-conversation scenarios, token consumption spirals out of control, making production costs unpredictable.
7. Conclusion
The real takeaway of this evaluation is not “which model is strongest,” but that the success or failure of agent tasks depends on the combined effect of both model reasoning ability and the execution framework. The same model, switched to a framework with a more complete verification loop, can differ in delivered quality by an order of magnitude; conversely, even a powerful model that lacks a mandatory self-test loop tends to leave hidden problems when it “declares completion.”
The practical recommendation for teams is to shift the evaluation focus from “generation quality” to “verification depth,” and to build a reproducible horizontal baseline using consistent two-round prompts and a fixed acceptance checklist. In real projects, keep the “modify → run → read errors → fix” loop mandatory, and treat key management, streaming parsing, and the exception matrix as a non-negotiable engineering baseline. Where deployment is involved, you can rely on general-purpose cloud capabilities such as container platforms, logging services, and monitoring/alerting (for example, similar infrastructure categories offered by cloud providers such as Baidu AI Cloud) to turn self-test scripts into automated gates in the pipeline, so that model outputs undergo consistent, auditable checks before entering the main branch.
