Storage API¶
Storage endpoints handle ingestion, retrieval, reconstruction, deletion, and listing of compressed data.
PUT — Ingest data¶
Compress and store a tensor or binary blob. The engine runs QTT-SVD decomposition, evaluates fidelity via the Oracle, and persists TT-cores to disk.
Request body¶
| Field | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Unique key within the namespace |
namespace |
string | No | Target namespace (default: default) |
data_b64 |
string | Yes | Base64-encoded NumPy array or raw bytes |
metadata |
object | No | Arbitrary JSON metadata attached to the entry |
domain |
string | No | Domain hint for Oracle (default: structured_data) |
Example¶
curl -X POST https://gate.holonomx.com/v1/put \
-H "X-Api-Key: $HX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"key": "sensor_reading_001",
"namespace": "telemetry",
"data_b64": "'$(python3 -c "import numpy as np, base64; print(base64.b64encode(np.random.randn(1024).tobytes()).decode())")'",
"metadata": {"source": "turbine_7", "unit": "Pa"}
}'
Response — 200 OK¶
{
"key": "sensor_reading_001",
"namespace": "telemetry",
"version": 1,
"compressed": true,
"verdict": "exact",
"compression_ratio": 12.5,
"original_bytes": 8192,
"stored_core_bytes": 655,
"n_cores": 10
}
| Field | Description |
|---|---|
version |
Auto-incremented version; each PUT to the same key creates a new version |
verdict |
Oracle quality assessment: exact, safe, weak, or passthrough |
compressed |
false if the data fell below the compression threshold |
compression_ratio |
Original bytes ÷ stored core bytes |
CU cost: 1.0
PUT Cores — Direct TT-core upload¶
Upload pre-decomposed TT-cores (skip engine-side SVD). Useful when the client has already performed decomposition.
CU cost: 1.0
CU cost: 2.0
GET — Retrieve metadata¶
Fetch compression fingerprint and metadata for a stored key. This does not reconstruct the dense array.
Path parameters¶
| Parameter | Type | Description |
|---|---|---|
namespace |
string | Target namespace |
key |
string | Entry key |
Query parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
version |
int | latest | Specific version to retrieve |
Example¶
Response — 200 OK¶
{
"key": "sensor_reading_001",
"namespace": "telemetry",
"version": 1,
"oracle_verdict": "exact",
"compression_ratio": 12.5,
"n_cores": 10,
"ranks": [1, 4, 8, 16, 16, 16, 8, 4, 2, 1],
"max_rank": 16,
"total_core_bytes": 655,
"original_bytes": 8192,
"metadata": {"source": "turbine_7", "unit": "Pa"},
"fingerprint": {
"frobenius_error": 1.2e-14,
"max_abs_error": 3.1e-15,
"relative_error": 1.5e-15
},
"created_at": 1712345678.123
}
CU cost: 0.1
SERVE — Reconstruct data¶
Decompress and return the full dense array, or load TT-cores directly into GPU VRAM for zero-copy serving.
Request body¶
| Field | Type | Required | Description |
|---|---|---|---|
key |
string | Yes | Entry key |
namespace |
string | No | Namespace (default: default) |
version |
int | No | Specific version (default: latest) |
target |
string | No | dense (default) or gpu |
device |
string | No | GPU device for target=gpu (default: cuda:0) |
Dense reconstruction¶
CU cost: 0.5
GPU serving¶
Load TT-cores directly into VRAM without dense materialization. The response confirms placement; subsequent operations reference the on-device cores.
gpu_result = hx.serve(
"sensor_reading_001",
target="gpu",
device="cuda:0",
namespace="telemetry",
)
print(gpu_result.gpu_core_bytes) # bytes in VRAM
CU cost: 2.0
DELETE — Remove entry¶
Soft-delete an entry. Tombstone is retained for compaction retention period (default 30 days).
CU cost: 0.1
LIST — Enumerate keys¶
List keys in a namespace, optionally filtered by prefix.
Query parameters¶
| Parameter | Type | Default | Description |
|---|---|---|---|
prefix |
string | "" |
Key prefix filter |
limit |
int | 1000 | Maximum results |
offset |
int | 0 | Pagination offset |
CU cost: 0.1