aitune.dynamo.worker
Serve AITune-tuned models as NVIDIA Dynamo endpoints.
Module Contents
Classes
Functions
Data
API
Base class for custom AITune Dynamo workers.
Override :meth:setup and :meth:serve, then call :meth:run. An initialized
multi-rank process group starts one endpoint on rank zero while every rank
executes each request.
Run optional registration work after the endpoint is available.
Start serving and block until shutdown.
Parameters:
Enable NATS JetStream for KV cache events.
Handle one request and yield response chunks.
Initialize the model once before serving starts.
Run optional model warmup after every rank completes setup.
Configuration for the high-level :func:dynamo_worker entrypoint.
Parameters:
Modality type. One of "image", "video", "audio", "embedding".
Hugging Face model ID or local path passed to register_model.
Optional adapter fn(DynamoRequest) -> dict. The result is
unpacked as keyword arguments when calling the model. Without a mapping,
a plain callable receives the deserialized request object.
Dynamo service namespace.
Component name within the namespace.
Endpoint name within the component.
Enable NATS JetStream for KV cache events.
Name advertised to the Dynamo frontend. Defaults to model_path.
Bases: DynamoWorker
Adapt a callable and :class:DynamoWorkerConfig to the worker API.
Register the configured model with the Dynamo frontend.
Deserialize one request, execute the callable, and pack rank-zero output.
Resolve protocol types on every rank before serving.
Run the configured warmup callback after setup succeeds on every rank.
Serve a tuned model through a local or collective Dynamo worker.
Parameters:
A callable, or a torch.nn.Module with config.mapping.
Modality, endpoint, request mapping, and execution configuration.
Optional rank-local model initialization. In collective execution, every rank must finish this callback before warmup begins.
Optional model warmup run after setup succeeds on every rank.
Raises:
ValueError: If the modality is unsupported or a module has no mapping.ImportError: If the optional Dynamo dependencies are unavailable.