Skip to content

Minimal implementation of modal platform with apps, images, volumes, sandboxes and secrets.

License

Notifications You must be signed in to change notification settings

WazupSteve/nano-modal

Repository files navigation

Nano Modal

Logo

A minimal serverless platform for running Python functions in containers.

Quick Start

import nano_modal

app = nano_modal.App("demo")

@app.function()
def square(x):
    return x * x

# Run locally
print(square.local(5))  # 25

# Run in container (needs server running)
print(square.remote(5))  # 25

# Run in parallel
results = list(square.map(range(10)))
print(results)  # [0, 1, 4, 9, 16, 25, 36, 49, 64, 81]

Installation

uv pip install -e ".[dev]"

Development

# Start Redis
docker run -d -p 6379:6379 redis:7-alpine

# Start server
uv run -m server.main

# Start worker (in another terminal)
uv run -m worker.main

# Run an example
uv run examples/hello.py

Documentation

License

MIT

About

Minimal implementation of modal platform with apps, images, volumes, sandboxes and secrets.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages