# Journey 4: Multi-Machine Developer

**Persona**: Solo Dev Sarah
**Scenario**: RTX 4090 at home, MacBook for travel, same API from both
**Status**: Designed. Requires relay (ADR-009, milestones M1-M5)

## This Is the Relay's Primary Customer

This journey is *the reason* the self-hosted relay exists. "My 4090 at home is serving my laptop at a coffee shop. Cost: $0." is the viral moment.

## Steps on Home Machine

```bash
llmhosts up
# GPU is now accessible from anywhere via relay
```

## Steps on MacBook (or any device)

```bash
export OPENAI_BASE_URL=https://your-device.llmhosts.com/v1
export OPENAI_API_KEY=lh_sk_...
# Every OpenAI-compatible tool now uses your home GPU
```

## What Works Transparently

LangChain, Continue, Aider, Cursor, Claude Code, custom Python scripts, curl, any OpenAI SDK client. Change two env vars, everything routes to your GPU.

## What Happens Under the Hood

1. `llmhosts up` authenticates with Device Code Auth (RFC 8628)
2. Gets relay token from `POST /api/devices/relay-token`
3. Opens WSS connection to `wss://llmhosts.com/api/relay/connect`
4. Noise NK handshake establishes encrypted channel *(planned — relay M2 #440)*
5. yamux session created for multiplexed request streams
6. VPS assigns `your-device.llmhosts.com` as relay URL
7. Any HTTPS request to that URL → relayed through WSS → forwarded to local proxy

## Success Criteria

- [ ] `curl https://device.llmhosts.com/v1/models` returns models from home GPU
- [ ] Works from any network (coffee shop WiFi, hotel, mobile hotspot)
- [ ] Works behind NAT, corporate firewall, hotel WiFi
- [ ] Reconnects automatically on network interruption
- [ ] <50ms relay overhead (excluding network RTT)
- [ ] Streaming (SSE) works end-to-end through relay
- [ ] Two env vars is all the client device needs

## Features Exercised

- ADR-009 Self-hosted relay (WSS + yamux + Noise NK)
- Device Code Auth (RFC 8628)
- Relay token management
- Automatic reconnection with exponential backoff
- LLMHosts branded URL (`device.llmhosts.com`)

## Dependencies

- Relay milestones M1-M5 (#439-#443)
- Wildcard DNS for `*.llmhosts.com`
- Relay server deployed on VPS
