# LangSmith: Projects and Setup — LLM Observability (Langfuse / LangSmith)

Source: https://www.skillbyai.com/en/llm-observability/lo-ls-setup

> Configure LangSmith tracing with environment variables and organise traces into projects.

## What LangSmith is

**LangSmith** is the observability and evaluation platform from the LangChain team. It is a managed service, with self-hosting available on enterprise plans. A common misconception is that it only works with LangChain: it does not. The `langsmith` SDK traces any Python or JS/TS code, and LangChain and LangGraph send traces to it automatically once tracing is enabled. Traces are grouped into **projects** (one per app or environment), and each step is a **run** with a `run_type` such as `chain`, `llm`, `tool`, `retriever`, `embedding`, `prompt` or `parser`. Beyond tracing, LangSmith offers **datasets and experiments** for offline evaluation, **feedback** on runs, **annotation queues** for human review, monitoring charts, and a prompt hub and playground. Configuration is mostly environment variables: turn tracing on, provide an API key, and name the project. Older code uses `LANGCHAIN_`-prefixed variable names, which are still widely seen; newer docs use the `LANGSMITH_` prefix.

## LangSmith building blocks

Runs nest into traces, traces live in projects, and selected runs flow into datasets that experiments evaluate.

![Four connected stages: runs, traces, projects, datasets and experiments.](assets/figures/llm-observability/section-4-map.svg) — Figure 4.1: runs -> traces -> projects -> datasets and experiments

## Enable tracing

Set these before your process starts. The project is created on first use if it does not exist.

```bash
pip install langsmith

export LANGSMITH_TRACING=true
export LANGSMITH_API_KEY="<your-api-key>"
export LANGSMITH_PROJECT="support-bot-dev"   # defaults to "default" if unset
```

**Quiz:** Which statement about LangSmith is correct?

- [ ] It can only trace applications built with LangChain
- [x] It can trace plain Python or JS/TS code through its SDK, not only LangChain apps
- [ ] It requires every run to be of type `llm`
- [ ] It stores traces only on the developer's laptop

*Answer:* It can trace plain Python or JS/TS code through its SDK, not only LangChain apps. The `langsmith` SDK's `@traceable` decorator and client wrappers work with any code; LangChain integration is a convenience, not a requirement.
