klio-compute
Python SDK and command line for Klio Compute: run functions, endpoints and GPU workloads on Klio's serverless platform.
Quick start
pip install https://compute.klio.tech/sdk/klio_compute-0.5.5-py3-none-any.whl
klio login
The newest release is always named in https://compute.klio.tech/sdk/latest.txt.
from klio_compute import function, Image
@function(image=Image(python_version="python3.12"))
def hello(name: str) -> str:
return f"Hello, {name}"
if __name__ == "__main__":
print(hello.remote("Klio"))
python app.py
klio --help
For CI, set KLIO_TOKEN instead of running klio login. Your login is stored
in ~/.klio/config.ini.
Coming from Modal
Change one line and keep the rest of your code:
import klio_compute.compat as modal # was: import modal
klio login
klio migrate --check . # what works, what warns, what is refused. Changes nothing.
klio migrate --write . # changes the import lines, and nothing else
klio run app.py # the local_entrypoint, or the only function
klio run app.py::fn --x 1 # a named function, with arguments from its type hints
klio deploy app.py # every function and class, as <app>-<name>
Functions and classes reuse warm containers, .map() keeps input order, and exceptions come back as the
type your function raised. Web functions are public unless they say requires_proxy_auth=True, in which case
callers send a Klio key as Authorization: Bearer. Anything that can't be honored stops with a clear message;
nothing is silently dropped.
What differs:
klio secret create NAME K=V K2=V2 --from-dotenv .env --forcemakes a group, as you're used to.klio volume put/get/ls/rm/cpwork on volumes.Volume.reload()right after a commit in another container waits until the data is readable there, which can take longer than you may be used to.@modal.clustered,@modal.batched,@modal.web_server,@modal.wsgi_app,.remote_gen(),CloudBucketMount,region=andcloud=aren't available, and say so when used.Image.run_functionruns your function during the build, without a GPU, volumes or secrets.- A
Cronin a time zone starts a short container often enough to check its local clock, and that time is billed. ADictentry lasts a week from when it was written, and aQueuea day from its last write. - What a function prints appears in your terminal when each call finishes, not line by line.
gpu=takes the types in your console. For another type, or more of anything, write to support@klio.tech.klio app list/info/logs/stop,klio curl URL,klio dashboardandklio shellare there too.
The same file can move back by restoring the import. Modal is a trademark of its owner; Klio Compute is not affiliated with it.
Images
Klio Compute runs Python 3.12. Image(python_version="python3.12") (and plain Image())
is the supported image, and anything built on it (python_packages, commands) can import
klio_compute in the container with nothing to install. Asking for another version stops with
a message before anything is sent.
An image with its own base_image or Dockerfile may use any Python. klio_compute.Image
adds one build step that installs this release of klio-compute (without its dependencies,
which the platform provides), so from klio_compute import function works inside it too. Use
Image from klio_compute, not from another package. Set KLIO_SDK_INSTALL_SPEC to install
from somewhere else, such as a private mirror.
Do not list klio-compute in python_packages: pip would then install its dependencies, and
those conflict with the versions the platform fixes in images.
Deploy a model
klio model deploy qwen3-14b
This deploys Qwen3 14B behind an OpenAI-compatible API on your own address, shows progress while it starts, and prints how to call it. It needs a key: requests without one are refused. Use the address as the base URL of any OpenAI client, with a key from Keys in the console.
From no machine, the first start has taken about 12 minutes, and that can vary. It stops by itself after
5 minutes without requests (--keep-warm changes that), and you pay while it runs. The next request starts
it again and waits while it loads. klio deployment stop <id> removes it. klio model list shows what you can deploy.
Troubleshooting
Your key isn't valid. Run klio login: the key was revoked or mistyped. Sign in again, or create a new key under Keys in the console if you useKLIO_TOKEN.GPUs aren't turned on for your account yet: nothing was started or charged. Write to support@klio.tech. Workloads without a GPU work now.klio doctorchecks your connection and credentials.
Built on beta9 and licensed AGPL-3.0
This package is a thin configuration layer over the open source
beta9 SDK (beta9 on PyPI), which is
licensed under the GNU Affero General Public License v3.0. It points that SDK
at Klio Compute and re-exports its public API. As a work that links to it,
klio-compute is also distributed under the AGPL-3.0-only; the full text is in
LICENSE. The package is plain Python, so its source is what you install. The beta9
copyright and license notices remain with its authors.
Metadata
Release files for klio-compute 0.5.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| klio_compute-0.5.5.tar.gz | 117.4 kB | Without provenance | Details for klio_compute-0.5.5.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| klio_compute-0.5.5-py3-none-any.whl | Python 3 | none | any | Details for klio_compute-0.5.5-py3-none-any.whl |
Total release size: 236.1 kB
Release files / klio_compute-0.5.5.tar.gz
| Download URL | klio_compute-0.5.5.tar.gz |
|---|---|
| Size | 117.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f20bb6c68da2464f243b7530da371dc90c4da2121b09fa7e69a1d31387646ce
|
|
BLAKE2b-256 checksum How to use checksums |
49cdfd85866019e26291d6c53508da378a0c65d43093416fa213b175aef345d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Release files / klio_compute-0.5.5-py3-none-any.whl
| Download URL | klio_compute-0.5.5-py3-none-any.whl |
|---|---|
| Size | 118.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
94e3da71a5e74abc3e8adaa2ffc3a0df11fb30820b823aa4a605f09b754e404c
|
|
BLAKE2b-256 checksum How to use checksums |
3174352e1c9f5f4c466faea8f0c094f91a6d31b16a3f4e68d8884d894700c14b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.11
|
Security for klio-compute 0.5.5
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.