geno_lewm.deploy.runtime¶
runtime
¶
On-device runtime contract and fail-closed network guard.
BackendProbe
dataclass
¶
Capability probe result for one runtime backend.
GenoLeWMRuntime
¶
GenoLeWMRuntime(model_dir: str | Path, backend: str = BACKEND_AUTO, *, encoder: object | None = None, action_encoder: object | None = None, predictor: object | None = None, calibration: CalibrationTable | None = None)
Top-level runtime facade for on-device inference workflows.
Source code in geno_lewm/deploy/runtime.py
score_variant
¶
score_variant(variant: EditSpec, window: str | None = None, *, window_start_bp: int = 0, receipt_path: str | Path | None = None) -> Any
Score a single variant through local scorer components when available.
Source code in geno_lewm/deploy/runtime.py
score_vcf
¶
score_vcf(vcf_path: str | Path, fasta_path: str | Path, output_path: str | Path, batch_size: int = 64, progress: bool = True, *, receipt_path: str | Path | None = None) -> None
Score a VCF through local scorer components when available.
When receipt_path is provided, the runtime writes JSONL with
one canonical v1 receipt per scored alternate. The v1 schema
commits a single output, so this is intentionally not a batch
aggregate receipt.
Source code in geno_lewm/deploy/runtime.py
encode_window
¶
Encode a DNA window once the encoder backend is installed.
Source code in geno_lewm/deploy/runtime.py
predict
¶
Run the predictor once a predictor backend is installed.
Source code in geno_lewm/deploy/runtime.py
probe_backends
¶
Probe runtime backends in runtime contract auto-selection order.
Source code in geno_lewm/deploy/runtime.py
select_backend
¶
Select a backend from probe results, or raise if the requested one is unavailable.
Source code in geno_lewm/deploy/runtime.py
fail_closed_network_guard
¶
Block common network entry points inside an inference path.
Source code in geno_lewm/deploy/runtime.py
load_scorer_modules
¶
Load (encoder, action_encoder, predictor) from a model dir without calibration.
Used by calibration-table generation, which must run the model over a
background set before calibration.parquet exists and therefore cannot
use :class:GenoLeWMRuntime (whose scorer requires a calibration artifact).
Requires geno-lewm[train] (torch + transformers + safetensors) and a
manifest.json plus the exported predictor/action_encoder
safetensors artifacts.
Source code in geno_lewm/deploy/runtime.py
load_action_predictor_modules
¶
Load (action_encoder, predictor) from a model dir without Carbon.
Rollout-fidelity state row generation consumes already encoded source and
target latent states, so it only needs the action encoder and predictor.
Keeping this path independent of transformers and local Carbon weights
prevents an unused encoder runtime from blocking release evidence.