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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

### Installation

This client uses Platform API `4.37.1`. CServe deployments have been retired;
the CServe SDK helpers and CLI deployment option are no longer available.

To install without cloning, run the following command:
```bash
pip install git+https://github.com/CentML/centml-python-client.git@main
Expand Down
24 changes: 0 additions & 24 deletions centml/cli/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,12 @@
DeploymentType.INFERENCE_V2: "inference",
DeploymentType.INFERENCE_V3: "inference",
DeploymentType.COMPUTE_V2: "compute",
# For user, they are all cserve.
DeploymentType.CSERVE: "cserve",
DeploymentType.CSERVE_V2: "cserve",
DeploymentType.CSERVE_V3: "cserve",
DeploymentType.RAG: "rag",
DeploymentType.JOB: "job",
}
# use latest type to for user requests
depl_name_to_type_map = {
"inference": DeploymentType.INFERENCE_V3,
"cserve": DeploymentType.CSERVE_V3,
"compute": DeploymentType.COMPUTE_V2,
"rag": DeploymentType.RAG,
"job": DeploymentType.JOB,
Expand Down Expand Up @@ -78,7 +73,6 @@ def _format_ssh_key(ssh_key):
def _get_replica_info(deployment):
"""Extract replica information handling V2/V3 field differences"""
# Check actual deployment object fields rather than depl_type
# since unified get_cserve() can return either V2 or V3 objects
if hasattr(deployment, 'min_replicas'):
# V3 deployment response object
return {"min": deployment.min_replicas, "max": deployment.max_replicas}
Expand Down Expand Up @@ -218,8 +212,6 @@ def get(type, id):
deployment = cclient.get_inference(id) # handles both V2 and V3
elif depl_type == DeploymentType.COMPUTE_V2:
deployment = cclient.get_compute(id)
elif depl_type in [DeploymentType.CSERVE_V2, DeploymentType.CSERVE_V3]:
deployment = cclient.get_cserve(id) # handles both V2 and V3
elif depl_type == DeploymentType.JOB:
deployment = cclient.get_job(id)
else:
Expand Down Expand Up @@ -268,22 +260,6 @@ def get(type, id):
disable_numparse=True,
)
)
elif depl_type in [DeploymentType.CSERVE_V2, DeploymentType.CSERVE_V3]:
replica_info = _get_replica_info(deployment)
display_rows = [
("Hugging face model", deployment.recipe.model),
(
"Parallelism",
{
"tensor": deployment.recipe.additional_properties.get("tensor_parallel_size", "N/A"),
"pipeline": deployment.recipe.additional_properties.get("pipeline_parallel_size", "N/A"),
},
),
("Replicas", replica_info),
("Max concurrency", deployment.concurrency or "None"),
]

click.echo(tabulate(display_rows, tablefmt="rounded_outline", disable_numparse=True))
elif depl_type == DeploymentType.JOB:
display_rows = [
("Image", deployment.image_url),
Expand Down
19 changes: 0 additions & 19 deletions centml/sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
from centml.sdk import auth
from centml.sdk.config import settings

STATUS_V3_DEPLOYMENT_TYPES = {DeploymentType.INFERENCE_V3, DeploymentType.CSERVE_V3}

DEFAULT_LOG_PAGE_LINES = 100 # server-side default for max_lines
MAX_LOG_PAGE_LINES = 5000 # server-side ceiling for max_lines
# fetch_logs asks for less than the server's own default because the common call tails a
Expand Down Expand Up @@ -139,23 +137,6 @@ def get_compute(self, id):
def get_job(self, id):
return self._api.get_job_deployment_deployments_job_deployment_id_get(id)

def get_cserve(self, id):
"""Get CServe deployment details - automatically handles both V2 and V3 deployments"""
# Try V3 first (recommended), fallback to V2 if deployment is V2
try:
return self._api.get_cserve_v3_deployment_deployments_cserve_v3_deployment_id_get(id)
except ApiException as e:
# If V3 fails with 404 or similar, try V2
if e.status in [404, 400]: # Deployment might be V2 or endpoint not found
try:
return self._api.get_cserve_v2_deployment_deployments_cserve_v2_deployment_id_get(id)
except ApiException as v2_error:
# If both fail, raise the original V3 error as it's more likely to be the real issue
raise e from v2_error
else:
# For other errors (auth, network, etc.), raise immediately
raise

def get_dynamo(self, id):
return self._api.get_dynamo_deployment_deployments_dynamo_deployment_id_get(id)

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ pyjwt>=2.8.0
cryptography==50.0.0
websockets>=16.0
pyte>=0.8.0
platform-api-python-client==4.31.0
platform-api-python-client==4.37.1
click>=8.4.1
typing-extensions>=4.5
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='centml',
version='0.7.1',
version='0.7.2',
packages=find_packages(exclude=["tests", "tests.*"]),
python_requires=">=3.10",
long_description=open('README.md').read(),
Expand Down
Loading