coalex
Python SDK for Coalex — AI governance observability for enterprises in regulated markets.
Built on OpenTelemetry.
Install
pip install coalex
# or
uv add coalex
Quick start
import coalex
coalex.register(api_key=os.environ["COALEX_API_KEY"], service_name="my-agent")
coalex.auto_instrument()
with coalex.coalex_context(agent_id="support-agent"):
answer = my_agent.run(question)
decision = coalex.evaluate(
request_id=request_id,
input={"question": question},
output={"answer": answer},
metrics={"answer": ["faithfulness"]},
)
Diagnostics
The SDK logs under the coalex logger and never configures logging for you — a library that
calls basicConfig takes over your application's log configuration, which is not its to take. It
attaches a NullHandler and leaves the rest to you.
To see what it is doing:
import logging
logging.basicConfig(level=logging.INFO) # your application's own setup
logging.getLogger("coalex").setLevel(logging.DEBUG)
| Logger | What you see |
|---|---|
coalex.context |
which agent id a span was attributed to, and where it came from |
coalex.auto_instrument |
which frameworks were instrumented, and which were found but could not be |
coalex.safe_exporter |
span export failures — the first few, then a heartbeat, so a key that breaks mid-run still surfaces |
coalex.inventory |
whether the agent's self-declaration was accepted, and the server's reason if not |
Without raising the level you still get warnings and errors — but only through Python's lastResort handler if your application configures none of its own, which prints with no timestamp, level or logger name and cannot be filtered.
No API key, proxy token or upstream credential reaches a log line or an exception message. Raising the level does not change that: it is a property of what is written, not of what is filtered.
Telemetry never breaks your agent
A failing Coalex endpoint drops spans; it does not raise into your code. evaluate() and
resolve() do raise, because a governance decision you asked for and did not get is not something
to swallow.
TypeScript
There is a TypeScript SDK, and it is smaller. See Python vs TypeScript before choosing.
Documentation
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 coalex-1.27.1.tar.gz.
File metadata
- Download URL: coalex-1.27.1.tar.gz
- Upload date:
- Size: 90.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1677dbb32f953cdc47da5745f6e46927218fbe858063ebe1e96a14a75ef5a0a8
|
|
| MD5 |
9267f96f724a871a83b5ffde3cbc5ca2
|
|
| BLAKE2b-256 |
c05f98a8c120a037076ad3ba1d8b7a52f71f7f2eed533c3e48c693ae42e63daa
|
File details
Details for the file coalex-1.27.1-py3-none-any.whl.
File metadata
- Download URL: coalex-1.27.1-py3-none-any.whl
- Upload date:
- Size: 62.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
uv/0.12.13 {"installer":{"name":"uv","version":"0.12.13","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf9d69b704f20fe94ff48814525042efcf767e118ce82c88a5b500c105419372
|
|
| MD5 |
b8443474977f8e5c6105d86eae403624
|
|
| BLAKE2b-256 |
c9845bb48445fd9b89f82c4133dbada02bb3ad3327e4bee2648a4a866e1e0cd3
|