Get Your First Function Running on a GPU.
Three steps, five minutes of your time. Most of that is waiting for pip install; the GPU takes a few minutes more to arrive. You'll need an SSH key and Python 3.10, the version inside the default image: your function ships as-is and runs on the Python it finds there.
Register Your SSH Key
Mimiry uses an SSH key to authenticate every API call. There's no browser sign-in, no API token to paste. If you don't already have a key for Mimiry, generate one:
ssh-keygen -t ed25519 -f ~/.ssh/mimiry -C "mimiry"
Sign in to the platform manager and add the public half (~/.ssh/mimiry.pub):
Then point the SDK at your private key:
export MIMIRY_SSH_KEY=~/.ssh/mimiry
~/.zshrc, ~/.bashrc) so it sticks across new terminals.Install the SDK
pip install mimiry
This brings in the mimiry Python library and a small mimiry CLI. Check that your key works:
mimiry balance
{
"account_type": "user",
"balance": 20.0,
"available": 20.0,
"currency": "EUR",
"total_spent": 0.0,
"active_sessions": 0
}You should see a JSON snippet with your account balance in EUR. If you do, you're authenticated.
Then see what is on the floor right now:
mimiry availability
A100_80G_SXM 80 GB verda FIN-01, FIN-02, FIN-03 €1.85/h
H100_80G_SXM 80 GB verda FIN-01, FIN-02 €3.36/h
H200_141G_SXM 141 GB verda FIN-02, FIN-03 €4.13/hGPUs, locations, and hourly rates, live (the real output is JSON; this is the shape). Availability changes through the day, sometimes within minutes; this is the catalog your session is scheduled against. A family name like A100 is enough: the SDK sends every size that is available, cheapest first, and the platform picks.
Run Your First Function
Save this as hello_gpu.py:
import mimiry @mimiry.function() # defaults: an A100, nvcr.io/nvidia/pytorch:24.01-py3 def gpu_info() -> str: """Return whatever nvidia-smi sees on the GPU.""" import subprocess return subprocess.check_output( ["nvidia-smi", "--query-gpu=name,memory.total", "--format=csv,noheader"], text=True, ).strip() if __name__ == "__main__": print(gpu_info.remote())
Then run it:
python hello_gpu.py
The SDK narrates on stderr while the machine comes up. Provisioning takes about a minute, boot another one or two, and pulling the image three to five: the image is most of the wait, and your function runs in under a second once it is there.
[mimiry] session a2ac3118-… submitted
[mimiry] state=provisioned
[mimiry] state=pulling_image
[mimiry] state=running
[mimiry] fetching result
[mimiry] session a2ac3118-…: A100_40G_SXM for 478s, cost 0.2219 EURNVIDIA A100-SXM4-40GB, 40960 MiBEvery call leaves the bill on the function. Sessions are charged in ten-minute blocks, so a first run like this one costs one block at the GPU's hourly rate:
print(gpu_info.last_run.final_cost) # 0.221751 print(gpu_info.last_run.phases) # {'provisioned': 52.1, 'pulling_image': 174.9, 'running': 472.3}
That's It. Welcome to Mimiry.
That was your Python, on an A100, in one command.
Where to go next
Three small things to try once your first function works.
Raw bash with mimiry.run
Shell commands on a GPU, with stdout and stderr returned as a Python string.
/docs/runPick a different GPU
mimiry availability shows what is on the floor, then gpu="H100" on the decorator. A family name is enough; the SDK picks the cheapest size that is free.
Keep data between runs
Create a volume once with mimiry volume create, attach it with volume="name" on the decorator, and write to /data. The next session finds it there.