Python SDK for LENS local LLM observability
Project description
LENS Python SDK
Python tracing SDK for LENS local LLM observability.
Repository: https://github.com/Daboss57/lens
Install
Core client only:
pip install lens-python
With provider SDKs:
pip install "lens-python[providers]"
Or install one provider extra at a time:
pip install "lens-python[openai]"
pip install "lens-python[anthropic]"
pip install "lens-python[gemini]"
Quick Start
from lens import LensClient
client = LensClient.from_env()
client.record(
provider="openai",
model="gpt-5.4",
request={"messages": [{"role": "user", "content": "hello"}]},
response={"content": "hi"},
prompt_tokens=42,
completion_tokens=8,
latency_ms=512,
status="success",
)
Release Status
The SDK package metadata is set up for PyPI publishing and GitHub Actions release automation.
Environment
LENS_ENABLEDLENS_API_URLLENS_INGEST_PATHLENS_TIMEOUT_SECONDS
Provider Wrappers
lens.openailens.anthropiclens.gemini
Importing those modules patches the provider clients so model calls can be captured and forwarded to the LENS API.
Behavior
- sync + async client support
- silent-fail trace delivery when LENS is unavailable
- compatible with OpenAI, Anthropic, and Gemini wrappers
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lens_python-0.1.0.tar.gz.
File metadata
- Download URL: lens_python-0.1.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
182ccb0c95b4b04d8f8563b7c5c4f7d45ba9a965d3bf009a859549a895020679
|
|
| MD5 |
55a61abd2752d85abff29d40157cdb9e
|
|
| BLAKE2b-256 |
ae759ff7e07cc9b5b6553addd2f1b346cf3e953288d1ab4832c430801c3e1bbe
|
Provenance
The following attestation bundles were made for lens_python-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on Daboss57/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_python-0.1.0.tar.gz -
Subject digest:
182ccb0c95b4b04d8f8563b7c5c4f7d45ba9a965d3bf009a859549a895020679 - Sigstore transparency entry: 1107291615
- Sigstore integration time:
-
Permalink:
Daboss57/lens@ca3379c82c126514532e972f0b3945636ddda9ac -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/Daboss57
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ca3379c82c126514532e972f0b3945636ddda9ac -
Trigger Event:
push
-
Statement type:
File details
Details for the file lens_python-0.1.0-py3-none-any.whl.
File metadata
- Download URL: lens_python-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
25ab524a800461de3b864b5b564309aa30bbbd4f3c7c78d2e9331f62a2ad2c76
|
|
| MD5 |
749ee3f1159765db5b36f81f13af4bfe
|
|
| BLAKE2b-256 |
ac6a464620cfc2ffac69c68efb55b6a1bec9f9950a733516b3577ecf085c3b2b
|
Provenance
The following attestation bundles were made for lens_python-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on Daboss57/lens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
lens_python-0.1.0-py3-none-any.whl -
Subject digest:
25ab524a800461de3b864b5b564309aa30bbbd4f3c7c78d2e9331f62a2ad2c76 - Sigstore transparency entry: 1107291697
- Sigstore integration time:
-
Permalink:
Daboss57/lens@ca3379c82c126514532e972f0b3945636ddda9ac -
Branch / Tag:
refs/tags/sdk-v0.1.0 - Owner: https://github.com/Daboss57
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@ca3379c82c126514532e972f0b3945636ddda9ac -
Trigger Event:
push
-
Statement type: