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?
OpenLLMetry 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, Qdrant or Weaviate.
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.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 036cf591373dbd6e1f9393ef82725f54c1cec3ce0a3c3a01970fd8a3064b6ade |
|
MD5 | 2aaf2cf116a14e164e2854ab59694142 |
|
BLAKE2b-256 | 611165bd2f6b537f8ef26a5b7402c2d92257f5e87c8d5db7a20666c2c9d22774 |
Hashes for langtrace_python_sdk-1.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04740350d894be5a361faf7d211a8c6d0a1c30411371ea0fb76ef71f3cf6e997 |
|
MD5 | 05d64f69cd4566e845c1e0133d1135f6 |
|
BLAKE2b-256 | 3fbfd64a7129a2ba9894a45419d9cfcbe744499e1a1ecf80c34258d2e96e7def |