Setup wizard
The Setup Wizard is an agent-driven flow that walks you through linking every provider NVTrader can talk to — brokers, market-data sources, LLM endpoints — and runs a smoke connection test on each. It reads from skills/setup/*.md so the steps stay in sync with the operator playbooks.
What it is · how it works · why it matters
An agent-driven flow that links every supported provider — brokers, data sources, LLMs — and smoke-tests each before activation. 18 providers supported.
Reads skills/setup/<cat>/<id>.md — same files double as operator playbooks. Steps: pre-flight (cost, account type) → get-the-key (link + URL) → paste-and-encrypt (Fernet at rest) → smoke-test → activate. Adding a provider = one markdown file + one adapter class.
Provider onboarding runs through a typed chat flow; each step links the right account-setup URL and runs a smoke connection test. Providers are optional, so the base install surface stays small.
How to invoke it
- From any page, click 🪄 Wizard in the embedded chat panel or
- type
get_setup_guide alpacain chat (substitute the provider id), or - navigate to Account → API keys and click Configure next to a provider.
The wizard reads the matching markdown file from skills/setup/<category>/<provider>.md and reformats it as a step-by-step in-chat experience. Each step ends with a button that copies the right URL to your clipboard or pre-fills the right field.
Supported providers
| Category | Provider | Status | Source |
|---|---|---|---|
| Brokers | SimBroker | live | skills/setup/brokers/sim.md |
| Alpaca paper + live | live | skills/setup/brokers/alpaca.md | |
| Webull OpenAPI | UAT pending | skills/setup/brokers/webull.md | |
| IBKR · Tradier | stub | — | |
| Data | yfinance | live | skills/setup/data/yfinance.md |
| Finnhub | live | skills/setup/data/finnhub.md | |
| Tavily | live | skills/setup/data/tavily.md | |
| SEC EDGAR | live | skills/setup/data/edgar.md | |
| Polygon | optional | skills/setup/data/polygon.md | |
| LLM | NVIDIA Build | live | skills/setup/llm/nvidia.md |
| OpenRouter | optional | skills/setup/llm/openrouter.md | |
| Hugging Face Inference | optional | skills/setup/llm/huggingface.md | |
| OpenAI-compatible (vLLM, Groq, Ollama …) | optional | skills/setup/llm/openai_compatible.md |
What the wizard does
For every provider the steps are the same shape, so the flow is predictable:
- Pre-flight — wizard tells you what kind of account you need and the rough cost (e.g. Alpaca paper is free; Finnhub free tier caps at 60 req/min; Tavily free credits drop after the first 1000 calls).
- Get the key — link to the exact dashboard URL and the click path. For OAuth providers (Webull, IBKR) it walks the consent flow.
- Paste & encrypt — paste the key into the in-chat form. NVTrader Fernet-encrypts at rest immediately; you cannot read it back, only the masked prefix/suffix.
- Smoke test — the wizard fires
test_provider_connection. For brokers that's a no-op call (e.g.get_account()); for data providers it pulls one bar/snapshot; for LLMs it sends a one-token "ping". - Activate — if the smoke test passes you can pick the provider as active right then (e.g. Active broker → Alpaca).
Adding a provider yourself
Drop a new markdown file into skills/setup/<category>/<id>.md using the existing playbooks as a template. The wizard picks it up automatically because it discovers via filesystem scan.
If the provider needs a custom adapter (rather than the generic OpenAI-compatible / REST shape), wire it under src/traderspace/broker/<id>.py or src/traderspace/data/<id>.py and import it from the relevant __init__.py. The BrokerAdapter and DataAdapter ABCs spell out the wire shape — keep new adapters drop-in compatible and the rest of the platform inherits broker switching, audit trails, and OTel spans for free.
Per-provider playbooks live in skills/setup/. They double as the wizard's content and as docs you can hand a teammate.
Reading the wizard output
The wizard's final message includes a JSON block:
{
"provider": "alpaca",
"category": "broker",
"linked": true,
"test": {
"endpoint": "https://paper-api.alpaca.markets",
"ok": true,
"elapsed_ms": 612,
"account_status": "ACTIVE",
"buying_power": 200000.00,
"cash": 100000.00
}
}
If linked: true but test.ok: false, the key was stored but the smoke call failed. Common causes: paper vs live mismatch (Alpaca), expired sandbox token (Webull), or wrong region (Polygon).
REST surface
| Verb | Path | Purpose |
|---|---|---|
| GET | /api/setup/providers | List supported providers + current link status. |
| GET | /api/setup/guide/{category}/{provider} | Return the markdown playbook the wizard reads. |
| POST | /api/setup/link | Store an API key (encrypted at rest). |
| POST | /api/setup/test | Run a smoke call against a linked provider. |
| POST | /api/setup/activate | Set the active broker or data source. |