langobs-sdk
Python SDK for LangObs — real-time observability and debugging for AI agents.
Install
pip install langobs-sdk
With framework extras:
pip install "langobs-sdk[openai]"
pip install "langobs-sdk[anthropic]"
pip install "langobs-sdk[langchain]"
pip install "langobs-sdk[all]"
Prerequisites
Start the LangObs server first:
pip install langobs-server
langobs-server
# Server running at http://localhost:8766
Then open the dashboard at http://localhost:5173.
Usage
Option 1: Auto-instrument (recommended)
from langobs_sdk import auto_instrument
auto_instrument() # patches OpenAI + Anthropic clients automatically
# All subsequent OpenAI/Anthropic calls are traced — no other changes needed
import openai
client = openai.AsyncOpenAI()
response = await client.chat.completions.create(...)
Option 2: @trace decorator
from langobs_sdk import init, trace
init(server_url="ws://localhost:8766/ws")
@trace(name="my_agent")
async def my_agent(query: str) -> str:
result = await call_llm(query)
return result
Option 3: Manual spans
from langobs_sdk import get_tracer
async def my_agent(query: str) -> str:
with get_tracer().span("my_agent") as span:
span.set_attribute("query", query)
result = await call_llm(query)
span.set_output(result)
return result
Framework Integrations
LangChain
from langobs_sdk.interceptors.langchain_interceptor import LangObsCallbackHandler
handler = LangObsCallbackHandler()
chain = my_chain.with_config(callbacks=[handler])
CrewAI
from langobs_sdk import auto_instrument
auto_instrument() # CrewAI is auto-detected
AutoGen
from langobs_sdk import auto_instrument
auto_instrument() # AutoGen ConversableAgent is auto-detected
Configuration
from langobs_sdk import init
init(
server_url="ws://localhost:8766/ws", # LangObs server WebSocket URL
http_url="http://localhost:8766", # LangObs server HTTP URL
session_name="my-agent-v2", # Optional: name shown in dashboard
)
Design Principles
- Never raises exceptions — all SDK operations are silent on failure. Your agent always runs.
- Non-blocking — async, buffered, batch-sent. Adds <5ms overhead per traced call.
- Auto session management — creates a session on first event, closes it on process exit.
- Sensitive data redaction — fields named
api_key,token,password,secret,authorizationare automatically replaced with[REDACTED]. - Graceful degradation — if the server isn't running, events are silently dropped.
License
MIT
Metadata
Release files for langobs-sdk 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| langobs_sdk-0.2.0.tar.gz | 15.2 kB | Without provenance | Details for langobs_sdk-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| langobs_sdk-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for langobs_sdk-0.2.0-py3-none-any.whl |
Total release size: 33.5 kB
Release files / langobs_sdk-0.2.0.tar.gz
| Download URL | langobs_sdk-0.2.0.tar.gz |
|---|---|
| Size | 15.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a80c629af102d960341345d066985cc401812ccc650e52e3c8009263ba5c173b
|
|
BLAKE2b-256 checksum How to use checksums |
5be8b09dd29b7667c13641bf9b556239cdeaf8c942b415ef3c8d459450b12bcd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.5
|
Release files / langobs_sdk-0.2.0-py3-none-any.whl
| Download URL | langobs_sdk-0.2.0-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8beffbce964631da27c91bea060c6b175b54caa67e4222d1ebce6e3cd717a34b
|
|
BLAKE2b-256 checksum How to use checksums |
b6252f906e54dc0aedf1fa2d77866ee12928cd26528008820a959e7d844c76d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.5
|
Security for langobs-sdk 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.