Skip to main content

TorchServe Python Client

Install

pip install torchserve_client

Usage

Using torchserve_client is a breeze! It has support for both REST APIs and gRPC APIs.

REST Client

To make calls to REST endpoint, simply initialize a TorchServeClientREST object as shown below:

from torchserve_client import TorchServeClientREST

# Initialize the REST TorchServeClient object
ts_client = TorchServeClientREST()
ts_client
TorchServeClient(base_url=http://localhost, management_port=8081, inference_port=8080)

If you wish to customize the base URL, management port, or inference port of your TorchServe server, you can pass them as arguments during initialization:

from torchserve_client import TorchServeClientREST

# Customize the base URL, management port, and inference port
ts_client = TorchServeClientREST(base_url='http://your-torchserve-server.com', 
                             management_port=8081, inference_port=8080)
ts_client
TorchServeClient(base_url=http://your-torchserve-server.com, management_port=8081, inference_port=8080)

gRPC Client

To create a gRPC client, simply create a TorchServeClientGRPC object

from torchserve_client import TorchServeClientGRPC

# Initialize the gRPC TorchServeClient object
ts_client = TorchServeClientGRPC()
ts_client
TorchServeClientGRPC(base_url=localhost, management_port=7071, inference_port=7070)

To customize base URL and default ports, pass them as arguments during initialization

from torchserve_client import TorchServeClientGRPC

# Initialize the gRPC TorchServeClient object
ts_client = TorchServeClientGRPC(base_url='http://your-torchserve-server.com', 
                             management_port=7071, inference_port=7070)
ts_client
TorchServeClientGRPC(base_url=your-torchserve-server.com, management_port=7071, inference_port=7070)

With these intuitive APIs at your disposal, you can harness the full power of the Management and Inference API and take your application to next level. Happy inferencing! 🚀🔥

Metadata

Release files for torchserve-client 0.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for torchserve-client 0.0.2
File Size Uploaded Provenance
torchserve_client-0.0.2.tar.gz 14.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for torchserve-client 0.0.2
File Interpreter ABI Platform
torchserve_client-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 31.1 kB

Release files / torchserve_client-0.0.2.tar.gz

Download URL torchserve_client-0.0.2.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
51de7a93884594f7e1fc88cadc3e55bda5f6e7720031437b5453d6c22e7c28ad
BLAKE2b-256 checksum
How to use checksums
d7e70f0faa551a101953d946ab2e0f0ee1082936849063e72020ba8f60677fab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Release files / torchserve_client-0.0.2-py3-none-any.whl

Download URL torchserve_client-0.0.2-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
682446845ba743a678bfaefa5015f79d22e9fc266db3291a64d91e79b6f25bbc
BLAKE2b-256 checksum
How to use checksums
3f7f6b7e19f40c7d607511e31cbd7f3bf7750c8b5b451b7f06dd9519e30d2a7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.17

Security for torchserve-client 0.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page