From 77bbf53ebf38e47822a35aa7fd7fc4e4efaf64de Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Thu, 23 Apr 2026 20:40:55 +0000 Subject: [PATCH 1/2] docs: consolidate CLI documentation into cli_reference.md Create docs/cli_reference.md as the single comprehensive CLI reference. Simplify getting-started.md and README.md to brief examples with links to the full reference. - Move detailed --ep, --optimize, and all flag documentation to cli_reference.md - Add missing flags: --static-cache, --max-seq-len, --ep, --runtime - Document all subcommands: build, build-gguf, list, info - Replace docs/cli.md with the new comprehensive reference - Update toctree in docs/index.md - Add cross-reference from ep_quickstart.md Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu --- README.md | 15 +- docs/cli.md | 102 ------------ docs/cli_reference.md | 354 ++++++++++++++++++++++++++++++++++++++++ docs/ep_quickstart.md | 2 +- docs/getting-started.md | 111 ++----------- docs/index.md | 2 +- 6 files changed, 371 insertions(+), 215 deletions(-) delete mode 100644 docs/cli.md create mode 100644 docs/cli_reference.md diff --git a/README.md b/README.md index d5b27ad9..66f6edd8 100644 --- a/README.md +++ b/README.md @@ -95,26 +95,17 @@ See the [EP quickstart](docs/ep_quickstart.md) and ```sh mobius build --model Qwen/Qwen2.5-0.5B output_dir/ -# Build without weights (graph skeleton only) -mobius build --model meta-llama/Llama-3.2-1B output_dir/ --no-weights +# Build for CUDA with f16 +mobius build --model meta-llama/Llama-3.2-1B output_dir/ --ep cuda --dtype f16 # Build a diffusers pipeline (all components) mobius build --model Qwen/Qwen-Image-2512 output_dir/ # Build encoder-decoder model (produces encoder/model.onnx + decoder/model.onnx) mobius build --model openai/whisper-tiny output_dir/ - -# Specify dtype -mobius build --model meta-llama/Llama-3.2-1B output_dir/ --dtype f16 - -# Build with static KV cache (pre-allocated buffers, uses TensorScatter) -mobius build --model meta-llama/Llama-3.2-1B output_dir/ --static-cache - -# Static cache with explicit max sequence length -mobius build --model meta-llama/Llama-3.2-1B output_dir/ --static-cache --max-seq-len 2048 ``` -See the [CLI reference](https://onnxruntime.github.io/mobius/cli.html) for all options. +See the [CLI Reference](https://onnxruntime.github.io/mobius/cli_reference.html) for all subcommands and flags. ### Examples diff --git a/docs/cli.md b/docs/cli.md deleted file mode 100644 index 676a4e5d..00000000 --- a/docs/cli.md +++ /dev/null @@ -1,102 +0,0 @@ -# CLI Reference - -## Usage - -```bash -mobius [options] -``` - -## `build` — Export an ONNX model - -```bash -mobius build --model MODEL_ID OUTPUT_DIR [options] -``` - -The task is auto-detected from the model type. For example, Whisper models -automatically use `speech-to-text`, and standard LLMs use `text-generation`. - -### Options - -| Option | Description | -|--------|-------------| -| `--model MODEL_ID` | HuggingFace model identifier. | -| `--config PATH` | Local config directory (alternative to `--model`). | -| `--task TASK` | Model task (auto-detected if not specified). Use `list tasks` to see all available tasks. | -| `--external-data FORMAT` | External data format: `onnx` (default), `safetensors`. | -| `--max-shard-size SIZE` | Maximum shard size for safetensors (e.g. `5GB`). | -| `--no-weights` | Export graph structure only, without weight data. | -| `--dtype DTYPE` | Override model dtype: `f16`, `bf16`, `f32`. | -| `--trust-remote-code` | Trust remote code when loading the HuggingFace model config. | -| `--optimize [RULES]` | Apply rewrite rules after building. Use alone for all rules, or specify comma-separated names (e.g. `--optimize=group_query_attention,skip_norm`). | -| `--component NAME` | Build only one component from a diffusers pipeline (e.g. `--component vae_decoder`). | - -### Examples - -```bash -# Build from a HuggingFace model ID -mobius build --model Qwen/Qwen2.5-0.5B output_dir/ - -# Build without weights (graph skeleton only) -mobius build --model meta-llama/Llama-3.2-1B output_dir/ --no-weights - -# Build from a local config directory -mobius build --config /path/to/model/ output_dir/ - -# Export with safetensors external data -mobius build --model Qwen/Qwen2.5-0.5B output_dir/ --external-data safetensors - -# Build encoder-decoder model (produces encoder.onnx + decoder.onnx) -mobius build --model openai/whisper-tiny output_dir/ - -# Build a diffusers pipeline (auto-detected) -mobius build --model Qwen/Qwen-Image-2512 output_dir/ - -# Build only the VAE decoder from a diffusers pipeline -mobius build --model Qwen/Qwen-Image-2512 output_dir/ --component vae_decoder - -# Apply graph optimizations -mobius build --model Qwen/Qwen2.5-0.5B output_dir/ --optimize - -# Apply specific rewrite rules -mobius build --model Qwen/Qwen2.5-0.5B output_dir/ --optimize=group_query_attention,skip_norm - -# Override task explicitly -mobius build --model google/gemma-3-4b-pt output_dir/ --task vision-language -``` - -## `list` — Discover supported models, tasks, and dtypes - -```bash -mobius list {models,tasks,dtypes} -``` - -### Examples - -```bash -# List all 130+ supported model architectures -mobius list models - -# List all available tasks -mobius list tasks - -# List available dtype options -mobius list dtypes -``` - -## `info` — Inspect a model - -```bash -mobius info MODEL_ID [--trust-remote-code] -``` - -Shows model type, task, module class, and key config fields without building. - -### Examples - -```bash -# Inspect a transformers model -mobius info meta-llama/Llama-3.2-1B - -# Inspect a diffusers pipeline -mobius info Qwen/Qwen-Image-2512 -``` diff --git a/docs/cli_reference.md b/docs/cli_reference.md new file mode 100644 index 00000000..7c07c87c --- /dev/null +++ b/docs/cli_reference.md @@ -0,0 +1,354 @@ +# CLI Reference + +Complete reference for the `mobius` command-line interface. + +## Usage + +```bash +mobius [options] +``` + +## `mobius build` + +Build an ONNX model from a HuggingFace model ID or local config directory. + +### Synopsis + +```bash +mobius build --model MODEL_ID OUTPUT_DIR [options] +mobius build --config CONFIG_PATH OUTPUT_DIR [options] +``` + +The model task is auto-detected from the model type. For example, Whisper +models automatically use `speech-to-text`, standard LLMs use +`text-generation`, and diffusers pipelines are detected and built as +multi-component packages. + +### Arguments + +| Argument | Description | +|----------|-------------| +| `OUTPUT_DIR` | Output directory for the ONNX model files. Created if it doesn't exist. | + +### Source Options (mutually exclusive) + +| Option | Description | +|--------|-------------| +| `--model MODEL_ID` | HuggingFace model identifier (e.g. `meta-llama/Llama-3-8B`). Downloads config and weights from the Hub. | +| `--config CONFIG_PATH` | Path to a local model directory containing `config.json` (and optionally safetensors weights). Alternative to `--model`. | + +### Execution Provider (`--ep`) + +``` +--ep EP, --execution-provider EP +``` + +Target execution provider for EP-aware optimizations. Default: `default` +(portable ONNX with no vendor-specific fusions). + +EP-aware building drives the **entire** build pipeline — graph construction, +operator fusion, dead input removal, and KV cache sizing are all tailored +for the target EP. This is the recommended way to optimize for a specific +runtime or hardware target. + +#### Available Execution Providers + +| EP | Typical dtype | Description | +|----|---------------|-------------| +| `default` | any | Portable ONNX — no EP-specific vendor fusions (e.g. no GQA/PackQKV). Standard fusions are emitted as model local functions. | +| `cpu` | `f32` | ORT CPU inference — GQA fusion for FP32. | +| `cuda` | `f16` or `bf16` | NVIDIA GPU — GQA fusion, SkipNorm, PackQKV. | +| `dml` | `f16` | DirectML (Windows GPU) — GQA without fused RoPE. | +| `trt-rtx` | `f16` or `bf16` | NVIDIA TensorRT-RTX — GQA, no SkipLayerNorm. | +| `webgpu` | `f16` or `f32` | Browser / WebAssembly — Shape ops replaced with portable alternatives. | +| `onnx-standard` | any | Strict ONNX standard — zero custom-domain ops; safe for any conformant ONNX runtime. | + +Run `mobius list eps` to see all registered execution providers and their +capabilities. + +#### Examples + +```bash +# Default (portable ONNX with standard fusions as model local functions) +mobius build --model meta-llama/Llama-3.2-1B output/ + +# CPU (GQA fusion for f32) +mobius build --model meta-llama/Llama-3.2-1B output/ --ep cpu + +# CUDA GPU (GQA, SkipNorm, PackQKV fusions for f16/bf16) +mobius build --model meta-llama/Llama-3.2-1B output/ --ep cuda --dtype f16 + +# DirectML (GQA without fused RoPE) +mobius build --model meta-llama/Llama-3.2-1B output/ --ep dml --dtype f16 + +# TensorRT-RTX (GQA, no SkipLayerNorm) +mobius build --model meta-llama/Llama-3.2-1B output/ --ep trt-rtx --dtype f16 + +# WebGPU +mobius build --model meta-llama/Llama-3.2-1B output/ --ep webgpu --dtype f16 + +# Strict ONNX standard (zero custom ops) +mobius build --model meta-llama/Llama-3.2-1B output/ --ep onnx-standard +``` + +### Optimization Rules (`--optimize`) + +``` +--optimize [RULES] +``` + +Apply rewrite rules after building. Use without a value to apply all +available rules, or specify a comma-separated list of rule names. + +**Use `--optimize` only** for manual, targeted rewrite rule application. +Rules are applied post-hoc and do not affect graph construction. This is +useful for experimentation or when `--ep` doesn't cover a specific +optimization. + +#### Available Rules + +| Rule | Description | +|------|-------------| +| `group_query_attention` | Fuse multi-head attention into GroupQueryAttention. | +| `packed_attention` | Pack Q/K/V projections into a single MatMul. | +| `skip_norm` | Fuse skip connections with normalization. | +| `skip_layer_norm` | Fuse skip connections with LayerNorm. | +| `bias_gelu` | Fuse bias addition with GELU activation. | + +#### Examples + +```bash +# Apply specific rules +mobius build --model meta-llama/Llama-3.2-1B output/ \ + --optimize=group_query_attention,skip_norm + +# Apply all available rules +mobius build --model meta-llama/Llama-3.2-1B output/ --optimize + +# Combine EP-aware building with additional post-hoc rules +mobius build --model meta-llama/Llama-3.2-1B output/ \ + --ep cuda --dtype f16 --optimize=bias_gelu +``` + +### `--ep` vs `--optimize`: When to Use Which + +**Prefer `--ep`** for production builds. It affects both graph construction +and optimization (EP-aware KV cache sizing, dead input removal, operator +fusion), while `--optimize` only applies rewrite rules after the graph is +built. + +They can be combined when you need both EP-aware construction and additional +post-hoc rules: + +```bash +mobius build --model meta-llama/Llama-3.2-1B output/ \ + --ep cuda --dtype f16 --optimize=bias_gelu +``` + +### ORT GenAI Runtime (`--runtime`) + +``` +--runtime RUNTIME +``` + +Generate runtime-specific configuration files after building. Currently +supports `ort-genai`. + +When set to `ort-genai`, mobius writes `genai_config.json` and copies +tokenizer files to the output directory: + +- With `--model`: tokenizer files are downloaded from HuggingFace. +- With `--config` (local directory): tokenizer files are copied from that + directory. + +#### Example + +```bash +mobius build --model Qwen/Qwen2.5-0.5B output/ \ + --ep cuda --dtype f16 --runtime ort-genai +``` + +### Static Cache (`--static-cache`) + +``` +--static-cache +--max-seq-len N +``` + +Pre-allocate fixed-size KV cache buffers using TensorScatter. Useful when +the maximum sequence length is known up front. + +- `--static-cache` enables static cache mode. Requires models using + `DecoderLayer` or `MoEDecoderLayer`. +- `--max-seq-len N` sets the maximum sequence length for static cache + buffers. Only valid with `--static-cache`. Defaults to + `max_position_embeddings` from the model config. + +Cannot be combined with `--task`. + +#### Example + +```bash +mobius build --model meta-llama/Llama-3.2-1B output/ --static-cache + +# With explicit max sequence length +mobius build --model meta-llama/Llama-3.2-1B output/ --static-cache --max-seq-len 2048 +``` + +### Other Flags + +| Option | Description | +|--------|-------------| +| `--task TASK` | Model task (auto-detected if not specified). Use `mobius list tasks` to see available tasks. | +| `--dtype DTYPE` | Target dtype for model weights: `f16`, `bf16`, `f32` (also accepts `float16`, `bfloat16`, `float32`). Default: `f32`. Weights are cast at save time. | +| `--no-weights` | Export graph structure only, without weight data. Useful for inspection or testing. | +| `--external-data FORMAT` | External data format: `onnx` (default) or `safetensors`. | +| `--max-shard-size SIZE` | Maximum shard size for safetensors external data (e.g. `5GB`). Only used with `--external-data safetensors`. | +| `--trust-remote-code` | Trust remote code when loading the HuggingFace model config. | +| `--component NAME` | Build only one component from a diffusers pipeline (e.g. `--component vae_decoder`). | + +### More Examples + +```bash +# Build from a HuggingFace model ID +mobius build --model Qwen/Qwen2.5-0.5B output_dir/ + +# Build without weights (graph skeleton only) +mobius build --model meta-llama/Llama-3.2-1B output_dir/ --no-weights + +# Build from a local config directory +mobius build --config /path/to/model/ output_dir/ + +# Export with safetensors external data +mobius build --model Qwen/Qwen2.5-0.5B output_dir/ --external-data safetensors + +# Build encoder-decoder model (produces encoder.onnx + decoder.onnx) +mobius build --model openai/whisper-tiny output_dir/ + +# Build a diffusers pipeline (auto-detected) +mobius build --model Qwen/Qwen-Image-2512 output_dir/ + +# Build only the VAE decoder from a diffusers pipeline +mobius build --model Qwen/Qwen-Image-2512 output_dir/ --component vae_decoder + +# Override task explicitly +mobius build --model google/gemma-3-4b-pt output_dir/ --task vision-language + +# Build for ORT GenAI runtime +mobius build --model Qwen/Qwen2.5-0.5B output_dir/ \ + --ep cuda --dtype f16 --runtime ort-genai +``` + +--- + +## `mobius build-gguf` + +Build an ONNX model from a GGUF file (e.g. from llama.cpp). + +> **Note**: Requires the optional `gguf` package: `pip install mobius-ai[gguf]` + +### Synopsis + +```bash +mobius build-gguf GGUF_PATH [options] +``` + +### Arguments + +| Argument | Description | +|----------|-------------| +| `GGUF_PATH` | Path to a `.gguf` model file. | + +### Options + +| Option | Description | +|--------|-------------| +| `--output DIR`, `-o DIR` | Output directory. Default: `_onnx/`. | +| `--keep-quantized` | Preserve GGUF quantization as `MatMulNBits` (Q4_0/Q4_1/Q8_0). | +| `--dtype DTYPE` | Target dtype for model weights: `f16`, `bf16`, `f32`. | +| `--external-data FORMAT` | External data format: `onnx` (default) or `safetensors`. | + +### Examples + +```bash +# Basic GGUF conversion +mobius build-gguf model.gguf --output output/ + +# Preserve quantization +mobius build-gguf model.gguf --output output/ --keep-quantized + +# Convert with specific dtype +mobius build-gguf model.gguf --output output/ --dtype f16 +``` + +--- + +## `mobius list` + +List supported models, tasks, dtypes, or execution providers. + +### Synopsis + +```bash +mobius list {models,tasks,dtypes,eps} +``` + +### Resources + +| Resource | Description | +|----------|-------------| +| `models` | All supported model architectures with their default task and category. | +| `tasks` | Available task types (e.g. `text-generation`, `vision-language`). | +| `dtypes` | Supported dtype options with aliases. | +| `eps` | Registered execution providers with capabilities. | + +### Examples + +```bash +# List all 130+ supported model architectures +mobius list models + +# List all available tasks +mobius list tasks + +# List available dtype options +mobius list dtypes + +# List execution providers and their capabilities +mobius list eps +``` + +--- + +## `mobius info` + +Show information about a model without building it. Displays model type, +task, module class, and key config fields. + +### Synopsis + +```bash +mobius info MODEL_ID [--trust-remote-code] +``` + +### Arguments + +| Argument | Description | +|----------|-------------| +| `MODEL_ID` | HuggingFace model ID to inspect. | + +### Options + +| Option | Description | +|--------|-------------| +| `--trust-remote-code` | Trust remote code when loading the HuggingFace model config. | + +### Examples + +```bash +# Inspect a transformers model +mobius info meta-llama/Llama-3.2-1B + +# Inspect a diffusers pipeline +mobius info Qwen/Qwen-Image-2512 +``` diff --git a/docs/ep_quickstart.md b/docs/ep_quickstart.md index f0bf556e..9471f6cd 100644 --- a/docs/ep_quickstart.md +++ b/docs/ep_quickstart.md @@ -38,7 +38,7 @@ pkg = mobius.build("meta-llama/Llama-3.2-1B", pkg.save("output/llama/") ``` -CLI equivalent: +CLI equivalent (see [CLI Reference](cli_reference.md) for all `--ep` options): ```bash mobius build --model meta-llama/Llama-3.2-1B output/ \ diff --git a/docs/getting-started.md b/docs/getting-started.md index 667d148f..71400fcc 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -180,115 +180,28 @@ Or via CLI: mobius build --model Qwen/Qwen2.5-0.5B output/ --ep cuda --dtype f16 ``` -## CLI Reference - -The package provides the `mobius` CLI with these subcommands: - -### `build` — Build an ONNX model from HuggingFace - -```bash -# From a HuggingFace model ID -mobius build --model meta-llama/Llama-3.2-1B output/ - -# From a local config directory (with safetensors weights) -mobius build --config /path/to/model/ output/ - -# Target a specific execution provider (recommended) -mobius build --model Qwen/Qwen2.5-0.5B output/ \ - --ep cuda --dtype f16 - -# Export for ORT GenAI runtime -mobius build --model Qwen/Qwen2.5-0.5B output/ \ - --ep cuda --dtype f16 --runtime ort-genai -``` - -Key flags: -- `--dtype` — Target dtype (`f32`, `f16`, `bf16`) -- `--ep` — Target execution provider (see below) -- `--runtime` — Target runtime format (`ort-genai`) -- `--no-weights` — Build graph only (no weight download) -- `--external-data` — `onnx` (default) or `safetensors` -- `--optimize` — Apply individual rewrite rules (see below) -- `--component` — Build only one component from a diffusers pipeline - -#### `--ep` vs `--optimize`: when to use which - -**Use `--ep` (recommended)** when building for a known runtime/hardware target. -It drives the entire build pipeline — graph construction, operator fusion, -dead input removal, and KV cache sizing are all tailored for the target EP: +## CLI Quick Start ```bash -# Default (portable ONNX with standard fusions as model local functions) +# Basic build mobius build --model meta-llama/Llama-3.2-1B output/ -# CPU (GQA fusion for f32) -mobius build --model meta-llama/Llama-3.2-1B output/ --ep cpu - -# CUDA GPU (GQA, SkipNorm, PackQKV fusions for f16/bf16) +# Build for CUDA with f16 mobius build --model meta-llama/Llama-3.2-1B output/ --ep cuda --dtype f16 -# DirectML (GQA without fused RoPE) -mobius build --model meta-llama/Llama-3.2-1B output/ --ep dml --dtype f16 - -# TensorRT-RTX (GQA, no SkipLayerNorm) -mobius build --model meta-llama/Llama-3.2-1B output/ --ep trt-rtx --dtype f16 - -# WebGPU -mobius build --model meta-llama/Llama-3.2-1B output/ --ep webgpu --dtype f16 - -# Strict ONNX standard (zero custom ops) -mobius build --model meta-llama/Llama-3.2-1B output/ --ep onnx-standard +# Build for ORT GenAI runtime +mobius build --model meta-llama/Llama-3.2-1B output/ --ep cuda --dtype f16 --runtime ort-genai ``` -Run `mobius list eps` to see all available execution providers. +The `mobius` CLI has these subcommands: -**Use `--optimize` only** for manual, targeted rewrite rule application on -a pre-built model. Rules are applied post-hoc and do not affect graph -construction. This is useful for experimentation or when `--ep` doesn't -cover a specific optimization: - -```bash -# Apply specific rules -mobius build --model meta-llama/Llama-3.2-1B output/ \ - --optimize=group_query_attention,skip_norm +- **`build`** — Build an ONNX model from a HuggingFace model ID or local config. +- **`build-gguf`** — Convert a GGUF file to ONNX. +- **`list`** — List supported models, tasks, dtypes, or execution providers. +- **`info`** — Inspect a model without building it. -# Apply all available rules -mobius build --model meta-llama/Llama-3.2-1B output/ --optimize - -# Combine EP-aware building with additional post-hoc rules -mobius build --model meta-llama/Llama-3.2-1B output/ \ - --ep cuda --dtype f16 --optimize=bias_gelu -``` - -Available rules: `group_query_attention`, `skip_norm`, `skip_layer_norm`, -`packed_attention`, `bias_gelu`. - -> **Tip**: Prefer `--ep` over `--optimize` for production builds. `--ep` -> affects both graph construction and optimization (EP-aware KV cache -> sizing, dead input removal, operator fusion), while `--optimize` only -> applies rewrite rules after the graph is built. They can be combined -> when you need both EP-aware construction and additional post-hoc rules. - -### `build-gguf` — Build from a GGUF file - -```bash -mobius build-gguf model.gguf --output output/ -``` - -### `list` — List supported resources - -```bash -mobius list models # All supported architectures -mobius list tasks # Available task types -mobius list dtypes # Supported dtypes -mobius list eps # Available execution providers -``` - -### `info` — Inspect a model - -```bash -mobius info meta-llama/Llama-3.2-1B -``` +For the full CLI reference including all flags, execution providers, and +optimization options, see [CLI Reference](cli_reference.md). ### Adding a new model diff --git a/docs/index.md b/docs/index.md index c0f9b11c..103db335 100644 --- a/docs/index.md +++ b/docs/index.md @@ -11,7 +11,7 @@ Build ONNX models directly from HuggingFace model IDs with automatic weight down :caption: User Guide getting-started -cli +cli_reference module-architecture model-catalog models/index From 2c6cd12f41a14d6e246d4add6839c54f0764a281 Mon Sep 17 00:00:00 2001 From: Justin Chu Date: Thu, 23 Apr 2026 13:50:03 -0700 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Justin Chu --- docs/cli_reference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli_reference.md b/docs/cli_reference.md index 7c07c87c..02ba0a16 100644 --- a/docs/cli_reference.md +++ b/docs/cli_reference.md @@ -35,7 +35,7 @@ multi-component packages. | Option | Description | |--------|-------------| | `--model MODEL_ID` | HuggingFace model identifier (e.g. `meta-llama/Llama-3-8B`). Downloads config and weights from the Hub. | -| `--config CONFIG_PATH` | Path to a local model directory containing `config.json` (and optionally safetensors weights). Alternative to `--model`. | +| `--config CONFIG_PATH` | Path to a local model directory containing `config.json`. Safetensors weights are also required unless `--no-weights` is provided; use `--no-weights` to build from a config-only directory. Alternative to `--model`. | ### Execution Provider (`--ep`) @@ -200,7 +200,7 @@ mobius build --model meta-llama/Llama-3.2-1B output/ --static-cache --max-seq-le | Option | Description | |--------|-------------| | `--task TASK` | Model task (auto-detected if not specified). Use `mobius list tasks` to see available tasks. | -| `--dtype DTYPE` | Target dtype for model weights: `f16`, `bf16`, `f32` (also accepts `float16`, `bfloat16`, `float32`). Default: `f32`. Weights are cast at save time. | +| `--dtype DTYPE` | Target dtype for model weights: `f16`, `bf16`, `f32` (also accepts `float16`, `bfloat16`, `float32`). If omitted, the dtype is auto-detected from the HuggingFace config (`torch_dtype`); provide `--dtype` to override it. Weights are cast at save time. | | `--no-weights` | Export graph structure only, without weight data. Useful for inspection or testing. | | `--external-data FORMAT` | External data format: `onnx` (default) or `safetensors`. | | `--max-shard-size SIZE` | Maximum shard size for safetensors external data (e.g. `5GB`). Only used with `--external-data safetensors`. |