centml-python-client
Installation
To install without cloning, run the following command:
pip install git+https://github.com/CentML/centml-python-client.git@main
Alternatively to build from source, clone this repo then inside the project's base directory, run the following command:
pip install .
Authentication
For interactive use, authenticate once with the CLI. SDK examples reuse the stored credentials and refresh them when needed.
centml login
python examples/sdk/validate_auth.py
For service-to-service use, provide both service-account environment variables:
export CENTML_SERVICE_ACCOUNT_ID="<service-account-id>"
export CENTML_SERVICE_ACCOUNT_SECRET="<service-account-secret>"
python examples/sdk/validate_auth.py
CENTML_PLATFORM_API_URL can be set when targeting a non-production API.
Dynamo SDK example
The Dynamo example uses SDK authentication separately from the bearer token that protects the deployed inference endpoint:
export CENTML_CLUSTER_ID="<cluster-id>"
export CENTML_HARDWARE_INSTANCE_ID="<hardware-instance-id>"
export CENTML_ENDPOINT_BEARER_TOKEN="<new-endpoint-token>"
# Required only for gated Hugging Face models:
export HF_TOKEN="<hugging-face-token>"
python examples/sdk/create_dynamo.py
Use python examples/sdk/get_clusters.py and
python examples/sdk/manage_hardware_instances.py to discover the required IDs.
Creating the example reserves GPU capacity and may incur usage charges. It does not
delete the deployment automatically.
Deployment logs SDK example
Logs are read per pod. Discover pod names with get_deployment_pods() (terminated
pods still within log retention are included), then read with a
deployment_log_session(): fetch_older() pages toward the beginning of history and
fetch_newer() returns only new lines, while the session keeps the merged, ordered
log in .events. get_deployment_logs_range() fetches a specific time window
(epoch-millisecond bounds, both optional) and, with pod=None, merges every pod's
stream chronologically. The same paging is available statelessly through
get_deployment_logs(before=..., after=...), anchored on events you already hold
or on a bare epoch-millisecond boundary:
python examples/sdk/get_deployment_logs.py
Un-installation
To uninstall centml, simply do:
pip uninstall centml
CLI
Once installed, use the centml CLI tool with the following command:
centml
If you want tab completion, run
source scripts/completions/completion.<shell language>
Shell language can be: bash, zsh, fish
(Hint: add source /path/to/completions/completion.<shell language> to your ~/.bashrc, ~/.zshrc or ~/.config/fish/completions/centml.fish)
Tests
To run tests, first install required packages:
pip install -r requirements-dev.txt
cd tests
When running on a local machine, it is recommended to run tests with the following command. This skips tests that require a GPU.
pytest --sanity
To run all the tests, use:
pytest
Common Issues
-
SSLcertificate onMacOSSometimes, you will see issues when using command like
centml cluster [CMD], where the output might look like:File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/urllib3/util/retry.py", line 519, in increment raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type] urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.centml.com', port=443): Max retries exceeded with url: /deployments (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1007)')))
Solution: To fix this issue, navigate to your
pythoninstallation directory and run theInstall Certificates.commandfile located there.For example, if you are using
python3.10, the file path would be:/Applications/Python 3.10/Install Certificates.command
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file centml-0.6.0.tar.gz.
File metadata
- Download URL: centml-0.6.0.tar.gz
- Upload date:
- Size: 37.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5aa1e6d4a7eeac56b9c639c1749130112d1b69c6c02395238487f480915c4bf
|
|
| MD5 |
67672d8e0fc62f723c9535cda28741bb
|
|
| BLAKE2b-256 |
c6393f20e40d3994255f03875eda248bca8363dcb999f3fb0a3a2d7288baaddb
|
Provenance
The following attestation bundles were made for centml-0.6.0.tar.gz:
Publisher:
publish.yml on CentML/centml-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
centml-0.6.0.tar.gz -
Subject digest:
f5aa1e6d4a7eeac56b9c639c1749130112d1b69c6c02395238487f480915c4bf - Sigstore transparency entry: 2702029112
- Sigstore integration time:
-
Permalink:
CentML/centml-python-client@79a76321f7072c3e5896e2c0440d9ddf1c5c2fdc -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/CentML
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79a76321f7072c3e5896e2c0440d9ddf1c5c2fdc -
Trigger Event:
release
-
Statement type:
File details
Details for the file centml-0.6.0-py3-none-any.whl.
File metadata
- Download URL: centml-0.6.0-py3-none-any.whl
- Upload date:
- Size: 29.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3fe6e8bbac06b587ee1e68afb2e63d1ba930eb37c55eb07a153eaba6fc181ae1
|
|
| MD5 |
d5719ce2b9a03a1e4f618929f623ae52
|
|
| BLAKE2b-256 |
acadb0bde5d8a3a82c84ebfa95c11f84ef90e37ea59c7a1be45c3b440a454ba8
|
Provenance
The following attestation bundles were made for centml-0.6.0-py3-none-any.whl:
Publisher:
publish.yml on CentML/centml-python-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
centml-0.6.0-py3-none-any.whl -
Subject digest:
3fe6e8bbac06b587ee1e68afb2e63d1ba930eb37c55eb07a153eaba6fc181ae1 - Sigstore transparency entry: 2702029224
- Sigstore integration time:
-
Permalink:
CentML/centml-python-client@79a76321f7072c3e5896e2c0440d9ddf1c5c2fdc -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/CentML
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79a76321f7072c3e5896e2c0440d9ddf1c5c2fdc -
Trigger Event:
release
-
Statement type: