Skip to main content
Domyn Swarm

Deploy LLMs and run resumable batch inference on Slurm and NVIDIA DGX Cloud Lepton.

domyn-swarm is a CLI and Python library that combines model deployment and batch processing in one workflow. vLLM handles inference. domyn-swarm manages replicas, load balancing, and job execution.

Documentation CI Coverage Python License - Apache 2.0 Ruff Pyright

Quick start • Custom jobs • Backends • Documentation • Contributing

Domyn Swarm CLI walkthrough: configure, launch, inspect, submit a batch job, monitor, and shut down a swarm

CLI walkthrough — click the demo to open the MP4.


⚡ Serve

  • YAML configuration for model and replica settings
  • OpenAI-compatible endpoints backed by vLLM
  • Multiple replicas behind a single load-balanced URL
  • Lifecycle commands to launch, inspect, and stop named swarms

🚀 Run

  • Batch inference over Parquet datasets
  • Checkpointing and resume for interrupted jobs
  • Retries with backoff and bounded concurrency
  • Input sharding for parallel job execution

On Slurm, optional Prometheus metrics and dashboards show inference throughput, queue depth, and GPU utilization.


Quick start

uv tool install --python 3.12 domyn-swarm
Extras and other install methods
pip install domyn-swarm             # into the current environment

# Optional extras
pip install 'domyn-swarm[lepton]'   # NVIDIA DGX Cloud Lepton backend
pip install 'domyn-swarm[polars]'   # Polars data backend
pip install 'domyn-swarm[ray]'      # Ray Data backend
pip install 'domyn-swarm[all]'      # everything

uv add, installs from source and the Lepton lep login step are covered in Installation.

1. Describe the swarm

The examples/configs/ directory holds ready-made configurations. This one serves NVIDIA Nemotron-3-Super-120B-A12B across two replicas of four GPUs each, following the vLLM recipe (nemotron_3_super.yaml). Set the image paths, partition, account, and QoS for your cluster:

# NVIDIA Nemotron-3-Super-120B-A12B (BF16) — a ~120B latent-MoE with ~12B active
# parameters. Serving flags follow https://recipes.vllm.ai/nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16
# The recipe's `--served-model-name` is deliberately omitted: jobs address the
# endpoint by the `model` value below, so renaming the served model breaks them.
model: nvidia/NVIDIA-Nemotron-3-Super-120B-A12B-BF16
name: nemotron-3-super-120b
revision: main
gpus_per_replica: 4       # tensor-parallel size 4, one node on most clusters
replicas: 2               # two independent replicas behind the load balancer
image: "/path/to/vllm.sif"   # needs vLLM >= 0.17.1
args: >-
  --tensor-parallel-size 4
  --kv-cache-dtype fp8
  --max-model-len 262144
  --trust-remote-code
  --enable-auto-tool-choice
  --tool-call-parser qwen3_xml
  --reasoning-parser nemotron_v3
env:
  HF_HOME: /path/to/shared_hf_cache
wait_endpoint_s: 3600
backend:
  type: slurm
  partition: partition_name
  account: account_name
  qos: qos_name
  endpoint:
    port: 9001
    cpus_per_task: 4
    wall_time: "36:00:00"
    nginx_image: "/path/to/nginx.sif"

2. Launch the swarm

up submits the replica and load-balancer jobs and returns once the endpoint answers a health check. Every swarm name combines the configured name with a short suffix. up writes this name to standard output so that a script can capture it:

$ SWARM=$(domyn-swarm up -c examples/configs/nemotron_3_super.yaml)
[08/31/26 11:56:44] INFO     Creating deployment nemotron-3-super-120b on slurm...
                    INFO     Submitted replicas job 15427318 with command: sbatch --parsable …
                    INFO     Submitted load balancer job 15427319 with command: sbatch --parsable …
                    INFO     LB healthy → http://lrdn0431:9001/v1

$ echo $SWARM
nemotron-3-super-120b-01m1bq26m7

3. Run a batch job

$ domyn-swarm job submit \
    --name $SWARM \
    --input examples/data/chat_completion.parquet \
    --output results.parquet
[MainThread] Checkpoint flushed 16 rows, new total: 16
[MainThread] Checkpoint flushed 16 rows, new total: 32
[MainThread] Checkpoint flushed 16 rows, new total: 48
[MainThread] Checkpoint flushed 16 rows, new total: 64
[MainThread] Checkpoint flushed 1 rows, new total: 65
[MainThread] Processing all items in worker: 100%|██████████| 65/65 [01:12<00:00,  1.11s/sample]

This is the built-in chat-completion job reading the messages column. The example dataset has 65 rows. By default, the job writes a checkpoint after every 16 rows. An interrupted run continues from the last checkpoint. A higher replicas value distributes requests across more replicas.

4. Inspect and stop the swarm

$ domyn-swarm status $SWARM      # live panel: replica states, endpoint, recorded jobs

$ domyn-swarm down -y $SWARM
✅ Swarm nemotron-3-super-120b-01m1bq26m7 shutdown request sent.

The Quickstart covers the same run step by step.


Write your own job

Subclass SwarmJob and implement transform_items to define how inputs are processed. The framework handles concurrency, retries, and checkpointing.

from typing import Any

from domyn_swarm.jobs import SwarmJob


class SentimentJob(SwarmJob):
    """Classify each prompt as positive, negative, or neutral."""

    async def transform_items(self, items: list[Any]) -> list[str]:
        results = []
        for prompt in items:
            resp = await self.client.chat.completions.create(
                model=self.model,
                messages=[
                    {"role": "system", "content": "Reply only: positive, negative, or neutral."},
                    {"role": "user", "content": prompt},
                ],
            )
            results.append(resp.choices[0].message.content or "")
        return results

This example uses the swarm's configured client and writes labels to the default results column. See Your first custom job for input and output requirements, import setup, and CLI submission.

Built-in jobs cover chat completion, multi-turn conversations, perplexity, and translation. See the Jobs API reference.


Backends

The same core commands are available on both platforms: up, job submit, status, and down.

  • Slurm is included in the base installation. See Slurm setup.
  • NVIDIA DGX Cloud Lepton requires the lepton extra and workspace credentials. See Lepton setup.

Job input and output support pandas (default), polars, and Ray Data. See Choosing a data backend.

To add support for another platform, see Implementing a backend.


Documentation

The full documentation is published at domynswarm.domyn.com.

Getting started install, launch a swarm, write your first custom job
Guides Slurm and Lepton, checkpointing, sharding, data backends, monitoring
Concepts architecture, backend protocols, the SwarmJob lifecycle, configuration
Reference CLI, configuration, environment variables, and Python API generated from source

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md covers the development setup, coding style, and commit conventions. Participation is governed by our Code of Conduct. To report a vulnerability, follow our security policy.

License

The project uses the Apache License 2.0. See LICENSE and NOTICE.

Citation

@software{domyn_swarm,
  author  = {D'Ambrosio, Federico and Rognoni, Alessandro},
  title   = {domyn-swarm: LLM serving endpoints and high-throughput batch jobs on Slurm and DGX Cloud Lepton},
  year     = {2026},
  url     = {https://github.com/DomynAI/domyn-swarm},
  license = {Apache-2.0}
}

Acknowledgements

Built on vLLM and Ray, with optional support for NVIDIA DGX Cloud Lepton through the Lepton SDK.

Metadata

Release files for domyn-swarm 0.36.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for domyn-swarm 0.36.0
File Size Uploaded Provenance Actions
domyn_swarm-0.36.0.tar.gz 207.9 kB With provenance Details for domyn_swarm-0.36.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for domyn-swarm 0.36.0
File Interpreter ABI Platform Actions
domyn_swarm-0.36.0-py3-none-any.whl Python 3 none any Details for domyn_swarm-0.36.0-py3-none-any.whl

Total release size: 494.5 kB

Release files / domyn_swarm-0.36.0.tar.gz

Download URL domyn_swarm-0.36.0.tar.gz
Size 207.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ba7f89662d9fc6d13fa6ad6e486db6e081c56e6e842dae48e6aa8a3e25e52c3f
BLAKE2b-256 checksum
How to use checksums
8f15b5f957a828d1fbba2ccb84f4d019b5cf644ff590e4761e933808aaa2ac2c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / domyn_swarm-0.36.0-py3-none-any.whl

Download URL domyn_swarm-0.36.0-py3-none-any.whl
Size 286.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e44a1309ca3cf0d14cb21f9226847b6392f9355a75deeae7cddc7462604e2968
BLAKE2b-256 checksum
How to use checksums
d329e1b12290121d2d328c0348b7ebd787223c751a001288ffb383b1d590b0c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for domyn-swarm 0.36.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for domyn_swarm-0.36.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.36.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page