Skip to main content

Serverless GPU functions — deploy ML models with a decorator

Project description

Zylora

zylora

Serverless GPU functions — deploy ML models with a decorator, scale to zero, pay per GPU-second.

PyPI License: MIT Python 3.10+

Quickstart

pip install zylora

Define a GPU function

import zylora

@zylora.fn(gpu="H100")
def embed(text: str) -> list[float]:
    from transformers import AutoModel
    model = AutoModel.from_pretrained("BAAI/bge-large-en-v1.5")
    return model.encode(text).tolist()

Deploy

zy deploy

Invoke

# Local (development)
result = embed("hello world")

# Remote (deployed)
result = embed.remote("hello world")

# Batch
results = embed.map(["hello", "world", "foo"])

# Streaming (for LLMs)
for token in generate.stream("Tell me a joke"):
    print(token, end="", flush=True)

# Async
job = embed.remote_async("hello")
result = job.result()

Client API (without decorator)

from zylora import Zylora

zy = Zylora()
result = zy.invoke("embed", {"text": "hello"})

Authentication

Set your API key via environment variable:

export ZYLORA_API_KEY="zy_live_..."

Or use the CLI:

zy login

Configuration

@zylora.fn() options

Parameter Type Default Description
gpu str required GPU type: t4, l4, rtx4090, a100_40gb, a100_80gb, l40s, h100, h200, b200, mi300x
name str function name Custom function name
packages list[str] [] pip packages to install
model str None Model to download during build
timeout int 300 Execution timeout (seconds)
min_instances int 0 Minimum warm instances
max_instances int 10 Maximum concurrent instances
concurrency int 1 Requests per instance
image str None Custom base Docker image
runtime str "python312" Python runtime version
routing str "cost_optimized" Routing strategy
visibility str "private" Function visibility

Documentation

Full documentation: docs.zylora.dev

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zylora-0.1.0.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zylora-0.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file zylora-0.1.0.tar.gz.

File metadata

  • Download URL: zylora-0.1.0.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zylora-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3efc0c9b9357403f8fcc4dd9694676e2c80e7996d69fa3ea1c8b3613adced601
MD5 e9753e552bce7e818e2c23652c0e07a3
BLAKE2b-256 25edf31bafbffef4930d8a6c2a87df0b924cd83a544c274279f02980ae6e7b52

See more details on using hashes here.

Provenance

The following attestation bundles were made for zylora-0.1.0.tar.gz:

Publisher: sdk-publish-python.yml on zylora-dev/zylora-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file zylora-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zylora-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zylora-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c0ee1f79eb1abb5165dc31f99b970f153798fdb5e201bbf2aa8e6ee62748cfd
MD5 4da9030dbe58e740832e6cc062138ef9
BLAKE2b-256 f836b09b17999cc4f4f7518cd5520b20ee27c963a2a935768fe264447a694a72

See more details on using hashes here.

Provenance

The following attestation bundles were made for zylora-0.1.0-py3-none-any.whl:

Publisher: sdk-publish-python.yml on zylora-dev/zylora-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page