Change one line
import klio_compute.compat as modal # was: import modalThe rest of your code stays as it is. The same file can move back by restoring the import. Modal is a trademark of its owner; Klio Compute is not affiliated with it.
Check first
klio login
klio migrate --check .
klio migrate --write .
klio run app.py
klio run app.py::fn
klio deploy app.pyklio migrate --checkreports what works, what warns and what is refused, and changes nothing.--jsonprints the report as JSON.klio migrate --writechanges the import lines, and nothing else.klio run app.pyruns the local entrypoint, or the only function.klio run app.py::fnruns a named function; arguments after it are passed to the function by name, from its type hints.klio deploy app.pydeploys every function and class, each as<app>-<name>.
What works the same
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; callers then send a Klio key as Authorization: Bearer. Anything that can't be honored stops with a clear message; nothing is silently dropped.
What differs
@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. - A
Dictentry 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 inklio gpus, with up to 8 of one type, such asgpu="H100:8". For more, write to support@klio.tech.klio secret create NAME K=V K2=V2 --from-dotenv .env --forcemakes a group, andklio volume put/get/ls/rm/cpwork on volumes.klio app list,klio app logs,klio app stop,klio curl,klio dashboardandklio shellare there too.