Hologram Python SDK
The Python package exposes a chainable graph builder on top of the stable
hologram-ffi source-builder ABI. Wheels build and bundle the Rust
hologram-ffi cdylib; hologram._hologram loads that library and implements
the SDK NativeBinding protocol.
import hologram as hg
g = hg.Graph("encoder")
x = g.input("x", dtype=hg.f32, shape=[2, 3])
w = g.const_ref("w", dtype=hg.f32, shape=[3, 2], file="weights.bin", blake3="0" * 64)
y = x.matmul(w, shape=[2, 2]).relu()
archive = g.output("y", y).compile()
with hg.Session.load(archive) as session:
assert session.input_dtype(0) == hg.f32
assert session.output_dtype(0) == hg.f32
assert session.extension("missing") is None
outputs = session.execute({"x": input_bytes})
y_bytes = outputs["y"]
Native Hologram .txt source can be compiled without constructing a
Graph object:
archive = hg.compile_source("input x :1\nop relu x :1 as=y\noutput y\n")
archive = hg.compile_source_file("graph.txt")
Native and SDK-side failures raise typed hg.HologramError subclasses with a
stable .code field:
try:
hg.Session.load(b"not-a-holo")
except hg.ArchiveLoadError as exc:
assert exc.code == 7
When the native compiler can locate source position, errors also expose
.line, .column, and .rejected:
try:
bad = hg.Graph("bad")
w = bad.const_ref("w", shape=[1], file="weights.bin", blake3="not-hex")
bad.output("w", w).compile()
except hg.ExternalTensorError as exc:
print(exc.code, exc.line, exc.column, exc.rejected)
The public error classes are ParseError, GraphError,
UnsupportedOpError, UnknownOpError, BadAttrError, ShapeError,
ExternalTensorError, ArchiveLoadError, ExecutionError,
AbiMismatchError, InvalidArgumentError, UnsupportedDTypeError, and
CompileError.
compile() requires a native binding module that implements the SDK
NativeBinding protocol. Tests can pass a fake binding directly:
archive = g.output("y", y).compile(native=my_binding)
const_ref is compile-time only. The native compiler reads the declared file
range, verifies the BLAKE3 digest, and embeds the bytes into the archive before
Session.load(...). Set HOLOGRAM_EXTERNAL_TENSOR_ROOT to force all resolved
external tensor paths under an explicit compile root.
Build a local wheel from the repository root:
python3 -m pip wheel sdk/python --no-deps -w /tmp/hologram-wheel
python3 -m pip install /tmp/hologram-wheel/*.whl
python3 sdk/python/scripts/smoke-installed.py
Metadata
Release files for uor-hologram 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| uor_hologram-0.13.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details |
| uor_hologram-0.13.0-py3-none-manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.28+ x86-64 | Details |
| uor_hologram-0.13.0-py3-none-macosx_11_0_x86_64.whl | Python 3 | none | macOS 11.0+ x86-64 | Details |
| uor_hologram-0.13.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details |
Total release size: 2.2 MB
Release files / uor_hologram-0.13.0-py3-none-win_amd64.whl
| Download URL | uor_hologram-0.13.0-py3-none-win_amd64.whl |
|---|---|
| Size | 461.6 kB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1baf190e5be8587cb8ad2f9e3631b95d71012868b0480c5113f2f6804d47867f
|
|
BLAKE2b-256 checksum How to use checksums |
9f63f736d74784ed60585197886dc925a6e14d1b27c093dbe601c48d9b0403e1
|
| 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 6, 2026.
Transparency logRelease files / uor_hologram-0.13.0-py3-none-manylinux_2_28_x86_64.whl
| Download URL | uor_hologram-0.13.0-py3-none-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 609.4 kB |
| Tags | Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
101049efd992f0a40fc84084f4bd33c38b638c8313e399fa625c4a23a60cc45c
|
|
BLAKE2b-256 checksum How to use checksums |
4400a1f8321b055cee7da6e607b51c2d7b64c655074fad00e1ccf93ed5e1a26b
|
| 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 6, 2026.
Transparency logRelease files / uor_hologram-0.13.0-py3-none-macosx_11_0_x86_64.whl
| Download URL | uor_hologram-0.13.0-py3-none-macosx_11_0_x86_64.whl |
|---|---|
| Size | 566.4 kB |
| Tags | Python 3 macOS 11.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
076578dc9bed76d4a1dee9b26a11dad02eda7387b55c6a1172f56476c5747e08
|
|
BLAKE2b-256 checksum How to use checksums |
9190c8110c2eec4858572414988522cec152392bf5b5a3944c5d7dd73e7e81d3
|
| 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 6, 2026.
Transparency logRelease files / uor_hologram-0.13.0-py3-none-macosx_11_0_arm64.whl
| Download URL | uor_hologram-0.13.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 520.4 kB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
89d53357ed117b0958e2d63787727c8c46b805095d36d39f3062b62531e4c1ce
|
|
BLAKE2b-256 checksum How to use checksums |
c353a35f44a219304322a09e8008adee3b4649c5a9fa9187e71ae3fd1f4201c0
|
| 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 6, 2026.
Transparency log