Serverless GPU functions — deploy ML models with a decorator
Project description
zylora
Serverless GPU functions — deploy ML models with a decorator, scale to zero, pay per GPU-second.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3efc0c9b9357403f8fcc4dd9694676e2c80e7996d69fa3ea1c8b3613adced601
|
|
| MD5 |
e9753e552bce7e818e2c23652c0e07a3
|
|
| BLAKE2b-256 |
25edf31bafbffef4930d8a6c2a87df0b924cd83a544c274279f02980ae6e7b52
|
Provenance
The following attestation bundles were made for zylora-0.1.0.tar.gz:
Publisher:
sdk-publish-python.yml on zylora-dev/zylora-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zylora-0.1.0.tar.gz -
Subject digest:
3efc0c9b9357403f8fcc4dd9694676e2c80e7996d69fa3ea1c8b3613adced601 - Sigstore transparency entry: 1305874452
- Sigstore integration time:
-
Permalink:
zylora-dev/zylora-python@32b46abbf9d4c2e40a2440b988ab6914b3b4aa55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zylora-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish-python.yml@32b46abbf9d4c2e40a2440b988ab6914b3b4aa55 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c0ee1f79eb1abb5165dc31f99b970f153798fdb5e201bbf2aa8e6ee62748cfd
|
|
| MD5 |
4da9030dbe58e740832e6cc062138ef9
|
|
| BLAKE2b-256 |
f836b09b17999cc4f4f7518cd5520b20ee27c963a2a935768fe264447a694a72
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
zylora-0.1.0-py3-none-any.whl -
Subject digest:
3c0ee1f79eb1abb5165dc31f99b970f153798fdb5e201bbf2aa8e6ee62748cfd - Sigstore transparency entry: 1305874519
- Sigstore integration time:
-
Permalink:
zylora-dev/zylora-python@32b46abbf9d4c2e40a2440b988ab6914b3b4aa55 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/zylora-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
sdk-publish-python.yml@32b46abbf9d4c2e40a2440b988ab6914b3b4aa55 -
Trigger Event:
push
-
Statement type: