Deployment Guide
This guide covers the full deployment story for AITune-tuned models: saving a tuned model to a checkpoint, loading it in production, and optionally serving it as an OpenAI-compatible HTTP endpoint via NVIDIA Dynamo.
Save a Tuned Model
Basic Save
This creates:
checkpoints/model.ait: Compressed checkpoint with tuned modulescheckpoints/model_sha256_sums.txt: SHA256 checksumscheckpoints/model/: Decompressed artifacts (after first load)
With Custom Storage
Load in Production
Basic Load
With Custom Storage
Loading Process
- First load — decompresses
.aitfile, extracts artifacts, verifies checksums, loads backend and weights. Slower due to decompression. - Subsequent loads — uses decompressed files from
checkpoints/, skips decompression. Faster startup.
Serve with Dynamo Worker
After loading a tuned model, you can expose it as an OpenAI-compatible HTTP endpoint using AITune’s Dynamo integration. The worker registers the model with the Dynamo HTTP frontend, deserializes incoming requests, packs inference results into the Dynamo wire format, and blocks until SIGTERM/SIGINT.
Prerequisites
Install the Dynamo extra:
The "audio" modality requires NVIDIA Dynamo 1.1 or later and serves text-to-speech requests through
/v1/audio/speech. Automatic speech recognition is not currently exposed by this worker API.
For local development without etcd/NATS, set DYN_DISCOVERY_BACKEND=file before starting any Dynamo process.
Quick Start — Embedding Model
API Reference
Import from aitune.dynamo:
DynamoWorkerConfig
dynamo_worker(model_or_fn, config, *, setup=None, warmup=None)
Functional API. Validates config, starts the Dynamo runtime, and blocks until shutdown.
model_or_fn: any callable, or atorch.nn.Module(requiresconfig.mapping)config:DynamoWorkerConfigsetup: optional rank-local initialization callbackwarmup: optional warmup callback run only after setup succeeds on every rank
DynamoWorker (class-based API)
For more control, subclass DynamoWorker and override setup() and serve():
Override on_ready(runtime, endpoint) for post-startup work such as custom register_model calls.
Override warmup() to run model warmup after setup() succeeds on every rank and before endpoint registration.
Multi-GPU Workers
Use the same DynamoWorker API for local and multi-GPU models. Initialize the application-owned process group and
construct the rank-local model before calling run() or dynamo_worker() on every rank. AITune starts the Dynamo
endpoint only on rank 0, serializes and broadcasts incoming requests, executes the request on every rank, and returns
only rank 0’s response.
For rank-local initialization that may fail, pass it through setup= and put any collective model warmup in
warmup=. AITune exchanges setup failures across the process group before allowing any rank to start warmup or
register the endpoint.
The worker does not initialize or destroy the process group and does not add inference barriers or CUDA synchronization. The application remains responsible for device placement, model sharding or context parallelism, and process-group teardown after the worker returns. An initialized multi-rank process group represents one collective model worker. Deploy independent model replicas as separate worker groups or pods.
Modality Types
Audio bytes are automatically packed as WAV output. To serve another audio codec, return a fully formed Dynamo response
dict. Plain dictionaries are forwarded to the runtime as-is for every modality.
Serving with run_dynamo.sh
The recommended way to start all processes locally is a run_dynamo.sh script that:
- Starts the Dynamo HTTP frontend in the background
- Starts the backend worker in the background
- Polls
/healthuntil the endpoint is registered - Runs a smoke-test client request
See the E5Large example for a complete working version.
Next Steps
- AOT Tuning Guide — tuning a model before saving
- Tune Strategies — selecting the right optimization strategy
- Backend Guides — backend-specific deployment notes
- E5Large example — end-to-end embedding worker
- FLUX example — end-to-end image generation worker
- WAN example — context-parallel text-to-video worker