CSF Core RT — Python SDK
v1.0 · Stable
Inference runtime for .csf model files produced by the CSF Core training framework.
Device-locked · Hardware-optimised · Precision-configurable.
Requirements
| Requirement | Minimum version |
|---|---|
| Python | 3.9 |
| Linux | x86-64 or ARM64 |
| CUDA (GPU) | 11.8 |
| ROCm (AMD GPU) | 5.6 |
| numpy | 1.22 |
GPU inference additionally requires torch>=2.0.
Installation
CSF Core RT is distributed via the MYELION private package registry.
A valid licence key is required to authenticate.
# Configure the MYELION registry
pip config set global.index-url https://pkg.myelion.com/simple/
pip config set global.extra-index-url https://pypi.org/simple/
# Install the SDK
pip install csfrt csfrt_ops
# Verify
python -c "import csfrt; print(csfrt.__version__)"
Licence Activation
Each device must be activated before the SDK will load models.
# Online activation
python -m csfrt.activate MYELION-XXXX-XXXX-XXXX
# Check status (no network required)
python -m csfrt.status
Air-gap environments:
# 1. Extract fingerprint on the isolated device
python -m csfrt.fingerprint
# → Copy the base64 string and send to zulal.tannur@myelion.com
# 2. After receiving license.mkey, deploy it:
sudo cp license.mkey /etc/csfrt/license.mkey
sudo chmod 644 /etc/csfrt/license.mkey
python -m csfrt.status
Quick Start
import csfrt
import numpy as np
# Load model — licence verified automatically
model = csfrt.load("model.csf")
# Synchronous inference
input_data = np.random.rand(1, 3, 512, 512).astype(np.float32)
result = model.infer(input_data)
print(result.shape) # → (1, num_classes)
API Reference
csfrt.load()
csfrt.load(
path: str,
device: str = "cuda",
precision: str = "fp16",
license: str | None = None,
num_threads: int = 4,
) -> CSFModel
| Parameter | Type | Description |
|---|---|---|
path |
str |
Path to the .csf model file. |
device |
str |
"cuda", "cpu", "cuda:N", or "rocm". |
precision |
str |
"fp16" (default) or "int8". |
license |
str | None |
Custom path to .mkey file. |
num_threads |
int |
CPU threads for preprocessing. Default 4. |
CSFModel.infer()
model.infer(
inputs: np.ndarray | torch.Tensor,
return_numpy: bool = True,
) -> np.ndarray | torch.Tensor
Synchronous inference. Blocks until the result is available.
CSFModel.infer_async()
future = model.infer_async(input_data)
do_other_work()
result = future.get(timeout=5.0)
Non-blocking inference. Returns a CSFInferenceFuture.
CSFStream
Real-time streaming with automatic micro-batching and callbacks.
from csfrt import CSFStream
def on_result(result, metadata):
print(f"Frame {metadata['frame_id']}: {result.shape}")
stream = CSFStream(
model_path="model.csf",
callback=on_result,
batch_size=4,
precision="fp16",
)
stream.start()
for frame in data_source:
stream.push(frame, metadata={"frame_id": frame.id})
stream.stop()
Precision Modes
| Mode | Flag | Notes |
|---|---|---|
| FP16 | "fp16" |
Default. Half-precision float. Recommended for GPU. |
| INT8 | "int8" |
~2× throughput. Requires calibration data in .csf file. |
Note: INT8 mode requires quantisation calibration data bundled into the
.csffile at training time. Models compiled without it will raiseCSFPrecisionError.
Exceptions
| Exception | When raised |
|---|---|
CSFLicenceError |
No valid token, or fingerprint mismatch. |
CSFLicenceExpiredError |
Token validity period elapsed. |
CSFModelError |
Corrupt/incompatible .csf file. |
CSFPrecisionError |
INT8 requested but model has no calibration data. |
CSFDeviceError |
Requested device not available. |
CSFShapeError |
Input shape does not match model specification. |
Docker
# CUDA (NVIDIA)
docker pull pkg.myelion.com/csfrt:1.0-cuda11.8
# ROCm (AMD)
docker pull pkg.myelion.com/csfrt:1.0-rocm5.6
# CPU only
docker pull pkg.myelion.com/csfrt:1.0-cpu
docker run --gpus all \
-v /etc/csfrt:/etc/csfrt:ro \
-v /path/to/model.csf:/model.csf:ro \
pkg.myelion.com/csfrt:1.0-cuda11.8 \
python inference.py
Benchmarking
python -m csfrt.bench model.csf --iterations 100 --batch 1
python -m csfrt.bench model.csf --precision fp16 int8 --compare
python -m csfrt.bench model.csf --output benchmark.json
Support
Documentation: myelion.com/docs
Licensing: zulal.tannur@myelion.com
Metadata
Release files for myelion-csf 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| myelion_csf-1.0.0-py3-none-any.whl | Python 3 | none | any | Details for myelion_csf-1.0.0-py3-none-any.whl |
Release files / myelion_csf-1.0.0-py3-none-any.whl
| Download URL | myelion_csf-1.0.0-py3-none-any.whl |
|---|---|
| Size | 66.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5eb92ac0fc24713e1692417fdc31bbe7ad45bf9e291aa42e3ce043f0c979522d
|
|
BLAKE2b-256 checksum How to use checksums |
3abeb6573c2a5650429dcb1fd093b42ac5f9bc34f72bf405ebb3629c45d7e30b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for myelion-csf 1.0.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.