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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kserve-0.21.0rc0.tar.gz (413.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kserve-0.21.0rc0-py3-none-any.whl (565.8 kB view details)

Uploaded Python 3

File details

Details for the file kserve-0.21.0rc0.tar.gz.

File metadata

  • Download URL: kserve-0.21.0rc0.tar.gz
  • Upload date:
  • Size: 413.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for kserve-0.21.0rc0.tar.gz
Algorithm Hash digest
SHA256 2cfd5ba215f26df1f21bce3fda7ed04969b38cb9986dfc2d87307108621e5dad
MD5 a4811c0a2e73ca768110b53e3e77d09a
BLAKE2b-256 e44ee8caa6f7af4b69435f8e4d8d4cea956dbf2f3327e60d8bb534c75ea93c86

See more details on using hashes here.

File details

Details for the file kserve-0.21.0rc0-py3-none-any.whl.

File metadata

  • Download URL: kserve-0.21.0rc0-py3-none-any.whl
  • Upload date:
  • Size: 565.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.8

File hashes

Hashes for kserve-0.21.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 69058fd6e97d2da0337ca41f5ca5b11ec3ad28a55fb8393d76e666b4f457857d
MD5 36b44b3441b98619f9d9019d12113b6c
BLAKE2b-256 9ba98093dca4b0048377ce7c5e561297740220fadad198134f4b5d996b6eb449

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.21.0rc0 This release

2 files

0.20.0

2 files

0.19.0

2 files

0.18.1

2 files

0.18.0

2 files

0.17.1

2 files

0.17.0

2 files

0.16.0

2 files

0.15.2

2 files

0.15.1

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.1

2 files

0.12.0

2 files

0.11.2

2 files

0.11.1

2 files

0.11.0

2 files

0.10.2

2 files

0.10.1.1

2 files

0.10.1

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0.2

2 files

0.8.0.1

2 files

0.8.0

2 files

0.7.0

2 files

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