Skip to main content

Install and sign in

Install uv, then:
login prints a link and a code. Open the link, check that the code matches your terminal, and approve.

Download the project

It contains quickstart.py:

Run it

.local(), like a plain hello("LazyCloud") call, runs in your own Python process for free. .remote() uploads your code and runs the same function on a cloud machine with 1 CPU and 256 MiB, then streams its logs back and returns hello LazyCloud. The first remote call waits for the image to build. The CLI makes the same cloud call without a __main__ block:

Deploy the endpoint

greet is an HTTP endpoint that calls hello inside its own container and returns a Greeting model, which LazyCloud sends as JSON. Deploying the app puts both workloads in the cloud:
The app now runs on LazyCloud, not on your machine, and stays up after you close the terminal. The deploy output includes the endpoint’s HTTPS URL.

Call it

Over HTTP, with an access token from the dashboard under Settings, then Tokens:
From code in the same project, the decorated function is the client. It uses your lazycloud login sign-in:
From another project, a generated package gives typed calls without your source. Run the export there:
The HTTP and in-project calls return {"greeting": "hello LazyCloud"}. The typed package returns the same fields as a typed object. Typed client packages covers regenerating the package after a deploy.

Clean up

pause stops the app’s workloads and keeps their definitions. uv run lazycloud app delete quickstart removes the app.

Next