Deploy an endpoint
from klio_compute import endpoint, Image
@endpoint(gpu="L4", image=Image(python_version="python3.12"), keep_warm_seconds=60)
def predict(**inputs):
return {"echo": inputs}klio deploy app.py:predictThe deploy prints the endpoint's address. Requests need a key: send one from Keys in the console as Authorization: Bearer.
Call it
curl -X POST https://<your-endpoint-address> \
-H "Authorization: Bearer $KLIO_TOKEN" \
-H "Content-Type: application/json" \
-d '{"text": "hello"}'klio curl sends the same request with the key you signed in with, and only ever to an endpoint's own address.
Scale to zero
An endpoint's containers stop after keep_warm_seconds without requests, and nothing is billed while none run. The next request starts one again, which takes longer than a warm request. Raise keep_warm_seconds to keep it ready for longer.
Manage deployments
klio deployment list
klio deployment stop <deployment-id>
klio app list
klio app logs <app>Every deployment is also in the console, with its logs, usage and cost.