Installation¶
Requirements¶
- Python 3.10–3.13 — tested on all four in CI. The core has a single runtime
dependency (
PyYAML); heavy libraries are opt-in extras. - A packaging tool — pip, uv, or poetry. Always install into a virtual
environment (
python -m venv .venv) so builds are reproducible. - Model credentials — e.g.
OPENAI_API_KEY— only if you call a real LLM. Provide them through the environment (see Configuration), never in code.
Install¶
The coordinated release uses SDK 0.3.2. Generated Python MCP projects require version 0.3.2 or newer.
# pick what you need
pip install langstitch-sdk # core only
pip install "langstitch-sdk[server,graph,llm,http]" # typical agent service
pip install "langstitch-sdk[all]" # everything
In your pyproject.toml:
[project]
dependencies = [
"langstitch-sdk>=0.3.2", # from PyPI
# extras: "langstitch-sdk[server,graph,llm,http]>=0.3.2"
]
Extras¶
Heavy dependencies are optional extras, so the core stays lightweight and safe to import anywhere (including tooling and codegen).
| Extra | Pulls in | Enables |
|---|---|---|
(core) |
PyYAML | decorators, config, registries, context, CLI scaffold |
server |
fastapi, uvicorn | langstitch run, create_app() (/health, /info, /invoke) |
graph |
langgraph, langchain-core | GraphBuilder.compile() → real StateGraph |
llm |
langchain | get_llm_provider() (+ a provider package, e.g. langchain-openai) |
http |
httpx | get_http_client() / external services |
mcp |
official MCP SDK | stdio, SSE and streamable HTTP tool clients |
compiler |
pydantic | IR v2 to Python project compilation |
tracing |
langsmith | tracing and graph registration helpers |
ingestion |
pypdf, python-docx, pytesseract, Pillow, langchain-core | document ingestion helpers; OCR also needs an external Tesseract installation |
all |
all optional runtime extras above | complete runtime dependencies; development tools are separate |
Lazy imports by design
Importing langstitch never imports FastAPI, LangGraph, LangChain, or httpx.
Each helper imports its dependency lazily and raises a clear, actionable error
if the extra is missing — so the core stays light and importable in CI.