For the complete documentation index, see llms.txt. This page is also available as Markdown.

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 of PublicClient

from layerlens import Stratix, AsyncStratix, PublicClient, AsyncPublicClient

Resources

Client configuration

Stratix / AsyncStratix constructors, env vars, retries.

Read

Public client

`client.public.*` and `PublicClient` for catalog access.

Read

Models and benchmarks

`client.models`, `client.benchmarks` — get, get_by_key, add, create_custom, create_smart.

Read

Evaluations

`client.evaluations` — create, wait_for_completion, get_many.

Read

Scorers

`client.scorers` — LLM-backed graders.

Read

Judges

`client.judges` — create, get, get_many, update, delete.

Read

Judge optimizations

`client.judge_optimizations` — estimate, create, get, apply.

Read

Traces

`client.traces` — upload, get, get_many, delete, get_sources.

Read

Trace evaluations

`client.trace_evaluations` — create, get, get_results, estimate_cost.

Read

Results

`client.results` — get, get_all.

Read

Comparisons

`client.public.comparisons` — compare, compare_models.

(see public-client)

Errors

Full exception hierarchy.

Read

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:

Variable
Default
Notes

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.

Browse

CLI

`stratix` CLI — getting started, full command reference, 15 workflow recipes.

Browse

Examples

Runnable samples for evaluations, judges, traces, models, public catalog.

Browse

Security

API key management, data privacy, environment variables, rate limiting.

Browse

Troubleshooting

Authentication, common issues, error codes reference.

Browse

Where to next

Last updated

Was this helpful?