# Your own GPUs (https://orgasm.dev/docs/guides/own-gpus)

<Callout title="Early access">
  We are starting with a few design partners. Sign in and open [Your GPUs](/dashboard/compute) in your console to ask: name your Google Cloud project and its slots, and the page walks you through the rest once your project is approved.
</Callout>

The enclave that analyses live sessions is a public image anyone can run. With your own GPUs, it runs in your Google Cloud project, on your network, and orgasm.dev's API leases it for your sessions: the same keys, the same sessions, the same events and webhooks, with the media decrypted only in your project.

```mermaid
flowchart LR
  subgraph project [Your Google Cloud project and VPC]
    enclave["Enclave: the released image, on Intel TDX and an H100"]
  end
  device["The person's device, with the SDK"] -->|"verifies the attestation, then sealed media"| enclave
  server["Your server"] -->|"secret key: create the session"| api["orgasm.dev"]
  api -->|"control, pinned to the attested TLS key"| enclave
  enclave -->|"signed readings, never media"| api
  api -->|"events and webhooks"| server
```

## What stays in your project [#what-stays-in-your-project]

- **The enclave and the media.** The person's device publishes straight to an enclave in your project; orgasm.dev's servers and relays never carry it.
- **Your capacity.** The machines are yours, in your region, so your sessions never wait on a shared fleet.

## What orgasm.dev still does [#what-orgasmdev-still-does]

- Your keys, sessions, events, webhooks and usage, as with any live session.
- Leasing your enclaves to your sessions. Before each session, orgasm.dev asks the enclave for an attestation minted for that session and holds it to your project's values. Then it controls the enclave over a connection pinned to the TLS key that attestation names.
- Releasing the detectors to your enclaves. Only an enclave that proves all of this receives them: a released image, in production posture, on confidential hardware, in your approved project, reporting to orgasm.dev, and keeping no record.

## What nobody can do, you included [#what-nobody-can-do-you-included]

Owning the project lets you start, stop and name the machines. It does not let anyone read a session:

- The device verifies each enclave before it sends a frame, exactly as it does on orgasm.dev's fleet: the release signing key, the release, the hardware and debugging off since boot. A modified image is refused.
- The enclave's memory, its keys and the detectors in it cannot be read from the project. Its readings are signed with a key that never leaves it, and orgasm.dev takes none that is not.
- An enclave that would keep a record of the session never receives the detectors.

That is the point: your users can be told, and shown, that their video is analysed in a machine even you cannot see into.

## What you need [#what-you-need]

- A Google Cloud project with quota for `a3-highgpu-1g` Spot machines (one NVIDIA H100 each) as Confidential VMs, in a zone that offers them.
- A VPC and a subnet in each region your slots are in, and a public address for each slot, so devices can reach it.
- A domain name for each slot. Each enclave obtains its own certificate for its name at boot, so the name must point at the slot's address.
- Terraform, and the enclave release v0.20.0 or later, whose readings are signed.

## Set it up [#set-it-up]

<Steps>
<Step>

**Ask.** In [Your GPUs](/dashboard/compute), name your project and each slot's zone and DNS name. The slots will run as the account `enclave-slot-vm@<your project>.iam.gserviceaccount.com`.

</Step>
<Step>

**Approval.** The enclave's operator approves your project and that account for orgasm.dev as their controller. Your console then shows your deployment's `terraform.tfvars`, with everything it needs.

</Step>
<Step>

**Deploy.** From the enclave's source at its release tag, with the tfvars from your console and your VPC and subnet filled in:

```sh title="Terminal"
git clone --depth 1 --branch v0.20.0 https://github.com/Masseuse-ai/masseuse-video-tee enclave
cd enclave/deploy/own-project
terraform init && terraform apply
```

It creates the slots, their account, addresses and firewall rules on your network, and lets each enclave obtain its certificate in your project. [The module](https://github.com/Masseuse-ai/masseuse-video-tee/tree/master/terraform/modules/slot) is the same machine orgasm.dev's fleet runs.

</Step>
<Step>

**Point DNS** at each slot's address (`terraform output slots`).

</Step>
<Step>

**Verify.** With a slot up, run the `tee-verify` command your console prints for it ([Verify the enclave](/docs/guides/verify)). It passes only for a released image, signed, with its SLSA provenance, in production posture, on this hardware, reporting to orgasm.dev and keeping no record.

</Step>
<Step>

**Route.** Your live sessions go to your slots first and to orgasm.dev's fleet when none of yours is free or passes its checks. Choose your slots only and a session that none of them can take is refused with `capacity_unavailable`. Each session's [receipt](/docs/guides/verify#read-a-sessions-receipt) names the project its enclave ran in.

</Step>
</Steps>

## Releases and leaving [#releases-and-leaving]

Your approval covers the release digests it names. To move to a newer release, ask in your console. Once the digest is approved, change `container_image` to it and apply.

To leave, withdraw in your console and run `terraform destroy`. Withdrawing sends your sessions back to orgasm.dev's fleet at once. Once the operator removes your project, your slots can no longer read the detectors.
