Evaluation Driven Development for LLM Reliability at Scale

dosu · Tech · 2024 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: LLM reliability for open-source maintenance automation

Dosu needed to keep an LLM-powered software-maintenance assistant reliable as it grew from manually inspected responses to thousands of repository installations and many production failure modes.

Constraints:

Architecture

Dosu adopted evaluation-driven development and LangSmith tracing. The team creates initial evals for new behavior, launches to users, monitors production traces for failure modes, adds examples to offline eval datasets, iterates against those evals, and relaunches. LangSmith traces function inputs, rendered prompts, LLM outputs, metadata, feedback, latency, and errors so engineers can search production behavior and convert failures into evaluation data.

Diagram confidence: reconstructed (reconstructed from prose).

flowchart LR
  dosu-production-assistant["Dosu production assistant"] --> langsmith-tracing-sdk["LangSmith tracing SDK"]
  langsmith-tracing-sdk --> trace-search-and-monitoring["Trace search and monitoring"]
  trace-search-and-monitoring --> failure-mode-triage["Failure-mode triage"]
  failure-mode-triage --> offline-eval-datasets["Offline eval datasets"]
  offline-eval-datasets --> prompt-and-model-iteration["Prompt and model iteration"]
  prompt-and-model-iteration --> dosu-production-assistant
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
Dosu production assistant AI teammate handling questions, issue triage, labels, and maintenance tasks. LangSmith tracing SDK
LangSmith tracing SDK Captures function traces, LLM calls, inputs, prompts, outputs, and metadata. Trace search and monitoring
Trace search and monitoring Finds anomalies using feedback, incidents, latency, sentiment, and custom metadata. Failure-mode triage
Failure-mode triage Groups production failures and searches for additional examples. Offline eval datasets
Offline eval datasets Stores representative examples used to test prompt, model, and logic changes. Prompt and model iteration
Prompt and model iteration Improves Dosu behavior while checking for regressions. Dosu production assistant

Data flow

Dosu instruments LLM-related functions with LangSmith tracing, sends production traces into LangSmith, searches for signals such as feedback, errors, latency, and negative sentiment, identifies failure modes, gathers similar examples, adds them to offline eval datasets, and uses those evals to iterate on prompts, models, and core logic.

“With EDD, we have a well-defined process for improving Dosu:”article, stated
“LangSmith's advanced search functionality makes it easy to identify anomalous behaviors.”article, stated

Why this architecture

Dosu needed production traceability because manual inspection stopped scaling. Treating prompts as code and converting observed failures into eval examples gave the team a repeatable loop for changing probabilistic behavior while watching for regressions across domains.

“In the ethos of EDD, we treat prompts as code.”article, stated
“Dosu's increased activity made it nearly impossible to monitor responses and identify failure modes in production”article, stated

Models used: Dosu AI teammate · LLMs · LangSmith · @traceable decorator · Evaluation-driven development

Scale

Alternatives considered (roads not taken)

Continue manual log inspection.

Rejected because: Manual grep and print statements worked early but became impossible as repository installations and response volume grew.

“armed with just grep and print statements, we meticulously combed through logs to identify areas for improvement.”article, stated

Treat prompt tweaks as informal product changes.

Rejected because: Small prompt changes can create unpredictable cross-domain regressions.

“a slight tweak to a prompt led to better results in one domain but caused regression in another.”article, stated

Use a generic observability tool without code-level traces.

Rejected because: Dosu needed metadata between LLM requests and within a single trace, not just request logs.

“There is more to Dosu than a series of LLM requests. We wanted to track metadata between LLM requests within a single trace.”article, stated

Patterns

eval-driven-development (LLM reliability)

Dosu turns production failures into offline eval examples and iterates on prompts, models, and logic against those evals.

“Add examples for each failure mode to our offline evals”article, stated

observability-tracing (production monitoring)

LangSmith captures function and LLM traces so Dosu can search production behavior and debug failures.

“it can send the function and LLM call traces to LangSmith.”article, stated

prompt-versioning (change control)

Dosu treats prompts as code and keeps prompt changes in Git with code-level standards.

“Any changes to a prompt must be treated with the same standards as code changes.”article, stated

data-quality-loop (eval dataset creation)

Production failures are searched, grouped, and added to offline eval datasets.

“We search LangSmith for additional examples”article, stated

Tradeoffs

Prioritize quality over speed.

Chose Trace and evaluate slow responses over Optimizing only for latency.

Rationale: Response time still matters, but Dosu explicitly says quality comes first and slow responses need diagnosis.

“At Dosu, we prioritize quality over speed; however, understanding why a response is slow matters.”article, stated

Adopt LangSmith SDK instrumentation.

Chose @traceable decorator and LangSmith UI over Manual logs or less customizable monitoring.

Rationale: The SDK gave fine-grained controls and linked function inputs, prompts, and LLM output in one trace.

“The LangSmith SDK gave us the fine-grain controls and customizability we were looking for.”article, stated

Gotchas (what bit them)

Prompt changes create hidden regressions.

Root cause: LLM behavior is probabilistic and domain-coupled rather than deterministic.

Resolution: Use EDD to evaluate every change against known behaviors and failure cases.

“It's difficult to know how a small change might affect performance as a whole.”article, stated

Failure modes multiply with input variety.

Root cause: Dosu receives simple questions, upgrade error traces, feature-status requests, and other diverse inputs.

Resolution: Search traces by multiple signals and turn anomalies into eval examples.

“More possible inputs to Dosu means more possible failure modes.”article, stated

Very large user inputs caused slow responses.

Root cause: Users pasted thousands of lines of logs or raw embedding float values.

Resolution: LangSmith trace search exposed the pattern so it could enter the EDD loop.

“we found a pattern of extremely slow responses when users would share thousands of lines of logs or the raw float values of an OpenAI embedding.”article, stated

Evaluation

Dosu creates initial evals, monitors production, identifies failure modes, searches for additional examples, adds them to offline eval datasets, iterates, and relaunches. LangSmith provides trace search over feedback, errors, latency, sentiment, and metadata.

Metrics: Explicit feedback · Recent error incidents · Response time delays · Negative sentiment · Failure-mode examples · Prompt/model regression coverage

“We can perform searches using a range of criteria, including: explicit user feedback, recent error incidents, response time delays, or negative sentiment.”article, stated

Outcomes

The case reports thousands of repository installations, all-hours response generation, and dozens of submodules, but not exact request volume.

“Out-of-the-box, LangSmith gave us visibility into all of Dosu's activity.”article, stated
“There is a fun flywheel effect in Dosu's collaboration with LangChain.”article, stated