{"id":42581483,"url":"https://github.com/inference-labs-inc/dsperse","last_synced_at":"2026-01-28T22:09:43.597Z","repository":{"id":316125040,"uuid":"942236741","full_name":"inference-labs-inc/dsperse","owner":"inference-labs-inc","description":"Distributed zkML","archived":false,"fork":false,"pushed_at":"2026-01-27T19:31:32.000Z","size":146405,"stargazers_count":991,"open_issues_count":10,"forks_count":12,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-27T20:24:02.568Z","etag":null,"topics":["zkml"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/dsperse/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/inference-labs-inc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-03-03T19:44:18.000Z","updated_at":"2026-01-20T21:27:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"1506319d-1503-4e75-b6e3-a709a97e2012","html_url":"https://github.com/inference-labs-inc/dsperse","commit_stats":null,"previous_names":["inference-labs-inc/dsperse"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/inference-labs-inc/dsperse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inference-labs-inc%2Fdsperse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inference-labs-inc%2Fdsperse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inference-labs-inc%2Fdsperse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inference-labs-inc%2Fdsperse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/inference-labs-inc","download_url":"https://codeload.github.com/inference-labs-inc/dsperse/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/inference-labs-inc%2Fdsperse/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28853238,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T15:15:36.453Z","status":"ssl_error","status_checked_at":"2026-01-28T15:15:13.020Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["zkml"],"created_at":"2026-01-28T22:09:43.541Z","updated_at":"2026-01-28T22:09:43.591Z","avatar_url":"https://github.com/inference-labs-inc.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSperse: Distributed zkML\n\n[![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?style=flat-square\u0026logo=github)](https://github.com/inference-labs-inc/dsperse)\n[![Discord](https://img.shields.io/badge/Discord-Join%20Community-7289DA?style=flat-square\u0026logo=discord)](https://discord.gg/GBxBCWJs)\n[![Telegram](https://img.shields.io/badge/Telegram-Join%20Channel-0088cc?style=flat-square\u0026logo=telegram)](https://t.me/inference_labs)\n[![Twitter](https://img.shields.io/badge/Twitter-Follow%20Us-1DA1F2?style=flat-square\u0026logo=twitter)](https://x.com/inference_labs)\n[![Website](https://img.shields.io/badge/Website-Visit%20Us-ff7139?style=flat-square\u0026logo=firefox-browser)](https://inferencelabs.com)\n[![Whitepaper](https://img.shields.io/badge/Whitepaper-Read-lightgrey?style=flat-square\u0026logo=read-the-docs)](http://arxiv.org/abs/2508.06972)\n\nDSperse is a toolkit for slicing, analyzing, and running neural network models. It currently supports ONNX models, allowing you to break down complex models into smaller segments for detailed analysis, optimization, and verification.\n\n## Features\n\n- **Model Slicing**: Split neural network models into individual layers or custom segments\n- **ONNX Support**: Slice and orchestrate ONNX models\n- **Layered Inference**: Run inference on sliced models, chaining the output of each segment\n- **Zero-Knowledge Proofs**: Generate proofs for model execution via multiple backends:\n  - **JSTprove**: Fast, efficient ZK proof generation (default, with fallback)\n  - **EZKL**: Alternative ZK proof backend\n- **Flexible Backend Selection**: Choose backends per-layer or use automatic fallback\n- **Visualization**: Analyze model structure and performance\n\n## Documentation\n\nFor more detailed information about the project, please refer to the following documentation:\n\n- [Overview](docs/overview.md): A high-level overview of the project, its goals, and features\n- [Architecture](docs/arc42.md): Up-to-date architecture summary (arc42-style) reflecting the current CLI and ONNX-only support\n- [JSTprove Backend](docs/JSTPROVE_BACKEND.md): Detailed guide on JSTprove integration, backend selection, and usage examples\n\n## CLI shorthands and aliases\n\nCommands (subcommands):\n- slice (alias: s)\n- compile (alias: c)\n- run (alias: r)\n- prove (alias: p)\n- verify (alias: v)\n- full-run (alias: fr)\n\nCommon short flags:\n- Model path: -m, --mp, --model-dir, --model-path\n- Slices path/dir: -s, --sd, --slices, --slices-dir, --slices-directory, --slices-path (compile uses --slices-path; run uses --slices-dir)\n- Input file: -i, --if, --input, --input-file\n- Output file: -o, --output-file\n- Layers: -l, --layers (compile, full-run)\n- Run directory: --rd, --run-dir (prove, verify)\n- Save analysis (slice only): -S, --save, --save-file\n\nExamples:\n```bash\n# Slice (short form of command and flags)\ndsperse s -m models/net -o models/net/slices -S\n\n# Compile selected layers with calibration input\ndsperse c -s models/net/slices -i models/net/input.json -l 0-2\n\n# Run inference over slices with input and output paths (default backend behavior)\ndsperse r -s models/net/slices -i models/net/input.json -o models/net/output.json\n\n# Run inference forcing a backend when slices were compiled with multiple backends\n# Use -b jstprove | ezkl | onnx (onnx skips circuit backends entirely)\ndsperse r -s models/net/slices -i models/net/input.json -b jstprove\n\n# Prove and verify a specific run\ndsperse p --rd models/net/run/run_YYYYMMDD_HHMMSS\ndsperse v --rd models/net/run/run_YYYYMMDD_HHMMSS\n\n# Full pipeline (alias fr)\ndsperse fr -m models/net -i models/net/input.json\n```\n\n## Backend selection\n\n### Runtime backend flag (Runner)\n\nYou can select which backend to use at runtime when a slice was compiled with multiple circuit backends.\n\n- CLI:\n  ```bash\n  dsperse run -p models/net/slices -i models/net/input.json -b jstprove   # or -b ezkl | -b onnx\n  ```\n- Python:\n  ```text\n  from dsperse.src.run.runner import Runner\n  Runner().run(input_json_path=\"models/net/input.json\", slice_path=\"models/net/slices\", backend=\"ezkl\")\n  ```\n\nBehavior rules:\n- If a slice has both JSTprove and EZKL compiled, the selected backend is used for that slice.\n- If a slice has only one circuit backend compiled, the flag is ignored for that slice (unless you choose `onnx`, which skips circuit backends and uses pure ONNX).\n- If the selected backend fails on a slice that has multiple compiled backends, the runner falls back to the other compiled backend, then to ONNX.\n\nRun results record which backend generated the witness per slice in `run/run_YYYYMMDD_HHMMSS/run_results.json`.\n\n### Compile-time layer/backend selection\n\nYou can control which slices to compile and which backend(s) to use per slice using the `--layers/-l` argument along with the compiler's backend selection:\n\n- Plain layer list (compile those indices with default fallback behavior):\n  ```bash\n  dsperse compile -s models/net/slices -l 0,2,3-4\n  ```\n\n- Per-layer backend specification with groups separated by `;` and `index_or_range:backend` pairs:\n  ```bash\n  dsperse compile -s models/net/slices --backend \"2:jstprove;3-4:ezkl\"\n  ```\n\n- Mixed with default groups (compile with both backends) by using a bare group without `:`:\n  ```bash\n  # slice 0 -\u003e default (both backends)\n  # slice 2 -\u003e jstprove only\n  # slices 3-4 -\u003e ezkl only\n  dsperse compile -s models/net/slices --backend \"0;2:jstprove;3-4:ezkl\"\n  ```\n\nNotes:\n- Bare groups like `\"0\"` or `\"0,5-6\"` mean “default behavior (compile both backends)”.\n- Unspecified slices are skipped during compilation and will run with ONNX at runtime.\n\n### Prove and Verify alignment with witness backend\n\nThe prover and verifier automatically use the backend that produced the witness for each slice:\n- JSTprove slices use the JSTprove circuit and the binary witness produced at runtime.\n- EZKL slices use the EZKL compiled circuit, `pk.key` (prove) and `vk.key` (verify), and `settings.json` when available.\n\nResults are merged into `run_results.json` with per-slice `proof_execution` and `verification_execution` entries and counters by backend.\n\n## Installation\n\n### Install from PyPI\n\nThe simplest way to install DSperse is via PyPI:\n\n```bash\n# Using pip\npip install dsperse\n\n# Using uv (recommended)\nuv tool install dsperse\n```\n\nWhen installed via PyPI, all dependencies are automatically installed when you run a command for the first time, eliminating any manual setup.\n\n### Install from source\n\nPreferred: one-step installer script\n\n- Unix/macOS:\n  - Make sure you have Python 3.9+ available (and optionally a virtualenv activated).\n  - From the repo root:\n```bash\n./install.sh\n```\n  - The script will:\n    - Install the DSperse CLI in editable mode so the dsperse command is available\n    - Install EZKL (prompting for cargo or pip method if needed)\n    - Check EZKL SRS files (~/.ezkl/srs). It will offer to download them interactively (downloads can take a while) because having them locally speeds up circuitization/proving.\n\nNon-interactive/CI-friendly:\n```bash\n./install.sh -n\n```\n\nManual install\n\nIf you prefer to install manually or are on Windows:\n\n1) Create and activate a virtual environment (optional but recommended)\n\n```bash\npython -m venv venv\nsource venv/bin/activate  # Windows: venv\\Scripts\\activate\n```\n\n2) Install the DSperse CLI\n\n```bash\npip install -e .\n```\nThis exposes the dsperse command.\n\n3) Install ZK Backend CLIs\n\n**EZKL (optional, for EZKL backend):**\nRecommended via cargo (requires Rust):\n```bash\ncargo install --locked ezkl\n# Ensure $HOME/.cargo/bin is on your PATH\n```\nAlternative via pip:\n```bash\npip install -U ezkl\n# Note: CLI availability may vary by platform with the pip package. Verify with:\nezkl --version\n```\n\n**JSTprove (default backend):**\n```bash\nuv tool install jstprove\n# or: pip install jstprove\n```\nAlso requires Open MPI:\n```bash\nbrew install open-mpi  # macOS\n# or apt-get install openmpi-bin libopenmpi-dev  # Linux\n```\n\nVerify installation:\n```bash\njst --help\n```\n\n4) (Optional but recommended) Download EZKL SRS files\n\nSRS files are stored at ~/.ezkl/srs (kzg\u003cN\u003e.srs). They are needed for EZKL circuit setup/proving and downloading them ahead of time speeds things up.\n\nExample manual command to fetch one size:\n```bash\nezkl get-srs --logrows 20 --commitment kzg\n```\nRepeat for other logrows you need (commonly 2..21).\n\nNote: JSTprove does not require SRS files.\n\nQuickstart workflow\n\nBelow is an end-to-end walkthrough using the dsperse CLI. You can try it with the example model under models/net.\n\n1) Slice the model\n- You can provide either the model.onnx file or the model directory containing it.\n\nCommon examples:\n```bash\ndsperse slice --model-dir models/net\ndsperse slice --model-dir models/net/model.onnx\n```\n\nChoose output directory (default: models/net/slices):\n```bash\ndsperse slice --model-dir models/net --output-dir models/net/slices\n```\n\nOptionally save analysis metadata to a file (use --save-file; if flag is given without value, default path is model_dir/analysis/model_metadata.json):\n```bash\ndsperse slice --model-dir models/net --save-file\ndsperse slice --model-dir models/net --save-file models/net/analysis/model_metadata.json\n```\n\nWhat happens:\n- Slices are written to models/net/slices/slice_\u003ci\u003e/payload/slice_\u003ci\u003e.onnx\n- A model-level metadata.json is created at models/net/slices/metadata.json\n\n### Metadata Files Behavior\n\nDSperse creates different types of metadata files for different purposes:\n\n**Operational Metadata** (`metadata.json`):\n- **Location**: Always created in the output directory (e.g., `models/net/slices/metadata.json`)\n- **Purpose**: Contains segment information, paths, and parameters needed for circuitization and proving\n- **Created**: Automatically during slicing\n- **Used by**: compile, prove, verify commands\n\n**Analysis Metadata** (`model_metadata.json`):\n- **Location**: Created in `model_dir/analysis/` when using `--save-file` flag\n- **Purpose**: Detailed node-by-node analysis information for debugging and inspection\n- **Created**: Only when `--save-file` flag is used\n- **Used by**: Developers and analysts for model inspection\n\n**Important Notes:**\n- These are **two different files** serving different purposes\n- The operational metadata is essential for dsperse to function\n- The analysis metadata is optional and primarily for debugging\n- Both files contain similar top-level information but different levels of detail\n- **This behavior is intended** but can be confusing due to similar names and purposes\n\n2) Compile with ZK Backends (JSTprove or EZKL)\n- Compile either the whole model.onnx or the sliced segments (recommended for incremental proofs):\n\n**Default (Fallback Mode):**\n```bash\ndsperse compile --slices-path models/net/slices\n```\n- Tries JSTprove first\n- Falls back to EZKL if JSTprove fails\n- Falls back to ONNX (skip ZK compilation) if both fail\n\n**Single Backend:**\n```bash\ndsperse compile --slices-path models/net/slices --backend jstprove\ndsperse compile --slices-path models/net/slices --backend ezkl\n```\n\n**Per-Layer Backend Assignment:**\n```bash\ndsperse compile --slices-path models/net/slices --backend \"0,2:jstprove;3-4:ezkl\"\n```\n- Layer 0 and 2: Use JSTprove\n- Layer 3 and 4: Use EZKL\n- Unspecified layers use default backend\n\nOptional calibration input to improve settings:\n```bash\ndsperse compile --slices-path models/net/slices --input-file models/net/input.json\n```\n\nOptional layer selection (sliced models only):\n```bash\ndsperse compile --slices-path models/net/slices --layers 2,3,4\ndsperse compile --slices-path models/net/slices --layers 0-2\n```\n\nWhat happens:\n- For each selected segment, the chosen backend compiles the circuit\n- JSTprove: Circuit artifacts saved under `models/net/slices/slice_\u003ci\u003e/jstprove/`\n- EZKL: Circuit artifacts saved under `models/net/slices/slice_\u003ci\u003e/ezkl/`\n- Slices metadata is updated with compilation info per segment\n\nFor more details on backend selection and JSTprove integration, see [JSTprove Backend Documentation](docs/JSTPROVE_BACKEND.md).\n\nNote on missing slices:\n- If you pass a model directory without slices metadata present, the CLI will prompt you to slice first.\n\n3) Run inference\n- Runs a chained execution over the slices using ZK backends where available and falling back to ONNX per-segment on failure.\n\nCommon examples:\n```bash\ndsperse run --slices-dir models/net         # points to model dir (auto-detects slices)\ndsperse run --slices-dir models/net/slices  # or point directly to slices\n```\n\nYou will be prompted for an input file if not provided (default: model_dir/input.json).\n\nTo save the final output:\n```bash\ndsperse run --slices-dir models/net/slices --input-file models/net/input.json --output-file models/net/output.json\n```\n\nWhat happens:\n- A run metadata file is auto-generated at models/net/run/metadata.json if missing\n- A timestamped run directory is created: models/net/run/run_YYYYMMDD_HHMMSS/\n- Segment-by-segment inputs/outputs are saved under that run directory\n- A run_results.json is written summarizing the chain execution\n\n4) Generate proofs\n- Proves the segments that successfully produced witnesses in the selected run.\n\nTypical usage (new positional-args form):\n```bash\ndsperse prove models/net/run/run_YYYYMMDD_HHMMSS models/net/slices\n# data_path can also be a single slice_* dir, a .dslice, or a .dsperse\n# To write proofs under a custom root:\ndsperse prove models/net/run/run_YYYYMMDD_HHMMSS models/net/slices --proof-output /tmp/my_proofs\n```\n\nLegacy flags are still accepted for backward compatibility (will prompt for selection):\n```bash\ndsperse prove --run-dir models/net/run\n```\n\nOptionally save the updated run results to a separate file:\n```bash\ndsperse prove models/net/run/run_YYYYMMDD_HHMMSS models/net/slices --output-file models/net/proof_results.json\n```\n\nWhat happens:\n- For each segment with a successful witness, the CLI generates proofs\n- Proof files are stored under the specific run's segment folder\n- The run_results.json is updated with proof_execution details\n\n5) Verify proofs\n- Verifies the proofs generated in step 4 against the stored verification keys and settings.\n\nTypical usage (new positional-args form):\n```bash\ndsperse verify models/net/run/run_YYYYMMDD_HHMMSS models/net/slices\n# data_path can also be a single slice_* dir, a .dslice, or a .dsperse\n```\n\nLegacy flags are still accepted for backward compatibility (will prompt for selection):\n```bash\ndsperse verify --run-dir models/net/run\n```\n\nOptionally save verification results to a separate file:\n```bash\ndsperse verify models/net/run/run_YYYYMMDD_HHMMSS models/net/slices --output-file models/net/verification_results.json\n```\n\nWhat happens:\n- For each segment with a proof, the CLI verifies the proof\n- The run_results.json is updated with verification_execution details\n- A summary of verified segments is printed\n\nTips and troubleshooting\n\n- Backend CLI not found:\n  - JSTprove: Ensure `jst` is on your PATH (`uv tool install jstprove` or `pip install jstprove`) and Open MPI is installed\n  - EZKL: Ensure `ezkl` is on your PATH. If installed via cargo, add $HOME/.cargo/bin to PATH.\n- SRS files missing/slow downloads (EZKL only):\n  - You can skip downloads during install and fetch later with `ezkl get-srs --logrows \u003cN\u003e --commitment kzg`\n- Compile says \"slice first\":\n  - Run dsperse slice --model-dir \u003cmodel_dir\u003e to produce slices and metadata.json\n- Paths in saved JSON are absolute on your machine; sharing outputs across machines may require path adjustments.\n\nProject structure (updated)\n\n- src/\n  - slicer.py: orchestrator for slicing (uses OnnxSlicer)\n  - compiler.py: orchestrator for compilation (backend pipeline with fallback)\n  - runner.py: chained execution across segments (ZK backends or ONNX fallback)\n  - backends/\n    - onnx_models.py: ONNX inference utilities\n    - jstprove.py: JSTprove CLI bindings and circuitization pipeline\n    - ezkl.py: EZKL CLI bindings and circuitization pipeline\n  - cli/\n    - base.py: shared CLI helpers\n    - slice.py: slice command\n    - compile.py: compile command\n    - run.py: run command\n    - prove.py: prove command\n    - verify.py: verify command\n  - analyzers/: metadata generation for runs/slices\n  - utils/: common helpers\n- main.py: CLI entry point (dsperse)\n- install.sh: installer for CLI, EZKL, and optional SRS\n\nContributing\n\nContributions are welcome! Please feel free to open issues and PRs.\n\nLicense\n\nSee the LICENSE file for details.\n\n\n## End-to-end: full-run\n\nRun the entire pipeline (slice → compile → run → prove → verify) with a single interactive command.\n\nUsage:\n```bash\n# Kebab-case (preferred)\ndsperse full-run --model-dir path/to/model_or_dir --input-file path/to/input.json\n\n# Short alias also works\ndsperse fr --model-dir path/to/model_or_dir --input-file path/to/input.json\n```\n\nNotes:\n- You can pass a model directory that contains model.onnx or a direct path to model.onnx.\n- The command is interactive; if an argument is missing, it will prompt you (consistent with other subcommands).\n- Slices will be created under \u003cmodel_dir\u003e/slices unless you provide an existing one.\n- Proofs and verification use the latest run under \u003cmodel_dir\u003e/run by default.\n\nOptional flags:\n- --slices-dir: Reuse a pre-existing slices directory to skip the slicing step.\n- --layers: Restrict which layers to compile (same format as compile, e.g., \"3, 20-22\").\n\nExamples:\n```bash\n# One-shot end-to-end on the sample model\ncd src/models/net\n# if you have an input.json in this directory\ndsperse full-run --model-dir . --input-file ./input.json\n\n# From repo root, specifying paths explicitly\ndsperse full-run --model-dir src/models/resnet --input-file src/models/resnet/input.json\n\n# Reuse pre-sliced directory and only compile select layers\ndsperse full-run \\\n  --model-dir src/models/net \\\n  --slices-dir src/models/net/slices \\\n  --input-file src/models/net/input.json \\\n  --layers \"1, 3-5\"\n```\n\n\n## Slicing outputs and flags\n\nBy default, `dsperse slice` produces a single portable bundle named after your slices folder, e.g. `slices.dsperse`. When you pass `--output-dir models/net/slices`, the slicer stages files under `models/net/slices/` and then the converter creates `models/net/slices.dsperse` and cleans up the staging directory.\n\nWhat the `.dsperse` contains:\n- A top-level `metadata.json` describing the model and slices\n- All per-slice `.dslice` archives (one per slice)\n\nChoose the output format with `--output-type` (default: `dsperse`):\n- `--output-type dsperse` (default): creates `models/net/slices.dsperse` and removes `models/net/slices/`\n- `--output-type dslice`: creates `.dslice` files under `models/net/slices/` (and keeps `metadata.json`); removes intermediate `slice_#/` directories\n- `--output-type dirs`: keeps raw `slice_#/` directories with `payload/` and per-slice `metadata.json`\n\nExamples:\n```bash\n# Default: produce only slices.dsperse (staging dir cleaned up)\ndsperse slice -m models/net/model.onnx -o models/net/slices\n\n# Produce per-slice .dslice files in a directory (keeps metadata.json)\ndsperse slice -m models/net/model.onnx -o models/net/slices --output-type dslice\n\n# Keep unpacked slice_# directories\n dsperse slice -m models/net/model.onnx -o models/net/slices --output-type dirs\n```\n\nNotes:\n- The `.dsperse` bundle is a ZIP file; you can inspect it with any unzip tool.\n- Each `.dslice` inside the bundle is also a ZIP with its own `metadata.json` and `payload/model.onnx`.\n\n\n## Convert between formats\n\nUse `dsperse slice convert` (or the top-level `dsperse convert`) to go back and forth between single-file bundles and directory layouts. The converter auto-detects the input type; you specify the target with `--to {dirs, dslice, dsperse}`.\n\nSupported conversions:\n- slices.dsperse -\u003e directory (contains `*.dslice` + `metadata.json`; add `--expand-slices` to also create `slice_#/` folders)\n- directory (with `slice_#/` or `*.dslice` + `metadata.json`) -\u003e slices.dsperse\n- slice_X.dslice -\u003e directory (extracts to `slice_X/` with `payload/` and `metadata.json`)\n- directory (a single `slice_X/` folder with `payload/` + `metadata.json`) -\u003e slice_X.dslice\n\nUsage examples:\n```bash\n# 1) Unpack a bundle next to the file (default: keeps .dslice files, does not expand slices)\ndsperse slice convert -i models/net/slices.dsperse --to dirs\n\n# 1b) Unpack and also expand each embedded .dslice into slice_# folders\ndsperse slice convert -i models/net/slices.dsperse --to dirs --expand-slices\n\n# 1c) Preserve the input bundle instead of deleting it after a successful conversion\n dsperse slice convert -i models/net/slices.dsperse --to dirs --no-cleanup\n\n# 2) Create a .dsperse from a directory\n# If the input is a slices/ directory with slice_#/ subfolders, the converter will package and name it `\u003cdirname\u003e.dsperse`.\n dsperse slice convert -i models/net/slices --to dsperse\n\n# 3) Unpack a single .dslice to a directory\n dsperse slice convert -i models/net/slices/slice_1.dslice --to dirs -o models/net/slices/slice_1\n\n# 4) Create a .dslice from a slice directory (must contain metadata.json and payload/)\n dsperse slice convert -i models/net/slices/slice_1 --to dslice -o models/net/slices/slice_1.dslice\n```\n\nNotes:\n- If you omit --output, sensible defaults are chosen (e.g., extracting next to the input file with the same stem, or naming `\u003cdirname\u003e.dsperse`).\n- Use `--cleanup/--no-cleanup` to control whether the source artifact is deleted after a successful conversion (default: cleanup enabled for `.dsperse` sources).\n- The converter is the single source of truth for formats; CLI commands delegate to it to ensure consistent behavior and cleanup.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finference-labs-inc%2Fdsperse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finference-labs-inc%2Fdsperse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finference-labs-inc%2Fdsperse/lists"}