Instrument synchronous and asynchronous AI applications with provider-neutral events. Export portable
.rfr files or submit snapshots to the Refract REST service. Record model calls, tools, retrieval,
decisions, state changes, checkpoints and failures — then inspect, replay, fork and diff them.
Install
pip install llm-refract
MCP support is an optional extra:
pip install "llm-refract[mcp]"
SDK usage
import refract
with refract.run("agent", path="run.rfr"):
refract.event(type="generation", name="answer", output={"text": "Hello"})
Try python examples/python/basic/record.py after installing. Outputs go to .examples/.
See the Python usage guide for async patterns, redaction, failure capture and submitting to a remote endpoint.
MCP server
Executable stdio interface to the Rust Refract API: ten read-only tools, plus import/fork tools when
REFRACT_MCP_ALLOW_WRITES=1. Requires the mcp extra above. Start with:
refract-mcp
See configuration, tool inventory and limits.
Implementation: server.py.
Links
License
Apache-2.0 — see LICENSE.
Release files for llm-refract 0.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| llm_refract-0.1.3.tar.gz | 12.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| llm_refract-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.6 kB
Release files / llm_refract-0.1.3.tar.gz
| Download URL | llm_refract-0.1.3.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
af9789a4b58b9701a4d38ba435529eac2b0013b22739528e81eb7d7c896ee4e5
|
|
BLAKE2b-256 checksum How to use checksums |
6a4f09b9f3f6df86a708edc0310a4ed894a1827054bf8d17b8d45a238eb14c3f
|
| 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 Sep 20, 2026.
Transparency logRelease files / llm_refract-0.1.3-py3-none-any.whl
| Download URL | llm_refract-0.1.3-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7ec0697e42622d667b9943b77a841a9e83f06402d0b83c653673e6d0d645575a
|
|
BLAKE2b-256 checksum How to use checksums |
991ecdc7473ac8e09d0087bbd8120a0bf7279ce6e81939e98eef13e990691c6b
|
| 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 Sep 20, 2026.
Transparency log