Skip to main content

Overview

DeploymentManager is a low-level compatibility API. New user code should not wire deployments or weight-sync buckets manually; use FiretitanServiceClient.from_firetitan_config(...), then service.create_sampling_client(model_path=...) or service.create_deployment_sampler(model_path=...). This page remains for existing integrations, migration support, and advanced deployment debugging.
DeploymentManager manages the lifecycle of inference deployments that serve as sampling and weight-sync targets during training. For on-policy training (GRPO), the deployment is synced with the latest policy weights.

Constructor

DeploymentManager supports separate URLs for control-plane, inference, and weight-sync traffic:
For most users, all three URLs default to base_url. Separate URLs are useful when the control-plane and gateway have different endpoints (e.g. personal dev gateways).

Methods

create_or_get(config, force_recreate=False)

Create a new deployment or retrieve an existing one. Set force_recreate=True to delete and recreate if it already exists:
Returns a DeploymentInfo.

wait_for_ready(deployment_id, timeout_s=600, poll_interval_s=15)

Poll until the deployment is ready to serve:
Returns a DeploymentInfo.

get(deployment_id)

Inspect deployment status. Returns a DeploymentInfo or None if not found:

hotload_and_wait(deployment_id, base_model, snapshot_identity, ...)

Load a checkpoint onto the deployment and wait for completion:
For delta weight syncs, pass incremental_snapshot_metadata:

hotload_check_status(deployment_id, base_model, timeout=30)

Current weight-sync status per replica — current_snapshot_identity, readiness, loading_state.stage. Use for ad-hoc inspection or to decide whether a weight sync is needed.

wait_for_hotload(deployment_id, base_model, expected_identity, timeout_seconds=400, poll_interval=5)

Poll until every replica reports readiness=true and current_snapshot_identity == expected_identity. The “wait half” of hotload_and_wait — call directly when you started a sync via hotload() and want to block separately.

update(deployment_id, body, update_mask)

Partial PATCH. update_mask is required (snake-case field paths); without it the server replaces all mutable fields, silently zeroing anything not in body. Returns DeploymentInfo.

warmup(model, max_retries=30, retry_interval_s=10.0)

Send a warmup request to the deployment after weight sync. Retries until the deployment responds or the retry limit is reached. Returns True on success, False if all retries are exhausted.

scale_to_zero(deployment_id)

Release GPU resources without deleting the deployment:
Sets both minReplicaCount and maxReplicaCount to 0.

delete(deployment_id)

Delete a deployment entirely:

DeploymentConfig

DeploymentManager.create_or_get(...) accepts a DeploymentConfig dataclass: When deployment_shape is set (the recommended path), the shape owns the deployment’s hardware and serving configuration. The fields below are what you set as a user:
On the recommended shape path, deployment_shape owns the deployment hardware and serving configuration, so do not override accelerator_type. Advanced manual deployments can omit deployment_shape and set accelerator_type directly. skip_shape_validation is for internal development and requires elevated permissions.

DeploymentInfo

Returned by create_or_get, wait_for_ready, and get:

Deployment shape and training shapes

When using a training shape, the linked deployment shape is determined by the training shape and cannot be changed. The training shape’s deploymentShapeVersion locks the GPU type, node count, and serving engine configuration for the inference deployment. The one thing you can adjust is the replica count. Use min_replica_count and max_replica_count to scale up throughput for sampling during RL loops:

Operational guidance

  • Prefer FiretitanServiceClient for normal trainer/deployment provisioning and sampler refresh.
  • Keep deployment IDs stable per experiment family for easier rollbacks.
  • Use min_replica_count=0 for development to avoid idle GPU costs.
  • Create the trainer before the deployment and link the deployment to the trainer’s weight-sync bucket via hot_load_trainer_job.
  • Use deployment_shape when the control plane has a pre-validated shape for your model.
  • Do not treat shape-owned hardware as a user-facing override surface — in normal flows, leave accelerator_type and placement decisions to the deployment shape and only tune replica counts.
  • Use scale_to_zero after training as a lighter alternative to delete.