decorator-based function tracing with @traceable
Automatically instruments Python functions and async coroutines with distributed tracing via the @traceable decorator, which wraps function execution to capture inputs, outputs, latency, and errors as hierarchical run records sent to LangSmith. The decorator uses Python's functools.wraps and async context managers to maintain execution context without modifying function signatures, supporting both sync and async functions with automatic parent-child run linking via context variables.
Unique: Uses Python context variables (contextvars) to maintain implicit parent-child run relationships across async boundaries without explicit run ID threading, combined with automatic serialization of function signatures and return types to JSON for platform ingestion.
vs alternatives: Simpler than manual RunTree management and less intrusive than OpenTelemetry instrumentation, while providing LangSmith-native run linking without external tracing infrastructure.
manual run tree construction and management via runtree
Provides a RunTree class for explicit, hierarchical tracing of execution flows where developers manually create parent and child run nodes, set inputs/outputs, and manage run lifecycle (create, update, end). RunTree supports both sync and async contexts, handles batched persistence to LangSmith via background threads, and enables fine-grained control over run metadata, tags, and custom fields for complex workflows that don't fit decorator patterns.
Unique: Implements a tree-based run model where each node is independently updateable and can have multiple children, with background batching via internal queue that defers persistence to avoid blocking application code, supporting both sync and async contexts via language-specific concurrency primitives.
vs alternatives: More flexible than decorator-based tracing for non-function workflows, and more lightweight than full OpenTelemetry instrumentation while still providing structured run hierarchy.
opentelemetry integration for standards-based observability
Provides optional OpenTelemetry (OTEL) integration that exports LangSmith traces to OTEL-compatible backends (Jaeger, Datadog, New Relic), enabling LLM traces to be correlated with infrastructure metrics and logs. Integration is opt-in via environment variables (OTEL_EXPORTER_OTLP_ENDPOINT) and automatically bridges LangSmith run metadata to OTEL span attributes, supporting both Python and JavaScript SDKs.
Unique: Implements optional OTEL bridge that automatically converts LangSmith runs to OTEL spans and exports to configured backends, enabling LLM traces to be correlated with infrastructure observability without duplicate instrumentation.
vs alternatives: Enables LLM tracing to integrate with existing OTEL infrastructure, avoiding vendor lock-in while maintaining LangSmith-native features.
prompt management and versioning via client api
Provides Client methods (create_prompt, get_prompt, list_prompts) to store, version, and retrieve prompt templates in LangSmith, enabling teams to manage prompts as first-class artifacts with version history and metadata. Prompts are stored server-side with optional tags and descriptions, supporting retrieval by name or ID, enabling prompt experimentation and A/B testing without code changes.
Unique: Implements prompts as versioned server-side resources with metadata and tags, enabling teams to manage prompt evolution without code changes and retrieve specific versions by ID.
vs alternatives: More integrated than external prompt management tools and more flexible than hardcoded prompts, providing LangSmith-native versioning without additional infrastructure.
automatic llm provider wrapping (openai, anthropic)
Provides pre-built wrapper functions (wrap_openai, wrap_anthropic) that intercept API calls to popular LLM providers, automatically capturing request/response payloads, token counts, and model metadata as LangSmith runs without modifying application code. Wrappers patch the provider's client classes at runtime, extracting structured data from API responses and linking runs to parent execution context via context variables.
Unique: Uses runtime monkey-patching of provider client methods combined with context variable inheritance to automatically link LLM calls to parent runs without requiring explicit run ID threading, extracting structured metadata from provider-specific response objects.
vs alternatives: Simpler than manual instrumentation and more provider-specific than generic OpenTelemetry, providing automatic token counting and cost tracking without application code changes.
dataset creation and example management
Provides Client methods (create_dataset, create_example, list_examples) to programmatically build and manage test datasets in LangSmith, storing input-output pairs with optional metadata and tags. Datasets are versioned collections of examples that serve as ground truth for evaluation runs, supporting batch example creation via list operations and lazy-loaded pagination for large datasets.
Unique: Implements datasets as first-class LangSmith resources with server-side storage and versioning, supporting lazy-loaded pagination and batch example creation, enabling datasets to be shared across multiple evaluation runs and experiments without duplication.
vs alternatives: More integrated than external CSV/JSON storage and more flexible than hardcoded test cases, providing centralized dataset management with LangSmith-native versioning and reusability.
evaluation framework with runevaluator and experimentmanager
Provides an evaluation system where RunEvaluator classes score LLM outputs against ground truth examples, and ExperimentManager orchestrates batch evaluation runs across datasets. Evaluators implement a standard interface (evaluate method) that accepts run data and returns structured scores, supporting both synchronous and asynchronous evaluation logic. The framework batches evaluations, tracks results per example, and aggregates metrics for comparison across model versions.
Unique: Implements a pluggable evaluator interface where custom scoring logic is decoupled from orchestration, with ExperimentManager handling batching, result aggregation, and storage, enabling evaluators to be reused across multiple datasets and model versions.
vs alternatives: More flexible than hardcoded evaluation scripts and more integrated than external evaluation tools, providing LangSmith-native result tracking and comparison without data export.
asynchronous client with concurrent batch operations
Provides AsyncClient class that implements all Client operations (create_run, update_run, list_runs, create_dataset, etc.) as async/await coroutines, enabling concurrent execution of multiple API calls without blocking. Uses Python's asyncio library with connection pooling (httpx.AsyncClient) to efficiently handle high-throughput tracing and evaluation workloads, with automatic retry logic and exponential backoff for transient failures.
Unique: Mirrors the synchronous Client API exactly but uses asyncio and httpx.AsyncClient for non-blocking I/O, with automatic connection pooling and retry logic, enabling high-throughput tracing without thread overhead.
vs alternatives: More efficient than threading-based concurrency for I/O-bound operations, and more ergonomic than manual asyncio.gather() calls by providing a consistent async API.
+4 more capabilities