16 of 174 subtitles documented + 1 independent supplementary unit(s) · Writing progress, not your learning progress · Videos not visually reviewed
LangSmith: trace execution and interpret metrics correctly
Objective and entry check
Distinguish a complete execution from a child run, latency from quality, and local inference from cloud tracing.
Before continuing: if a RunnableSequence takes ten seconds, must each child also take ten seconds? Does a successful trace establish a correct answer?
Entry-check answer
No. A parent can span several different stages. Technical completion does not establish semantic correctness.
From scattered prints to an execution record
A single model request is relatively easy to inspect. With multiple calls, tools, loops, and retries, we need to associate each event with the request that caused it. Tracing addresses this need. Observability predates LLMs; variable outputs and multi-stage language applications make it especially useful.
In lecture 013, the instructor configures LangSmith and inspects template and model execution in a tree. The dashboard helps inspect execution; it does not replace understanding the inputs or defining answer-quality criteria.
Basic vocabulary
- A run is an execution unit, such as a template or model call.
- A trace connects related executions into a complete path.
- Parent/child relationships connect the overall chain with nested stages.
- A tag groups runs, for example by experiment; it need not contain user data.
The local events in lesson 011 illustrated these relationships. LangSmith supports managing and inspecting executions at a larger scale. The tracing concept is not exclusive to this product.
Configuration independent of a particular model
In the usual LangChain path, LANGSMITH_TRACING, LANGSMITH_API_KEY, and LANGSMITH_PROJECT configure tracing and its destination project. A LangSmith key differs from a model-provider key. Local-model calls can also be traced. Official quickstart
This PowerShell fragment illustrates configuration only; it was not executed at this stage:
$env:LANGSMITH_TRACING = "true"
$env:LANGSMITH_PROJECT = "learning-synthetic-examples"
# Set the real key privately, not in a versioned course file.
# LANGSMITH_API_KEY must exist in the running process environment.
Choose a project, labels, and region appropriate to the actual account. Variables set in one terminal do not necessarily reach an already-running IDE. A .env file does not configure a process until something loads it.
Important correction: account region, not physical location
The subtitles suggest that users outside the US must choose an EU endpoint. The correct criterion is the LangSmith account/organization region. The official guide gives https://eu.api.smith.langchain.com for EU accounts. Match the destination account rather than the user's country; a mismatch can cause authentication failure. Region configuration in the quickstart
Where can data leave the machine?
Even with a local model, cloud tracing can send inputs and outputs to the tracing destination. The official guide explains hiding or masking data. For example, LANGSMITH_HIDE_INPUTS=true and LANGSMITH_HIDE_OUTPUTS=true hide those payloads, not necessarily all metadata. Sensitive trace data controls
Our examples use fictional text. The current experiment recorded events in memory only and submitted no cloud trace. The instructor's shared-trace links were absent from the local files and are not treated as inspected evidence.
Interpret metrics carefully
| Metric | What it addresses | What it does not establish |
|---|---|---|
| Total latency | How long this run took | Answer correctness |
| Time to first token | When initial output arrived | When the full answer finishes |
| Token count | Reported usage | Cost without model and pricing |
| Success status | Technical completion | Instruction/evidence fidelity |
Timing two models with different inputs, output lengths, loading conditions, or system load is not a controlled comparison. One slow example is not a permanent performance rule.
The subtitles mention P50 and P90. For intuition, with ten invented sorted latencies and the nearest-rank convention, P90 is rank ceil(0.9×10), the ninth value. Tools may use different calculation methods. One run is insufficient to characterize a latency distribution. This statistical example is supplementary and does not claim to describe LangSmith's internal percentile formula.
Independent practice
- A trace succeeds, but the requested two facts are missing. Is this a technical failure or a quality issue?
- You are in Iran, but your LangSmith account is in the US region. Does your physical location determine the endpoint?
- Which better supports “the model ran”: an output file, or a correlated run record for that invocation?
Answer 1
It is currently an output-criteria/quality failure. Inspect the final input, generation limits, and response. Success status does not prove instruction following.
Answer 2
Physical location is not the criterion. Inspect the account's destination region and configuration rather than inferring a mandatory switch to EU.
Answer 3
A correlated run is better evidence. A file could be stale or created before execution reached the model.
Cumulative recall and continuation criterion
Without the text, draw dictionary → PromptValue → AIMessage, locate the wrong-key failure, distinguish a fake model from a real one, and draw the optional tracing path separately. If you can explain all four, continue to lecture 016 on versioning. Otherwise, revisit only the relevant part of lesson 009, 011, or 012 and attempt a fresh question.
Course source: the complete lecture 013 subtitle file. The diagram, region correction, metric example, and exercises supplement the lecture. Real-account configuration and cloud submission were not tested; local callbacks were tested in lesson 011. The instructor's pricing/free-tier claims are not treated as current account information. Sources checked on 2026-10-16; video not visually reviewed.