carl-core
Coherence math primitives for CARL — the foundational per-token field that every CARL metric derives from.
Install
pip install carl-core
Use
from carl_core import CoherenceTrace, compute_phi
# From logits:
trace = CoherenceTrace.from_logits(logits, token_ids=tokens, step=0)
print(trace.phi_mean, trace.cloud_quality, trace.carl_reward())
# Raw phi:
phi, probs, entropy = compute_phi(logits)
What's inside
CoherenceTrace— per-token coherence field (phi, entropy, selected_prob, delta_phi)CoherenceProbe/CoherenceSnapshot— probe + snapshot for training-step metricsCoherenceObserver— periodic Claude-backed training health assessmentFrameBuffer/FrameRecord— rolling temporal Phi buffercompute_phi()— order parameter from logits:phi = 1 - H/log|V|- Constants:
KAPPA = 64/3,SIGMA = 3/16,DEFECT_THRESHOLD,T_STAR(d) InteractionChain/Step/ActionType— typed interaction trace
Depends on
numpy, pydantic.
Part of
Carl Studio — Coherence-Aware Reinforcement Learning. Full docs: https://github.com/wheattoast11/carl
Metadata
Release files for carl-core 0.3.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| carl_core-0.3.1.tar.gz | 214.3 kB | With provenance | Details for carl_core-0.3.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| carl_core-0.3.1-py3-none-any.whl | Python 3 | none | any | Details for carl_core-0.3.1-py3-none-any.whl |
Total release size: 368.9 kB
Release files / carl_core-0.3.1.tar.gz
| Download URL | carl_core-0.3.1.tar.gz |
|---|---|
| Size | 214.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a1309d1be8c79feb40cb6049381dd23cba820235789faeca3283e6b6b012979
|
|
BLAKE2b-256 checksum How to use checksums |
4066cd02c9c37d2683ad7e465c20f3485d4e2ab3e729c8ec1a52c55336e8090e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logRelease files / carl_core-0.3.1-py3-none-any.whl
| Download URL | carl_core-0.3.1-py3-none-any.whl |
|---|---|
| Size | 154.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bdfc63699a12a334ae4cd2fed6ddcc5e59fc234b0d90ffd97c7d54af27d90c9c
|
|
BLAKE2b-256 checksum How to use checksums |
e112b7f64bac69afeb30b61069912669363997e4f25c016413bbe626da42a32c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logSecurity for carl-core 0.3.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for carl_core-0.3.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.