Python client SDK for kapsl-runtime with IPC, shared-memory, and hybrid inference transports
Project description
kapsl-sdk
Python client SDK for kapsl-runtime — the Rust-native AI model inference engine.
Supports socket, TCP, shared-memory, and hybrid transports with a simple Python API.
Install
pip install kapsl-sdk
Pre-compiled abi3 wheels are available for Linux, macOS, and Windows on Python 3.9+.
Quick start
from kapsl_sdk import KapslClient
client = KapslClient() # connects to /tmp/kapsl.sock by default
# Streaming LLM inference
prompt = "<|im_start|>user\nHello<|im_end|>\n<|im_start|>assistant\n"
for chunk in client.infer_stream(model_id=0, shape=[1, 1], dtype="string", data=prompt.encode()):
print(chunk.decode("utf-8"), end="", flush=True)
import numpy as np
# Standard tensor inference
data = np.array([[1.0, 2.0, 3.0, 4.0]], dtype=np.float32)
result = client.infer(model_id=0, shape=[1, 4], dtype="float32", data=data.tobytes())
output = np.frombuffer(result, dtype=np.float32)
Transports
| Client | Transport | Use case |
|---|---|---|
KapslClient |
Unix socket / TCP | Default — local or remote |
KapslShmClient |
Shared memory | Lowest latency, co-located only |
KapslHybridClient |
Socket control + SHM data | Production throughput |
from kapsl_sdk import KapslClient, KapslShmClient, KapslHybridClient
# TCP
client = KapslClient("tcp://192.168.1.10:9096")
# Shared memory (same machine only)
client = KapslShmClient()
# Hybrid
client = KapslHybridClient()
Authentication
client = KapslClient(api_token="your-token")
Docs
Requirements
- Python 3.9+
- A running
kapsl-runtimeinstance (install guide)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
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 kapsl_sdk-0.1.23.tar.gz.
File metadata
- Download URL: kapsl_sdk-0.1.23.tar.gz
- Upload date:
- Size: 315.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26c09203919f6acf4b6389f039da558f33fc1da3c3885fa691996166dd7dd324
|
|
| MD5 |
0964b6507ea6dd774c17106c483be109
|
|
| BLAKE2b-256 |
724f40e3836e94357b826da6e5513796583b3551893fd43f700440b3d0a1d58a
|
Provenance
The following attestation bundles were made for kapsl_sdk-0.1.23.tar.gz:
Publisher:
publish-python-package.yml on kapsl-runtime/kapsl-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapsl_sdk-0.1.23.tar.gz -
Subject digest:
26c09203919f6acf4b6389f039da558f33fc1da3c3885fa691996166dd7dd324 - Sigstore transparency entry: 1253392750
- Sigstore integration time:
-
Permalink:
kapsl-runtime/kapsl-sdk@f25a1da23a1052c30ce6a878836399270864aee0 -
Branch / Tag:
refs/tags/v0.1.23 - Owner: https://github.com/kapsl-runtime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@f25a1da23a1052c30ce6a878836399270864aee0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kapsl_sdk-0.1.23-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: kapsl_sdk-0.1.23-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 594.6 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6d60b9d3cf05ef111bae77a4b53fd990601602db0e7f06bed8f35bf22428c67
|
|
| MD5 |
c9f007a8396b8d7c451f935699cdd692
|
|
| BLAKE2b-256 |
df4e8fb99a170921508095e325064be3fa2a02dab356fe39189f289e8a6e1c40
|
Provenance
The following attestation bundles were made for kapsl_sdk-0.1.23-cp39-abi3-win_amd64.whl:
Publisher:
publish-python-package.yml on kapsl-runtime/kapsl-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapsl_sdk-0.1.23-cp39-abi3-win_amd64.whl -
Subject digest:
c6d60b9d3cf05ef111bae77a4b53fd990601602db0e7f06bed8f35bf22428c67 - Sigstore transparency entry: 1253393076
- Sigstore integration time:
-
Permalink:
kapsl-runtime/kapsl-sdk@f25a1da23a1052c30ce6a878836399270864aee0 -
Branch / Tag:
refs/tags/v0.1.23 - Owner: https://github.com/kapsl-runtime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@f25a1da23a1052c30ce6a878836399270864aee0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kapsl_sdk-0.1.23-cp39-abi3-manylinux_2_34_x86_64.whl.
File metadata
- Download URL: kapsl_sdk-0.1.23-cp39-abi3-manylinux_2_34_x86_64.whl
- Upload date:
- Size: 875.8 kB
- Tags: CPython 3.9+, manylinux: glibc 2.34+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c6c2c56f055f2882dd401510eeec5b0aeceec12478b416b34634a5c3d8a79815
|
|
| MD5 |
5052a035a3360c958d7cf7f00f89c955
|
|
| BLAKE2b-256 |
65686d0836f7d51c0b99edd099cba4a0a309e6ffe1d2dcd59214d23097e2b442
|
Provenance
The following attestation bundles were made for kapsl_sdk-0.1.23-cp39-abi3-manylinux_2_34_x86_64.whl:
Publisher:
publish-python-package.yml on kapsl-runtime/kapsl-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapsl_sdk-0.1.23-cp39-abi3-manylinux_2_34_x86_64.whl -
Subject digest:
c6c2c56f055f2882dd401510eeec5b0aeceec12478b416b34634a5c3d8a79815 - Sigstore transparency entry: 1253392919
- Sigstore integration time:
-
Permalink:
kapsl-runtime/kapsl-sdk@f25a1da23a1052c30ce6a878836399270864aee0 -
Branch / Tag:
refs/tags/v0.1.23 - Owner: https://github.com/kapsl-runtime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@f25a1da23a1052c30ce6a878836399270864aee0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kapsl_sdk-0.1.23-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: kapsl_sdk-0.1.23-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 716.5 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8f36302f281afffab2052decffd36090690ade6583efa8968d7d217ffd7c0d32
|
|
| MD5 |
28e5f7c1b5db1c41c6f2774f8744fd20
|
|
| BLAKE2b-256 |
adc2ec7dcbfafe51e78652f8abfc11b92e90c944182d9caaf5aa1bf80e6d1ae5
|
Provenance
The following attestation bundles were made for kapsl_sdk-0.1.23-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-python-package.yml on kapsl-runtime/kapsl-sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapsl_sdk-0.1.23-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
8f36302f281afffab2052decffd36090690ade6583efa8968d7d217ffd7c0d32 - Sigstore transparency entry: 1253393237
- Sigstore integration time:
-
Permalink:
kapsl-runtime/kapsl-sdk@f25a1da23a1052c30ce6a878836399270864aee0 -
Branch / Tag:
refs/tags/v0.1.23 - Owner: https://github.com/kapsl-runtime
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python-package.yml@f25a1da23a1052c30ce6a878836399270864aee0 -
Trigger Event:
push
-
Statement type: