Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions packages/drawtonomy-dev-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,38 @@ open "http://localhost:3000/?ext=http://localhost:3001/manifest.json"
- This dev server runs locally on HTTP, so localhost extensions work without issues
- Always up-to-date with `drawtonomy.com` — no manual version management

## AI scenario generation (bring your own key)

drawtonomy can generate a driving scenario from a plain-text description. The
generation loop runs in your browser, but browsers cannot call the AI vendors
directly — each vendor sets its own CORS policy, and some refuse browser-origin
requests outright. This server therefore exposes one route,
`POST /api/ai-scenario/llm-relay`, and forwards the request for the page.

Enter your own API key in the editor (the AI panel has a provider picker and a
key field). Supported providers:

| Provider | Key from |
|---|---|
| Anthropic | https://console.anthropic.com/ |
| OpenAI | https://platform.openai.com/api-keys |
| Gemini | https://aistudio.google.com/apikey |

The key is sent with each request as a header, used only to build the outgoing
call, and then discarded. It is never written to disk, never added to the
server's environment, and never logged. Requests are billed to your own account
by the provider you pick.

The relay is a development convenience bound to the same localhost surface as
the file serving — do not expose this server to a network you do not control.

## Options

| Environment Variable | Default | Description |
|---------------------|---------|-------------|
| `PORT` | `3000` | Server port |
| `DRAWTONOMY_HOST` | `https://www.drawtonomy.com` | Host to download from |
| `DRAWTONOMY_LLM_BASE_URL` | _(unset)_ | Send AI requests to this host instead of the real providers — for testing without a key |

```bash
# Custom port
Expand Down
Loading