> ## Documentation Index
> Fetch the complete documentation index at: https://levers9.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# CPU job

> Demo: cpu function

Source: `demo/cpu_job/app.py` in the repository.

The smallest useful thing: a Python function that runs remotely, one container per call, and fans out.

```bash theme={null}
cd demo/cpu_job

# one remote call, then map() over six inputs (one container each, results stream back)
python app.py

# deploy it as an HTTP function named is-prime
levers9 deploy app.py:is_prime --name is-prime

TOKEN=$(awk -F' = ' '/^\[default\]/{f=1} f&&/^token/{print $2; exit}' ~/.levers9/config)
curl -s -X POST localhost:1994/job/is-prime/v1 \
  -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  -d '{"n": 7919}'
# {"n": 7919, "prime": true, "host": "...", "pid": ...}

# debug inside the same blueprint
levers9 shell app.py:is_prime
```

Notes

* `.remote(...)` runs once and returns the result; `.map(iterable)` runs one container per item.
* `cpu=` and `memory=` are per container; `timeout=` and `retries=` control failures.
* The dashboard's **Apps** page lists this function and its runs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.