Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

KServe Python SDK

Python SDK for KServe Server and Client.

Installation

KServe Python SDK can be installed by pip or uv.

pip install

pip install kserve

To install Kserve with storage support

pip install kserve[storage]

UV

Install via uv.

make dev_install

To install Kserve with storage support

uv install --extra storage

KServe Python Server

KServe's python server libraries implement a standardized library that is extended by model serving frameworks such as Scikit Learn, XGBoost and PyTorch. It encapsulates data plane API definitions and storage retrieval for models.

It provides many functionalities, including among others:

  • Registering a model and starting the server
  • Prediction Handler
  • Pre/Post Processing Handler
  • Liveness Handler
  • Readiness Handlers

It supports the following storage providers:

  • Google Cloud Storage with a prefix: "gs://"
    • By default, it uses GOOGLE_APPLICATION_CREDENTIALS environment variable for user authentication.
    • If GOOGLE_APPLICATION_CREDENTIALS is not provided, anonymous client will be used to download the artifacts.
  • S3 Compatible Object Storage with a prefix "s3://"
    • By default, it uses S3_ENDPOINT, AWS_ACCESS_KEY_ID, and AWS_SECRET_ACCESS_KEY environment variables for user authentication.
  • Azure Blob Storage with the format: "https://{$STORAGE_ACCOUNT_NAME}.blob.core.windows.net/{$CONTAINER}/{$PATH}"
  • Local filesystem either without any prefix or with a prefix "file://". For example:
    • Absolute path: /absolute/path or file:///absolute/path
    • Relative path: relative/path or file://relative/path
    • For local filesystem, we recommended to use relative path without any prefix.
  • Persistent Volume Claim (PVC) with the format "pvc://{$pvcname}/[path]".
    • The pvcname is the name of the PVC that contains the model.
    • The [path] is the relative path to the model on the PVC.
    • For e.g. pvc://mypvcname/model/path/on/pvc
  • Generic URI, over either HTTP, prefixed with http:// or HTTPS, prefixed with https://. For example:
    • https://<some_url>.com/model.joblib
    • http://<some_url>.com/model.joblib

Metrics

For latency metrics, send a request to /metrics. Prometheus latency histograms are emitted for each of the steps (pre/postprocessing, explain, predict). Additionally, the latencies of each step are logged per request.

Metric Name Description Type
request_preprocess_seconds pre-processing request latency Histogram
request_explain_seconds explain request latency Histogram
request_predict_seconds prediction request latency Histogram
request_postprocess_seconds pre-processing request latency Histogram

KServe Client

Getting Started

KServe's python client interacts with KServe control plane APIs for executing operations on a remote KServe cluster, such as creating, patching and deleting of a InferenceService instance. See the Sample for Python SDK Client to get started.

Documentation for Client API

Please review KServe Client API docs.

Documentation For Models

Metadata

Release files for kserve 0.22.0rc0

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

Source distribution (sdist)

Source distribution for kserve 0.22.0rc0
File Size Uploaded Provenance Actions
kserve-0.22.0rc0.tar.gz 458.2 kB Without provenance Details for kserve-0.22.0rc0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kserve 0.22.0rc0
File Interpreter ABI Platform Actions
kserve-0.22.0rc0-py3-none-any.whl Python 3 none any Details for kserve-0.22.0rc0-py3-none-any.whl

Total release size: 1.1 MB

Release files / kserve-0.22.0rc0.tar.gz

Download URL kserve-0.22.0rc0.tar.gz
Size 458.2 kB
Tags Source
SHA-256 checksum
How to use checksums
50a9ff87de283ed119e76d78c205fae260415c9ad112f71ed2ddad0d00067c88
BLAKE2b-256 checksum
How to use checksums
2f7202206922d259e3bdb19a281f82e7859cb2349cafa4c870422bf80d358ad4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Release files / kserve-0.22.0rc0-py3-none-any.whl

Download URL kserve-0.22.0rc0-py3-none-any.whl
Size 655.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3281cf1e53b710ed247fb9c5d90fad5717711e978c36f18221ced032ff1355af
BLAKE2b-256 checksum
How to use checksums
b53bdf1e28f318d4c7e3d17ba57f70be5b970272b688711b7495eac3f8d8fed6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.8

Security for kserve 0.22.0rc0

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
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