FDE Times dataFDE jobs open 932▼14 Change in open roles over 7 days, like-for-like: roles from companies we started tracking this week are left outNew in 7 days 62Companies hiring 202Remote-friendly 24%Median US pay $201kTop hirer Databricks 92
中文VI

The newspaper of the Forward Deployed Engineer

Tools

W&B Weave turns customer complaints into evals you can rerun

One decorator records a function's inputs, outputs and code, which is enough to reopen yesterday's failed call and prove that the fix worked.

ShareLinkedInFacebookX

In brief

  • Weave records the inputs, outputs and code of any function decorated with @weave.op, and supported LLM calls are traced automatically.
  • Datasets can be built from calls you have already traced, and every call to .evaluate() is one run of an Evaluation.
  • The real value lies in the set of failures you collect at the client, not in the decorator itself.
Two bars, each made of 20 cells representing 20 failing cases. The first run has 14 correct cells in blue and 6 incorrect cells in grey. The second run has 17 correct cells, or 85%, but 2 cells that were correct in the first run are now broken, shaded orange, and 5 cells that were wrong have been fixed.
The overall score rises from 70% to 85%, but only a case-by-case comparison shows that 5 cases were fixed and 2 previously correct cases broke. Source: hypothetical example in the article, using an evaluation set of 20 failing cases.

Two weeks after a ticket-triage agent goes live at a client, the head of operations sends a screenshot: a billing ticket has been routed to the engineering team, and she wants to know why. Without a trace, all you can do is guess. The scenario is hypothetical, but most FDEs will recognize it.

W&B Weave keeps the recording side of this to very little code: after one initialization call, a decorator on a Python function stores its inputs, its outputs and the function’s code itself. From there you can build the loop every FDE needs: see the failure, keep it, then prove it is gone.

The official documentation describes Weave as an observability and evaluation platform; its PyPI page puts it more briefly, as a toolkit for tracing and evaluating AI agents. If you are bringing an LLM application into a client’s environment, this kind of tool belongs in place before the first meeting about quality, not after it.

When does an FDE need Weave?

Use this test: if a client asks this afternoon about a call made yesterday and you cannot reopen its input and output, you need tracing. Weave fits when the application runs on Python 3.10 or later, the agent is already handling real requests, and the client’s security team has agreed that this content may be recorded.

With the billing ticket above, the conversation shifts from “it’s probably the prompt” to a concrete record, with input, output, latency and token usage, that both sides can read.

A one-session demo on fake data does not need it yet, because there are no real failures to keep. Evaluation is worth the investment once you have real failures and are about to change a prompt or a model, because that is when you need to know whether the fix breaks something else.

One line to initialize, one decorator

Start with tracing. weave.init takes a team/project path and creates the project if it does not exist.

import weave
from openai import OpenAI

weave.init("acme/ticket-triage")
client = OpenAI()

@weave.op
def classify_ticket(text: str) -> str:
    response = client.chat.completions.create(
        model=MODEL_NAME,
        messages=[{"role": "user", "content": PROMPT + text}],
    )
    return response.choices[0].message.content

The two capitalized names in the code are yours to fill in and must be defined before it runs. MODEL_NAME is the model the project uses, and PROMPT holds the classification instructions, for instance telling the model to return only a single label such as billing or access.

The LLM call inside does not need its own decorator if it is a supported integration, because Weave traces those calls automatically. @weave.op is for your own code: preprocessing, retrieval, post-checks. The first job at a client is to attach it to exactly the functions you will have to explain when something goes wrong.

From screenshot to test

A trace tells you what happened, but it does not stop it happening again. Weave’s documentation describes the examples in an evaluation set as typically being failure cases you want to test, much like unit tests. If you carry only one habit from Weave to other projects, make it this one.

A Dataset can be generated from calls you have already traced: select one or more calls in the UI, or use Dataset.from_calls in Python. The call gives you the input and output of the failed run, but you still have to add the correct answer. Ask the head of operations to approve the labels, because someone who knows the business is usually more reliable than an engineer guessing.

The code below writes the rows by hand so the structure is easy to see, and sketches only the main steps; check function signatures against the documentation for the exact version you have installed. Each row has its own id so that runs can be compared later.

import asyncio

rows = [
    {"id": "case-01", "text": "Charged twice for September invoice", "expected": "billing"},
    {"id": "case-02", "text": "Cannot log in after SSO change", "expected": "access"},
]
dataset = weave.Dataset(name="ticket-failures", rows=rows)
weave.publish(dataset)

@weave.op
def exact_match(expected: str, output: str) -> dict:
    return {"correct": expected == output}

evaluation = weave.Evaluation(dataset=dataset, scorers=[exact_match])
asyncio.run(evaluation.evaluate(classify_ticket))

A scorer must take an output parameter and return a dictionary of scores. The documentation likens an Evaluation to a blueprint, and each call to .evaluate() is a run. You keep the blueprint fixed, change the prompt or the model, and measure again.

The headline number can mislead you

Say the evaluation set holds 20 real failures, and the first run gets 14 right, or 70%. You revise the prompt and the next run gets 17 right, or 85%. Telling the client that quality rose by 15 percentage points sounds good.

Now read the scores case by case. You may have fixed 5 cases and broken 2 that used to pass: 14 plus 5 minus 2 still makes 17. If those 2 are the ticket type the client cares about most, 85% is not enough to go to production.

So each run needs its own JSON file, with one key per case: the case’s id, mapped to the correct value the scorer returned. The Python SDK provides the data through client.get_calls; the UI can also export selected rows or all of them.

Two things need checking on the Query and export calls page, against the version you have installed: how to filter the calls that belong to one run, and which fields hold the id and the score. If you cannot find them yet, the fallback is to run classify_ticket and exact_match over each row yourself and write the file:

import json

results = {}
for row in rows:
    output = classify_ticket(row["text"])
    results[row["id"]] = exact_match(row["expected"], output)["correct"]

with open("run_1.json", "w") as f:  # run_2.json for the second run
    json.dump(results, f)

However you get the data, both files must share the same format for the diff below to work.

import json

# run_1.json, run_2.json: {"case-01": true, "case-02": true, "case-03": false}
run_1 = json.load(open("run_1.json"))
run_2 = json.load(open("run_2.json"))
assert run_1.keys() == run_2.keys()  # both runs must cover the same cases

fixed = [c for c in run_1 if not run_1[c] and run_2[c]]
regressions = [c for c in run_1 if run_1[c] and not run_2[c]]

The regressions list is what you take into the meeting with the client, before you quote the headline number.

The decorator does not do the hard part

The first limit is built into how it works: @weave.op records only the functions you decorate, and automatic tracing covers only supported LLM calls. If the client routes through an internal LLM gateway, test early whether it shows up in traces; do not assume it will.

The second limit is the bigger one. Traces record inputs and outputs, which means the content of the client’s tickets, possibly including personal data, will sit inside them. Before turning tracing on over real data, work out with the client’s security team where the data is stored and who can see it.

Two details about the vendor and versions matter. CoreWeave announced that it had completed its acquisition of Weights & Biases on May 5, 2025, and the Weave documentation now lives at docs.coreweave.com, so state that relationship clearly in any documents you send the client.

The weave package on PyPI requires Python 3.10 or later; pin the exact version you have tested, for example weave==0.54.0.

Finally, Weave measures only what your scorer measures. Exact match suits a classification task; for free text, whether you use an LLM judge or a custom scorer, you still have to define what good looks like. That has to be agreed with the client.

What to learn first, and what goes on a CV?

Learn in the order of the loop: tracing first, then Datasets, then Evaluation with a simple scorer. Do not rush into elaborate scorers before you have 20 real failures in hand; a good dataset helps more than a sophisticated metric applied to made-up data.

When reading FDE or applied AI job postings, look for the keywords evals and observability, and prepare a story with numbers. A strong CV line says how many real failures your evaluation set was built from, what the scores were before and after, and which regressions you caught before production. The tool’s name is a minor detail.

Exercise: build your own regression list

Take 20 failures from your dataset, do one run and save the per-case scores to run_1.json. Change one detail in the prompt, do a second run, save it to run_2.json, then diff the two files with the Python above.

Count the cases that went from wrong to right and those that went from right to wrong. To check yourself, take the first run’s score, add the number fixed and subtract the number broken: the result must equal the second run’s score, just as 14 plus 5 minus 2 made 17 above.

Then write a two-sentence report for the client. The first gives the scores before and after; the second names the cases that just broke and what you will do about them.

The next time a client sends a screenshot of a wrong answer, do not just fix the prompt. Add a row to the dataset, so the next measurement tells you whether that failure has come back.

Was this article useful?

Use with your AI assistantAsk Claude ↗Ask ChatGPT ↗
8 sources
Read next on the roadmap · Stage 6: MeasurementLogfire's SDK is open, but the backend holding your traces is notFour lines of code trace a client's agent on OpenTelemetry, and standard SQL means the client's data engineers can read your queries.