pai-export-policy
Skill8 starsChanged 2 days agoApache-2.0View on GitHub
Exports and validates a trained Physical AI Studio policy for Runtime deployment. Use when calling policy.export or physicalai export with an existing checkpoint, choosing ONNX/OpenVINO/Torch/ExecuTorch, checking numerical parity and export metadata, or preparing an artifact for InferenceModel. DO NOT USE FOR implementing a new export backend in Studio source.
In this repository42 other files it gives its agents.
- agent-harness-installSkill
- anomalib-adding-a-datamoduleSkill
- anomalib-adding-a-modelSkill
- anomalib-benchmarkingSkill
- anomalib-tiled-ensembleSkill
- anomalib-trainingSkill
- chatqna-docker-deploySkill
- chatqna-helm-deploySkill
- dlsps-userSkill
- dlstreamer-coding-agentSkill
- edgemart-agent-mcpSkill
- edgemart-stack-deploySkill
- edgemart-store-servicesSkill
- getitune-discovering-modelsSkill
- getitune-exporting-a-modelSkill
- getitune-optimizing-a-modelSkill
- getitune-preparing-datasetsSkill
- getitune-running-inferenceSkill
- getitune-training-a-modelSkill
- geti-using-the-pipelineSkill
- manufacturing-ai-app-builderSkill
- manufacturing-app-recipeSkill
- metro-ai-app-builderSkill
- metro-ai-app-recipeSkill
- model-download-userSkill
- multimodal-dataprep-userSkill
- multimodal-embedding-serving-userSkill
- openedge-cliSkill
- pai-benchmark-policySkill
- pai-configure-inferenceSkill
- pai-load-policySkill
- pai-run-policySkill
- pai-train-policySkill
- pai-work-with-datasetsSkill
- scenescape-setupSkill
- time-series-analytics-userSkill
- uav-mission-compute-sdkSkill
- vss-deploy-helmSkill
- vss-deploySkill
- vss-search-indexSkill
- vss-summarize-videoSkill
- skill-nameSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 3 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 27
Run export → inspect artifact and manifest → check numerical parity → fix the project's inputs/config → repeat:
- Distinctive: line 36
Treat parity (correctness) and latency/warmup (deployment viability) as separate checks.
- Distinctive: line 50
Only describe deployment as supported when Runtime has a matching adapter or documented companion.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Exporting and Validating Studio Policies
The physicalai-train package exposes ExportBackend (onnx, openvino, torch, executorch) and policy.export(output_dir, backend=...); physicalai export offers the CLI equivalent. Studio owns export; Runtime owns loading. See the export how-to and Runtime's manifest schema.
Workflow
- Identify the inputs: installed policy class (e.g.
physicalai.policies.ACT),.ckptpath, target backend, and the Runtime loader behavior expected for that backend.- Done when: all four are pinned before exporting.
- Pick the route and keep both consistent — they must produce the same artifact:
- Python:
policy.export(output_dir, backend=ExportBackend.ONNX). - CLI:
physicalai export --policy physicalai.policies.ACT --ckpt_path model.ckpt --backend onnx --output_dir ./export.
- Python:
- Read backend constraints before exporting. See the backend reference for the target (
references/<backend>.md). If the selected policy/backend combination is unsupported, explain the constraint instead of modifying Studio source as part of a customer export. - Export, then validate numerical parity against the Torch policy path on representative inputs. Parity proves correctness.
- Done when: max abs/rel diff on sample inputs is within the family's tolerance, or the divergence is understood and documented.
- Validate artifact structure and metadata against Runtime's manifest schema.
- Done when: the expected model file and metadata files exist, and input/output/feature names match Runtime preprocessing.
- Confirm the Runtime path. For deployment-bound artifacts, verify Runtime can auto-detect (by extension) or explicitly load the backend via
InferenceModel(...).
Validation loop
Run export → inspect artifact and manifest → check numerical parity → fix the project's inputs/config → repeat:
# from your project directory
physicalai export --policy <ClassPath> --ckpt_path <model.ckpt> --backend <backend> --output_dir ./exportFor an API integration, load the same checkpoint, call policy.export("./export-api", backend=ExportBackend.<BACKEND>), and compare artifact metadata with the CLI output. If export fails because of the policy implementation, report the failure to its maintainer rather than changing Studio internals here.
Treat parity (correctness) and latency/warmup (deployment viability) as separate checks; passing one does not imply the other.
Backend notes
- onnx / openvino — deployment-oriented; Runtime core ships adapters, so artifacts load when deps are installed.
- torch — development/debugging; only claim deployment support when a matching Runtime adapter is installed and documented.
- executorch — optional, dependency-sensitive, edge/mobile; Runtime core ships no adapter in this package. Treat as available only with a documented companion distribution.
Required checks
- Export directory contains the expected backend model file and metadata files.
- Metadata names inputs/outputs/features consistently with Runtime preprocessing and action-chunk semantics.
- Python API export and CLI export produce equivalent artifact structure and metadata.
- The selected backend dependency is installed; report missing optional packages with their install guidance.
- Only describe deployment as supported when Runtime has a matching adapter or documented companion.
References
- Runtime manifest schema — canonical artifact structure.
references/onnx.md,references/openvino.md,references/torch.md,references/executorch.md— per-backend constraints.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

