Python SDK for LangTrace
Project description
LangTrace
Looking for the Typescript version? Check out langtrace-typescript.
LangTrace is a set of extensions built on top of OpenTelemetry that gives you complete observability over your LLM application. Because it uses OpenTelemetry under the hood.
The repo contains standard OpenTelemetry instrumentations for LLM providers and Vector DBs, while still outputting standard OpenTelemetry data that can be connected to your observability stack. If you already have OpenTelemetry instrumented, you can just add any of our instrumentations directly.
🚀 Getting Started
The easiest way to get started is to use our SDK.
Install the SDK:
pip install langtrace-python-sdk
Then, to start instrumenting your code, just add this line to your code:
from langtrace_python_sdk import langtrace
langtrace.init()
That's it. You're now tracing your code with LangTrace! If you want to see the traces you can enable logging
langtrace.init(log_spans_to_console=True)
If you want to export traces to an external endpoint, you will need to add LANGTRACE_URL
to .env
file.
langtrace.init(write_to_remote_url=True)
🪗 What do we instrument?
LangTrace can instrument everything that OpenTelemetry already instruments - so things like your DB, API calls, and more. On top of that, we built a set of custom extensions that instrument things like your calls to OpenAI or Anthropic, or your Vector DB like Chroma, Pinecone
LLM Providers
- ✅ OpenAI / Azure OpenAI
- ✅ Anthropic
Vector DBs
- ✅ Chroma
- ✅ Pinecone
Frameworks
- ✅ LangChain
- ✅ LlamaIndex
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for langtrace-python-sdk-1.1.6.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 794697566bbbd64f0f3cb304e4f8194ea79c6670a96bcc6b1121f09e80f541c4 |
|
MD5 | 12c15a714dea75b9a02c1147c8f5fdfb |
|
BLAKE2b-256 | f734d413f722b4fafed1289ef3f438b1994929c7f427f1ec784ce9785e69fb66 |
Hashes for langtrace_python_sdk-1.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31506e20f220db47546a488713c9ff8589340e5dbde83fe266eb68a3e6f72ecd |
|
MD5 | ea323fa8cbfc339a535c016dd3e48ba4 |
|
BLAKE2b-256 | c484d15579c8469c1b9e708ede0e9a49719fcb9d482b8a0245f8e64cb8a5bd39 |