xinference-client 2.4.0__tar.gz → 2.7.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {xinference_client-2.4.0 → xinference_client-2.7.0}/PKG-INFO +1 -1
  2. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/_version.py +3 -3
  3. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/client/restful/async_restful_client.py +16 -1
  4. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/client/restful/restful_client.py +15 -1
  5. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/PKG-INFO +1 -1
  6. {xinference_client-2.4.0 → xinference_client-2.7.0}/LICENSE +0 -0
  7. {xinference_client-2.4.0 → xinference_client-2.7.0}/MANIFEST.in +0 -0
  8. {xinference_client-2.4.0 → xinference_client-2.7.0}/README.md +0 -0
  9. {xinference_client-2.4.0 → xinference_client-2.7.0}/pyproject.toml +0 -0
  10. {xinference_client-2.4.0 → xinference_client-2.7.0}/setup.cfg +0 -0
  11. {xinference_client-2.4.0 → xinference_client-2.7.0}/setup.py +0 -0
  12. {xinference_client-2.4.0 → xinference_client-2.7.0}/third_party/inference/xinference/thirdparty/matcha/utils/monotonic_align/core.pyx +0 -0
  13. {xinference_client-2.4.0 → xinference_client-2.7.0}/versioneer.py +0 -0
  14. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/__init__.py +0 -0
  15. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/_compat.py +0 -0
  16. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/client/__init__.py +0 -0
  17. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/client/common.py +0 -0
  18. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/client/restful/__init__.py +0 -0
  19. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/fields.py +0 -0
  20. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client/types.py +0 -0
  21. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/SOURCES.txt +0 -0
  22. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/dependency_links.txt +0 -0
  23. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/not-zip-safe +0 -0
  24. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/requires.txt +0 -0
  25. {xinference_client-2.4.0 → xinference_client-2.7.0}/xinference_client.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xinference-client
3
- Version: 2.4.0
3
+ Version: 2.7.0
4
4
  Summary: Client for Xinference
5
5
  Home-page: https://github.com/xorbitsai/inference-client
6
6
  Author: Qin Xuye
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2026-03-29T11:20:56+0800",
11
+ "date": "2026-04-25T15:17:51+0800",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "46f9ecb0ab0fc671d0ea4e765c813d7b7388d38b",
15
- "version": "2.4.0"
14
+ "full-revisionid": "a7d295c394c5dd408b1d7167d692a3326b3f4e03",
15
+ "version": "2.7.0"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -1432,6 +1432,21 @@ class AsyncClient:
1432
1432
  )
1433
1433
  await _release_response(response)
1434
1434
 
1435
+ async def terminate_model_replica(self, model_uid: str, replica_id: int) -> int:
1436
+ """Terminate a specific replica of a running model."""
1437
+
1438
+ url = f"{self.base_url}/v1/models/{model_uid}/replicas/{replica_id}"
1439
+
1440
+ response = await self.session.delete(url, headers=self._headers)
1441
+ if response.status != 200:
1442
+ raise RuntimeError(
1443
+ f"Failed to terminate model replica, detail: {await _get_error_string(response)}"
1444
+ )
1445
+
1446
+ response_data = await response.json()
1447
+ await _release_response(response)
1448
+ return response_data["remaining_replicas"]
1449
+
1435
1450
  async def get_launch_model_progress(self, model_uid: str) -> dict:
1436
1451
  """
1437
1452
  Get progress of the specific model.
@@ -1575,7 +1590,7 @@ class AsyncClient:
1575
1590
  model_uid, self.base_url, auth_headers=self._headers
1576
1591
  )
1577
1592
  else:
1578
- raise ValueError(f"Unknown model type:{desc['model_type']}")
1593
+ raise ValueError(f"Unknown model type: {desc['model_type']}")
1579
1594
 
1580
1595
  async def describe_model(self, model_uid: str):
1581
1596
  """
@@ -1329,6 +1329,20 @@ class Client:
1329
1329
  f"Failed to terminate model, detail: {_get_error_string(response)}"
1330
1330
  )
1331
1331
 
1332
+ def terminate_model_replica(self, model_uid: str, replica_id: int) -> int:
1333
+ """Terminate a specific replica of a running model."""
1334
+
1335
+ url = f"{self.base_url}/v1/models/{model_uid}/replicas/{replica_id}"
1336
+
1337
+ response = self.session.delete(url, headers=self._headers)
1338
+ if response.status_code != 200:
1339
+ raise RuntimeError(
1340
+ f"Failed to terminate model replica, detail: {_get_error_string(response)}"
1341
+ )
1342
+
1343
+ response_data = response.json()
1344
+ return response_data["remaining_replicas"]
1345
+
1332
1346
  def get_launch_model_progress(self, model_uid: str) -> dict:
1333
1347
  """
1334
1348
  Get progress of the specific model.
@@ -1467,7 +1481,7 @@ class Client:
1467
1481
  model_uid, self.base_url, auth_headers=self._headers
1468
1482
  )
1469
1483
  else:
1470
- raise ValueError(f"Unknown model type:{desc['model_type']}")
1484
+ raise ValueError(f"Unknown model type: {desc['model_type']}")
1471
1485
 
1472
1486
  def describe_model(self, model_uid: str):
1473
1487
  """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xinference-client
3
- Version: 2.4.0
3
+ Version: 2.7.0
4
4
  Summary: Client for Xinference
5
5
  Home-page: https://github.com/xorbitsai/inference-client
6
6
  Author: Qin Xuye