Python SDK — auto-instrumentation
Stratix Python SDK reference — Stratix, AsyncStratix, complete resource surface, errors.
pip install layerlens --extra-index-url https://sdk.layerlens.ai/package. Sync and async. Source available at stratix-python.
Client classes
The SDK exposes four public client classes, all backed by the same API:
Stratix— primary sync client (authenticated, full surface)AsyncStratix— primary async client (authenticated, full surface)PublicClient— read-only client over the public catalog (no auth required)AsyncPublicClient— async variant ofPublicClient
from layerlens import Stratix, AsyncStratix, PublicClient, AsyncPublicClientResources
Models and benchmarks
`client.models`, `client.benchmarks` — get, get_by_key, add, create_custom, create_smart.
Comparisons
`client.public.comparisons` — compare, compare_models.
(see public-client)
Auto-instrumentation
The layerlens.instrument subpackage provides drop-in instrumentation for LLM provider clients and supported frameworks. Importing instrument_openai(), instrument_anthropic(), or framework callbacks like LangChainCallbackHandler wraps the client so trace data is emitted automatically as your code runs.
See Integrations for the production adapter list and framework integration pages for setup details.
Authentication
Environment variables:
LAYERLENS_STRATIX_API_KEY
(required)
Primary API key env var
LAYERLENS_STRATIX_BASE_URL
https://api.layerlens.ai/api/v1
Override for self-hosted / staging deployments
Sync vs async
Every resource is available in both sync (Stratix) and async (AsyncStratix) clients.
Quick reference — every public method by resource
The exact signatures are in each per-resource page below.
Adapters · CLI · Examples · Security · Troubleshooting
Deeper SDK material ported from the stratix-python repo:
Adapters
Per-framework + per-provider instrumentation guides (LangChain, LlamaIndex, CrewAI, OpenAI, Anthropic, Bedrock,...). Also: OTLP sink, Pydantic v1/v2 matrix, certification suite, testing.
Where to next
Last updated
Was this helpful?