Ornn

Ornn Serverless

Run Python on GPUs with one decorator.

Annotate a class or function, deploy it with one command, and call it like a local object. Ornn starts replicas when calls arrive and scales them to zero when they go quiet.

pip install ornn

How it works

From pip install to a GPU endpoint in four steps

No Dockerfiles to write, no clusters to size, and no YAML. Your code is the configuration.

  1. 01

    Install and sign in

    ornn login signs the CLI and the Python SDK in with your Ornn account.

    Terminal
    pip install ornn
    ornn login
  2. 02

    Write your app

    Each @app.cls, @app.fn, or @app.server is its own unit with its own replicas. Ask for a GPU type and Ornn sizes CPU, memory, and disk to match.

    app.py
    import ornn
    
    app = ornn.App("hello-gpu")
    
    @app.cls(gpu="H100", idle_timeout="5m")
    class Model:
        @ornn.enter
        def load(self):
            self.pipe = load_pipeline()  # once per replica
    
        def generate(self, prompt):
            return self.pipe(prompt)
    
    @app.fn(gpu="H100")
    def embed(texts):
        return encoder(texts)
  3. 03

    Deploy

    One command uploads your code. Code-only deploys never rebuild images, and anything your units print shows up in ornn serverless logs.

    Terminal
    ornn serverless deploy ./app.py
    ornn serverless logs hello-gpu
  4. 04

    Call it from anywhere

    Look the app up by name and call its units like local objects. Replicas start when calls arrive and stop when they go quiet.

    client.py
    import ornn
    
    ornn.use()  # your organization's namespace
    app = ornn.App.lookup("hello-gpu")
    
    print(app.Model.generate("Write a haiku about GPUs"))
    
    # fan out across replicas
    vectors = list(app.embed.map(batches))

Features

Everything a GPU workload needs

Options live on the decorator, next to the code they configure.

  • Scale to zero

    Replicas start when calls arrive and stop after idle_timeout. Keep min_replicas warm when cold starts matter.

  • GPUs by type or by memory

    Ask for gpu="H100:2" or min_gpu_memory=160. The scheduler picks the GPU and sizes the rest.

  • Fan-out and background calls

    .map runs inputs in parallel with ordered results. .spawn returns at once and can be collected from any process.

  • Shared state

    ornn.Dict and ornn.Queue are shared by every replica, so units can count, cache, and hand off work.

  • Secrets and volumes

    Secrets become environment variables and are never shown after you set them. Mount your organization's volumes at any path.

  • HTTP servers

    @app.server(port=8000) serves HTTP, including streaming, at the unit's URL. Run vLLM or your own API.

  • Image builds

    Chain apt_install and pip_install, or bring a Dockerfile. Images are cached by step, so changing one step rebuilds from there.

  • Your own reserved nodes

    Create a Serverless controller from nodes you've reserved on Ornn, and your units run only on them.

  • Clients in other languages

    Call units with JSON from Node (@ornn/api), Rust (ornn-api), or a header-only C++ client.

Get started

Ship your first GPU function today

Install the SDK, sign in with your Ornn account, and deploy.

pip install ornn
Read the Serverless guide