---
name: biosimulant-onnx
title: Biosimulant ONNX Labs
description: Create and polish ONNX-backed Biosimulant labs with ONNX Runtime validation, graph-contract ports, conservative labels, and visual summaries.
version: 2026.05.23
tags: [biosimulant, onnx, onnxruntime, tensors, model-card]
audience: Claude Code, Cursor, Continue, Aider
recommended: false
---

# Biosimulant ONNX Labs

Use this skill for ONNX-backed Biosimulant labs.

Biosimulant wraps an ONNX artifact in a `BioModule`, wires graph-contract inputs/outputs through `lab.yaml`, and
publishes visual summaries plus README evidence without inventing labels not supported by the source metadata.

## Scientific Scope

ONNX execution validates artifact wiring and source-derived inference. It does not prove clinical safety, biological
truth, microscopy performance, protein function, or source-paper reproduction.

Do not present synthetic inference as scientific evidence. Label it as runtime smoke evidence unless source samples and
reference outputs are bundled and validated.

## Runtime Standard

Use open-source ONNX Runtime for kept ONNX wrappers. The `.onnx` artifact is the executable source-derived model
contract; graph inputs and outputs define what the Biosimulant wrapper may expose.

Validate:

- `.onnx` artifact exists
- upstream source metadata is traceable
- export provenance is documented where available
- graph loads in ONNX Runtime
- input/output names, dtypes, and shapes match wrapper ports
- synthetic or source-sample inference runs
- outputs are finite and non-empty

## Public Inputs

Public inputs must match the real graph or wrapper contract:

- image tensor, microscopy image tensor, CT volume, MRI volume
- token IDs, attention mask
- protein sequence token IDs, protein attention mask
- preprocessing option only when implemented
- raw tensor only when the graph contract truly requires it

Do not add text, image, tokenizer, or sequence preprocessing unless the files and behavior are bundled and validated.

Example public mappings:

```yaml
io:
  inputs:
    - name: ct_volume
      maps_to: core.ct_volume
      description: Already-preprocessed ONNX tensor for graph input `image`, shape `[1, 1, 128, 128, 128]`.
  outputs:
    - name: segmentation_prediction_tensor
      maps_to: core.segmentation_prediction_tensor
      description: Raw graph output `pred`; class/channel labels are only shown when source metadata provides them.
```

## Public Outputs

Use outputs that map to real graph outputs or real wrapper postprocessing:

- `classification_scores`
- `segmentation_prediction_tensor`
- `reconstruction_volume`
- `sequence_embeddings`
- `pooled_embedding`
- `feature_embedding`
- `prediction_summary`

Do not invent class labels, disease labels, tissue labels, channel labels, or biological semantics missing from source
metadata.

## Visuals

Good ONNX visuals include:

- provenance/model-card table
- graph input/output schema table
- output tensor statistics
- class-score bars only when labels are source-backed
- segmentation/mask summaries when output tensors support them
- embedding norms/stats when labels do not exist
- explicit synthetic-input caveat

Avoid long raw numeric tensor dumps as the primary visual. Summarize tensor shape, dtype, min/max, finite count,
channel stats, or top scores.

For structure-prediction or graph-like ONNX models, prefer a domain visual when supported by real outputs:

- 3D molecular structure viewer when coordinates or PDB/mmCIF-style outputs are produced
- graph/network visual when nodes and edges are actual model outputs or source metadata
- embedding projection only when the lab computes multiple comparable embeddings

If the ONNX artifact only emits tensors without source-backed semantics, show tensor evidence and caveats instead of
inventing biology.

## Validation

Run:

- manifest validation
- entrypoint validation
- Python compileall
- ONNX Runtime graph/session validation for every kept lab
- synthetic or source-sample inference for every kept lab
- visual smoke with real core outputs
- README asset audit
- no invented semantic label audit

## Orphan Rules

Orphan ONNX labs when:

- ONNX Runtime cannot load the artifact
- provenance cannot be traced
- the wrapper would require invented scientific meaning
- outputs are empty/non-finite
- graph contract and public ports cannot be reconciled
