Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions examples/sdk/create_cserve.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ def main():
print("Deployment details: ", deployment)

"""
### Scale replicas in place (no new revision / no rolling update)
# Changing only min_replicas and/or max_replicas on the same Create*
# request updates the selected revision in place; revision_number stays put.
# Any other field change still creates a new revision.
qwen_config.min_replicas = 2
qwen_config.max_replicas = 4
cclient.update_cserve(deployment.id, qwen_config)
scaled = cclient.get_cserve(deployment.id)
print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")

### Pause the deployment
cclient.pause(deployment.id)

Expand Down
12 changes: 9 additions & 3 deletions examples/sdk/create_dynamo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ def main():
# client.resume(deployment.id)
# client.delete(deployment.id)
#
# To update a Dynamo deployment, construct a new
# CreateDynamoDeploymentRequest and call:
# client.update_dynamo(deployment.id, updated_request)
# Scale replicas in place (no new revision / no rolling update):
# Changing only min_replicas and/or max_replicas on the same Create*
# request updates the selected revision in place; revision_number stays put.
# Any other field change still creates a new revision.
# request.min_replicas = 2
# request.max_replicas = 4
# client.update_dynamo(deployment.id, request)
# scaled = client.get_dynamo(deployment.id)
# print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")

print(f"Created Dynamo deployment {deployment.id}: {deployment.endpoint_url}")
print(f"Model: {deployment.model}")
Expand Down
10 changes: 10 additions & 0 deletions examples/sdk/create_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,16 @@ def main():
print("Deployment details: ", deployment)

'''
### Scale replicas in place (no new revision / no rolling update)
# Changing only min_replicas and/or max_replicas on the same Create*
# request updates the selected revision in place; revision_number stays put.
# Any other field change still creates a new revision.
request.min_replicas = 2
request.max_replicas = 5
cclient.update_inference(deployment.id, request)
scaled = cclient.get_inference(deployment.id)
print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")

### Pause the deployment
cclient.pause(deployment.id)

Expand Down
10 changes: 10 additions & 0 deletions examples/sdk/create_inference_vllm.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,16 @@ def main():
print("Deployment details: ", deployment)

'''
### Scale replicas in place (no new revision / no rolling update)
# Changing only min_replicas and/or max_replicas on the same Create*
# request updates the selected revision in place; revision_number stays put.
# Any other field change still creates a new revision.
request.min_replicas = 1
request.max_replicas = 3
cclient.update_inference(deployment.id, request)
scaled = cclient.get_inference(deployment.id)
print(f"Scaled to {scaled.min_replicas}-{scaled.max_replicas}; revision {scaled.revision_number}")

### Pause the deployment
cclient.pause(deployment.id)

Expand Down
Loading