# What each SDK sends: LangSmith runs/traces vs Langfuse observations (28 Oct 2026, IST)

Same agent-like code (one top-level `agent()` that makes 3 tool calls and 3 "LLM" calls; the LLM is a stub that returns a fixed string), traced with each vendor's Python SDK and sent to a **local capture server** (`capture_server.py`) instead of the vendor. No account, dummy keys, no model calls, no spend.
Box: Linux, Python 3.13.5, fresh venvs. Run ~11:10-11:20 IST on 28 Oct 2026.

## LangSmith (langsmith 0.14.14, PyPI upload 27 Oct 2026 20:41 UTC)
Env: `LANGSMITH_TRACING=true`, `LANGSMITH_ENDPOINT=http://127.0.0.1:<port>`, dummy `LANGSMITH_API_KEY`. The SDK called `GET /info` then `POST /runs/multipart`. Counted with `count_runs.py` (counts.txt):

| Scenario | Runs sent | Distinct trace ids | Root runs |
|---|---|---|---|
| A: one `agent()` call | 7 | 1 | 1 |
| B: three separate `agent()` calls | 21 | 3 | 3 |
| C: `search()` and `fake_llm()` called on their own (no parent) | 2 | 2 | 2 |
| D: 100 `agent()` calls with `LANGSMITH_TRACING_SAMPLING_RATE=0.25` | 203 | 29 | 29 |

Sampling is random per trace: 29 of 100 kept in this one run (expected ~25); whole traces are kept or dropped, child runs follow their root.

### OTel-only mode (same code, no LangSmith key)
langsmith 0.14.14 + opentelemetry-sdk/exporter 1.45.1, env `LANGSMITH_TRACING=true LANGSMITH_OTEL_ENABLED=true LANGSMITH_OTEL_ONLY=true OTEL_EXPORTER_OTLP_ENDPOINT=http://127.0.0.1:<port>`, no `LANGSMITH_API_KEY`. The unchanged `@traceable` code produced one `POST /v1/traces` (OTLP protobuf) with 7 spans in 1 trace (agent=chain, 3 tool, 3 llm via `langsmith.span.kind`). Decoded: `langsmith/otel-only-decoded.json`. We only watched the local sink; we did not capture other outbound traffic.

## Langfuse (langfuse 5.0.4, PyPI upload 21 Oct 2026)
Env: `LANGFUSE_HOST=http://127.0.0.1:<port>`, dummy public/secret keys. The SDK sent OTLP protobuf to `/api/public/otel/v1/traces`. Decoded (key attribute removed): `langfuse/req-*-decoded.json`; counts.txt:

| Scenario | Observations (spans) | Distinct trace ids |
|---|---|---|
| A | 7 (1 span, 3 tool, 3 generation) | 1 |
| B | 21 | 3 |
| C | 2 | 2 |

Langfuse's billable-units doc: "Units = Count of Traces + Count of Observations + Count of Scores". Our reading: scenario A = 1 + 7 = 8 units; B = 24; C = 4. We did not see a Langfuse bill.

## Install footprint (fresh venv, `pip install <pkg>`, before extras)
langsmith 0.14.14: 26 packages, 68 MB. langfuse 5.0.4: 29 packages, 51 MB (venv lib dir incl. ~12 MB pip). Not timed.

Files: capture_server.py, ls_trace_count.py, lf_trace_count.py, count_runs.py, count_spans.py, counts.txt, langsmith/req-*.jsonl (raw captured requests), decoded JSON.
This shows what the SDKs send, not what either vendor bills; check your own usage page.
