Metadata-Version: 2.4
Name: llmscope-kresnapandu
Version: 0.1.0
Summary: Self-hostable LLM observability SDK — trace, cost, and hallucination monitoring in one line.
Project-URL: Homepage, https://github.com/yourusername/llm-scope
Project-URL: Repository, https://github.com/yourusername/llm-scope
Project-URL: Issues, https://github.com/yourusername/llm-scope/issues
Author: llm-scope contributors
License: MIT
Keywords: llm,monitoring,observability,opentelemetry,tracing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25.0
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc>=1.20.0
Requires-Dist: opentelemetry-sdk>=1.20.0
Requires-Dist: tiktoken>=0.5.0
Requires-Dist: wrapt>=1.15.0
Provides-Extra: all
Requires-Dist: fastapi>=0.100.0; extra == 'all'
Requires-Dist: langchain-core>=0.1.0; extra == 'all'
Requires-Dist: starlette>=0.27.0; extra == 'all'
Provides-Extra: fastapi
Requires-Dist: fastapi>=0.100.0; extra == 'fastapi'
Requires-Dist: starlette>=0.27.0; extra == 'fastapi'
Provides-Extra: langchain
Requires-Dist: langchain-core>=0.1.0; extra == 'langchain'
Description-Content-Type: text/markdown

# llmscope SDK

Python SDK for [llm-scope](https://github.com/yourusername/llm-scope) — self-hostable LLM observability.

## Installation

```bash
pip install llmscope
# With all integrations:
pip install "llmscope[all]"
```

## Quick Start

```python
import llmscope
from openai import OpenAI

llmscope.init(
    endpoint="http://localhost:4317",
    service_name="my-app",
)

client = OpenAI()

with llmscope.trace_context(user_id="u_123", feature="chat"):
    response = client.chat.completions.create(
        model="gpt-4o-mini",
        messages=[{"role": "user", "content": "Hello!"}],
    )
```

## LangChain Integration

```python
from llmscope.integrations.langchain import LLMScopeCallbackHandler

handler = LLMScopeCallbackHandler(judge_faithfulness=True)
chain.invoke({"input": "..."}, config={"callbacks": [handler]})
```

## FastAPI Integration

```python
from fastapi import FastAPI
from llmscope.integrations.fastapi import LLMScopeMiddleware

app = FastAPI()
app.add_middleware(
    LLMScopeMiddleware,
    user_id_extractor=lambda req: req.headers.get("X-User-Id"),
)
```
