Metadata-Version: 2.5
Name: nodus-compute
Version: 1.0.11
Summary: Python SDK for Nodus: Functions, Sandboxes, Jobs, Volumes, Workspaces and inference
Project-URL: Homepage, https://nodus-compute.ai
Project-URL: Documentation, https://nodus-compute.ai/docs/guides/python/
Project-URL: Source, https://github.com/nodus-compute/nodus-platform/tree/main/sdk/python
Author: Nodus Compute
License-Expression: Apache-2.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Requires-Dist: cloudpickle<4,>=3.1
Requires-Dist: httpx<1,>=0.28
Requires-Dist: pathspec>=0.12
Requires-Dist: pydantic<3,>=2.6
Requires-Dist: python-dotenv>=1
Requires-Dist: pyyaml>=6
Requires-Dist: synchronicity<0.13,>=0.12.5
Requires-Dist: websockets>=15
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.40; extra == 'anthropic'
Provides-Extra: openai
Requires-Dist: openai>=1.40; extra == 'openai'
Description-Content-Type: text/markdown

# nodus-compute

The Python SDK for [Nodus](https://nodus-compute.ai): run functions, sandboxes, jobs and workspaces on the cheapest
capacity that finishes them on time, with checkpoints, recovery and exact prepaid billing.

```console
pip install nodus-compute
nodus login
```

```python
import nodus

app = nodus.App("hello")


@app.function(gpu="H100", timeout="1h", max_cost=5)
def square(x: int) -> int:
    return x * x


@app.local_entrypoint()
def main():
    print(square.remote(7))  # one call; blocks and returns 49
    print(list(square.map(range(10))))  # fan out; results stream back in order
```

```console
nodus run app.py      # ephemeral: the App is deleted when main() returns
nodus deploy app.py   # persistent: call it later with nodus.Function.from_name("hello", "square")
```

Every blocking call also has an `.aio` form for asyncio code: `await square.remote.aio(7)`.

- Guides: <https://nodus-compute.ai/docs/guides/python/>
- Coming from Modal: <https://nodus-compute.ai/docs/getting-started/modal-users/>
- Examples: [`examples/python/`](../../examples/python/)

## Layout

| Path | What |
|---|---|
| `src/nodus/api/` | Layer 1: the generic resource client (`nodus.api.get`, `list`, `watch`, `apply`, …) |
| `src/nodus/api/models/` | Generated pydantic models (`make gen`; never edit) |
| `src/nodus/errors/` | One exception per error-registry code, plus the SDK's outcome errors |
| `src/nodus/*.py` | Layer 2: `App`, `Function`, `Image`, `Volume`, `Secret`, `Sandbox`, `Job`, `Workspace`, `llm` |
| `src/nodus/runtime.py`, `log.py`, `checkpoint.py`, `cluster.py` | In-container helpers; no-ops outside Nodus |
| `src/nodus/_runtime/` | The in-container worker runtimes (Functions, durable steps, agents) |

## Development

```console
make -C sdk/python lint    # ruff lint and format check, mypy strict on nodus.api
make -C sdk/python gen     # regenerate nodus.api.models from api/openapi
make -C sdk/python docs    # griffe dump for the reference pages
```

The SDK has no tests of its own: the compose journeys exercise it end to end. The per-platform wheels that embed the
CLI are built with `NODUS_CLI_BIN=<binary> NODUS_WHEEL_PLATFORM=<tag> make -C sdk/python wheel-cli`.
