Economic Instrumentation SDK
Project description
Econ Instrumentation SDK
LLM ROI tracking in production (value, cost, uncertainty) in <30 minutes.
Production-ready Python SDK for Regulus ECP telemetry:
- non-blocking execution/outcome telemetry transport
- hierarchical auto-instrumentation for LangGraph/LangChain/provider SDKs
- strict join-key continuity for business attribution
Install
pip install econ-instrumentation-sdk
With integrations:
pip install "econ-instrumentation-sdk[integrations]"
With OpenTelemetry bridge:
pip install "econ-instrumentation-sdk[otel]"
Quickstart (10 lines, real metric)
from econ_instrumentation import InstrumentationConfig, AutoInstrumentationConfig
from econ_instrumentation import configure, enable_auto_instrumentation, join_key_context
from econ_instrumentation import instrument_langchain_app, track_outcome, OutcomeEvent
configure(InstrumentationConfig(base_url="http://localhost:8000/v1", enabled=True))
enable_auto_instrumentation(AutoInstrumentationConfig(capture_mode="hierarchical"))
with join_key_context("CASE-123"):
app = instrument_langchain_app(chain, "SupportRefundTriage", "model_v2")
_ = app.invoke({"input": "refund?"})
track_outcome(OutcomeEvent(execution_id="out_case_123", join_key="CASE-123", capability_id="SupportRefundTriage", outcome_type="custom", outcome_value="approved"))
# then run: python3 demo/live_poc_simulation.py --days 2 --requests-per-day 40 --strict
# inspect AER + margin in demo/output/report_*.json
Capture modes
hierarchical(default): framework-first, provider fallback onlyall_layers: capture every layer and markprimary_for_rollupprovider_only: OpenAI/Anthropic-only capture
CLI
regulus init --base-url http://localhost:8000/v1
regulus demo --repo-root . --days 2 --requests-per-day 40 --strict
regulus compute --repo-root . --last 7d
Recommended env flags
export ECP_AUTO_INSTRUMENT=true
export ECP_CAPTURE_MODE=hierarchical
export ECP_INSTRUMENT_LANGCHAIN=true
export ECP_INSTRUMENT_OPENAI=true
export ECP_INSTRUMENT_ANTHROPIC=true
Compatibility (tested ranges)
openai >=1.40,<2.0anthropic >=0.34,<1.0langchain >=0.2,<0.4langgraph >=0.2,<0.4
Notes
- Prompts/responses are not captured by default (
capture_content=False). - Telemetry delivery never blocks inference path (buffer + background retries).
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 econ_instrumentation_sdk-0.1.1.tar.gz.
File metadata
- Download URL: econ_instrumentation_sdk-0.1.1.tar.gz
- Upload date:
- Size: 20.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d89454bec11f6fa67be6f565d595314a722524a343534db785aeae3a2cb15299
|
|
| MD5 |
41352879bd0b92524fb193068a6c268e
|
|
| BLAKE2b-256 |
3887810ea1e227a70c32e6f6b766bdb710b1fe230aa6b327d24dc7cecde63f83
|
File details
Details for the file econ_instrumentation_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: econ_instrumentation_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 31.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
04947c466bbe9fdbfc24f913e2b22acef78ea0bd9bdc014939b9ecdc4065211d
|
|
| MD5 |
b37d69da2c949b3240c8f35d93e8d4e5
|
|
| BLAKE2b-256 |
130b083d2012c70bf8c8bc86163b780f8f2a9fad9468492315600654764147c7
|