SottoMD

Run SottoMD on your own server

This is the self-host path: everything that hears a visit runs on a box your practice controls. The audio, the transcript, the note and the EHR drafts never leave your network. Until a BAA exists for our hosted options, this is the only way to use SottoMD with real patients.

You set up two things:

  1. The engine: decosa-api's clinical stack, meaning speech recognition, speaker labels and the language model, on a GPU box.
  2. The app: this repository, plus HTTPS in front of it and, optionally, the EHR bridge.

The app is light, so it can share the GPU box or run on a small machine next to it.

What you need

1. The engine

Follow decosa-api's own guide, Assemble the Decosa visit copilot on this machine. It's the clinical tool's self-host prompt, and the Decosa team gives you the source.

Then make an API key for the app. It never leaves your box:

ADMIN=$(openssl rand -base64 24)    # set DECOSA_ADMIN_SECRET=$ADMIN in the engine's .env and restart its api
curl -s -X POST http://127.0.0.1:8445/v1/keys -H "Authorization: Bearer $ADMIN" -H 'Content-Type: application/json' \
  -d '{"label":"sotto app","verticals":["clinical","ehr-drafts"],"daily_llm_tokens":5000000,"daily_audio_seconds":28800}' > app-key.json

2. The app

git clone <the SottoMD repository> sotto && cd sotto/deploy/selfhost
./gen-secrets.sh              # writes VISIT_APP_KEK into .env and a bridge token into secrets/ (prints no secrets)
$EDITOR .env                  # APP_ORIGIN and SITE_HOST: the name clinicians will open
docker compose up -d --build  # the app and Caddy (HTTPS)

3. First sign-in

The first owner is created from the command line. There's no sign-up page:

docker compose exec app node_modules/.bin/tsx scripts/invite.ts --email [email protected] --name "Dr. You" --practice "Your Practice" --state CA

4. HTTPS on your devices

5. Optional: EHR drafts into OpenEMR

The bridge runs decosa-api's ehr-drafts engine next to your OpenEMR. It opens the chart, checks the patient's name and date of birth, types each item as a draft, and stops before sign.

docker compose --profile openemr up -d

6. Check it end to end

Do this with a made-up visit first:

  1. Today: add a visit for a made-up patient, or use a demo practice.
  2. Consent: the patient's consent is on file, or you tap They agreed.
  3. Record: Use this device's microphone, or Use my phone as the mic and scan the QR code. Act out a short visit.
  4. Review: end the visit, and the note, codes and forms are ready in about a minute. Every sentence links to what was said.
  5. Receipts: under Audit & receipts, Verify 5 at random. Each receipt is signed by your engine's own key.

What leaves the box