Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
File size: 4,194 Bytes
a8fb296 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | ---
title: GPU steps on Modal
description: Run speech-to-text and speaker separation on a Modal GPU from GitHub, within Modal's free monthly credit.
---
# GPU steps on Modal
**What it's for:** the GPU step that turns a meeting recording into a transcript with speakers (WhisperX), without a
local GPU. It runs on Modal, a serverless GPU service whose free Starter plan includes a monthly compute credit, and
starts from GitHub Actions, so it can be run from a phone
([#314](https://github.com/getcommunityone/open-navigator/issues/314)).
**Runs go to Colab, not here.** On November 17, 2026, the owner decided that diarization runs on the owner's Colab
([GPU compute decisions](../development/gpu-compute-decisions.md)). Use [GPU speakers on Colab](colab-gpu-diarize.md).
This workflow and its code are kept but not used for runs.
<details>
<summary><b>Set it up from a phone (about 10 minutes)</b></summary>
1. **Modal account:** sign up at [modal.com](https://modal.com). The free Starter plan gives a monthly credit (larger
with a payment method on file). Without a card, work stops when the credit runs out, which caps spending at zero.
With a card, use past the credit is billed, so watch the dashboard or keep runs small.
2. **Modal token:** modal.com β **Settings** β **API tokens** β **New token**. Copy the token ID and secret.
3. **GitHub secrets:** repository **Settings** β **Environments** β `dev` β add `MODAL_TOKEN_ID` and
`MODAL_TOKEN_SECRET`. Never paste them anywhere else.
4. **Hugging Face token for the speaker models:** signed in on huggingface.co, open
[pyannote/speaker-diarization-community-1](https://huggingface.co/pyannote/speaker-diarization-community-1) and
accept its conditions (current WhisperX uses it; with only the older model accepted, speakers come back empty). For
older WhisperX versions, also accept [speaker-diarization-3.1](https://huggingface.co/pyannote/speaker-diarization-3.1)
and [segmentation-3.0](https://huggingface.co/pyannote/segmentation-3.0). Then make a **read** token with the same
account ([settings/tokens](https://huggingface.co/settings/tokens)). Add it as a third GitHub secret, `HF_TOKEN`;
each run copies it into the Modal secret `huggingface`. (Or make that secret yourself in Modal β **Secrets** β
**Create new secret** β **Custom**, key `HF_TOKEN`.)
5. **Run it:** GitHub β **Actions** β **GPU diarization on Modal** β **Run workflow**, with the items to process.
</details>
<details>
<summary><b>What to give it</b></summary>
- A path in the Modal volume `open-navigator-audio`, e.g. `meetings/2026-11-03.opus`. Put files there from a laptop:
`modal volume put open-navigator-audio <file> meetings/<file>`.
- Or a direct link to a media file a city publishes (not YouTube: YouTube blocks cloud servers, see
`packages/scrapers/src/scrapers/youtube/BYPASS_IP_BLOCK.md`).
Each run takes at most `limit` items (default 3), so one run can't use the month's credit.
</details>
<details>
<summary><b>What comes back, and what it costs</b></summary>
The run's artifact holds `<name>.diarized.json` per item (segments with start, end, speaker and text) and
`usage.jsonl`: one row per item with the GPU, seconds, GPU-hours and an **estimated** cost. The estimate is GPU time at
Modal's published rate (T4 $0.000164 a second, as reported on 2026-11-14); CPU and memory are billed on top, so the
invoice is a little higher. Modal's dashboard shows the real spend.
Not run yet: the first real run checks that the pinned WhisperX version still exposes the diarization pipeline the
code calls (`llm.gemini.diarize_postprocess`).
</details>
<details>
<summary><b>Credentials</b></summary>
| Credential | Where it's made | Scope | Goes to | Lifetime |
|---|---|---|---|---|
| Modal API token | modal.com β Settings β API tokens | the Modal workspace | GitHub environment `dev`: `MODAL_TOKEN_ID`, `MODAL_TOKEN_SECRET` | until revoked; revoke if unused |
| Hugging Face read token | huggingface.co β Settings β Access tokens | read, gated models accepted | GitHub environment `dev`: `HF_TOKEN`, copied each run into Modal secret `huggingface` | 90 days |
</details>
|