Skip to main content

Private models and datasets

Run a model or dataset the GPU provider must not see. You rent a Confidential Computing machine, the pod proves what machine it is on, and only then does your own key service release a short-lived key that decrypts your data.

What is guaranteed​

On a Confidential Computing machine, after your verifier checks the pod's quote (step 4):

  • The provider cannot read the VM's memory or disk. Intel TDX encrypts them.
  • The quote does not identify your image or your pod. It measures the machine. Rent every GPU so yours is the only pod on it.
  • Lium's node software still runs inside the VM. The VM keeps the provider out, not Lium.
  • GPU memory and the CPU-GPU link are not covered. The label comes from the CPU's TDX quote; Lium only observes GPU attestation. If you need GPU protection, check the GPUs with NVIDIA's attestation tools from your pod before you load anything.
  • Data that leaves the VM (backups, volumes, logs, network) is protected only if you encrypt it.

On an ordinary machine none of this holds (Pod security).

The flow​

1. Prepare outside Lium

  • Encrypt the weights or dataset with a data key and upload only the ciphertext.
  • Keep the data key in a key service you control (the key broker).
  • Build an image with your code and the dstack SDK, and no secrets.

2. Rent a Confidential Computing machine

On Browse Pods, turn on the Confidential Computing filter and rent all GPUs of a machine. With the SDK: Lium.up(executor_id=..., gpu_count=...); with the CLI: lium up <id> -c <gpu_count>.

Don't put secrets in the rent request, template or start command.

3. Get a quote from inside the pod

Make an in-memory key pair, get a nonce from your broker, and bind both into the quote:

import hashlib

from cryptography.hazmat.primitives.asymmetric.x25519 import X25519PrivateKey
from cryptography.hazmat.primitives.serialization import Encoding, PublicFormat
from dstack_sdk import DstackClient

nonce = get_nonce_from_your_broker() # your code
private_key = X25519PrivateKey.generate()
public_key = private_key.public_key().public_bytes(Encoding.Raw, PublicFormat.Raw)

quote = DstackClient().get_quote(hashlib.sha256(public_key + nonce).digest())
send_to_your_broker(quote.quote, quote.event_log, public_key, nonce) # your code

4. Verify the quote and release the key​

The broker releases nothing until all three pass:

  1. Signature and TCB: the quote verifies with an Intel DCAP verifier or the dstack verifier, and its TCB status is up to date. Refuse a quote whose TCB is out of date.
  2. Binding: report_data equals sha256(public_key + nonce), with a fresh, unused nonce.
  3. Measurements: MRTD and RTMR0–2 match the dstack OS release in the CVM guide, and RTMR3 matches the "CVM attestation" section of the executor release notes.

Then the broker encrypts the data key to the pod's public key and returns it.

5. Load the data

Decrypt into memory or /root. Don't write plaintext to a volume or a backed-up path.

6. End the run

Terminate the pod. Revoke any storage credential still valid.

Keep credentials short-lived​

  • Lium API key: on your laptop or CI, never the pod. Set a budget.
  • Storage access: a read-only pre-signed URL or temporary token that expires on its own.