# Coming from Modal

> Run a Modal project on Klio Compute by changing its import line; klio migrate --check reports what works first.

Canonical page: https://klio.tech/docs/migrate-from-modal

## Change one line

```python
import klio_compute.compat as modal   # was: import modal
```

The 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

```bash
klio login
klio migrate --check .
klio migrate --write .
klio run app.py
klio run app.py::fn
klio deploy app.py
```

- `klio migrate --check` reports what works, what warns and what is refused, and changes nothing. `--json` prints the report as JSON.
- `klio migrate --write` changes the import lines, and nothing else.
- `klio run app.py` runs the local entrypoint, or the only function. `klio run app.py::fn` runs a named function; arguments after it are passed to the function by name, from its type hints.
- `klio deploy app.py` deploys 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=` and `cloud=` aren't available, and say so when used.
- `Image.run_function` runs your function during the build, without a GPU, volumes or secrets.
- A `Cron` in a time zone starts a short container often enough to check its local clock, and that time is billed.
- A `Dict` entry lasts a week from when it was written, and a `Queue` a 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 `klio gpus`, with up to 8 of one type, such as `gpu="H100:8"`. For more, write to support@klio.tech.
- `klio secret create NAME K=V K2=V2 --from-dotenv .env --force` makes a group, and `klio volume put/get/ls/rm/cp` work on volumes.
- `klio app list`, `klio app logs`, `klio app stop`, `klio curl`, `klio dashboard` and `klio shell` are there too.
