[ getting started · 1 of 3 ]

Install & first run

Stand up NVTrader on a fresh NVIDIA DGX Spark (or any CUDA 12.x host) in about ten minutes. The install does conda env + repo skeleton + dependencies + cuFOLIO clone + a GPU smoke test before the FastAPI server comes up on port 8015.

Requirements

WhatMinimumRecommendedWhy it matters
GPUany CUDA 12.x (compute 8.0+)NVIDIA DGX Spark · GB10cuFOLIO scenario gen + cuOpt PDLP + NemoRL all hit the GPU. CPU fallback works but is 30–100× slower.
OSLinux (Ubuntu 22.04+)Ubuntu 22.04 LTSDocker base image + cuDNN are aligned to 22.04.
RAM16 GB32 GBBacktest sweeps + NemoRL training hold the full universe in memory.
Disk20 GB free100 GB freeAudit log + sim ledger + RL policies grow over time.
Networkegress to integrate.api.nvidia.comadd data.alpaca.markets, Tavily, FinnhubNVIDIA Build proxies Nemotron + Kimi K2.6. Broker + data providers need their own endpoints.
Python3.113.11 (conda)cuOpt, alpaca-py, and webull-openapi all pin against 3.11.

Docker compose (recommended)

The one-line install on a fresh GB10 host:

git clone https://github.com/BenikaH/traderspace.git && cd traderspace
bash scripts/setup.sh --mode docker

This invokes the multi-stage Dockerfile and:

  1. detects GPU vs CPU automatically (passes --gpus all if present)
  2. scaffolds .env with chmod 600 and stubbed credentials
  3. builds on nvidia/cuda:12.3.0-runtime-ubuntu22.04 (~10 min first time, then cached)
  4. brings the app up on http://localhost:8015
  5. polls /api/health until it returns 200 before exiting

Compose profiles

FlagAdds
--profile postgresPostgres for production-grade auth (drop-in replacement for the default SQLite at data/auth.db).
--profile phoenixArize Phoenix UI at :6006 + OTel Collector. Browses the NAT spans graphically.
--profile allEnables both above.

Conda (dev mode)

Use this if you intend to modify the codebase. Same end state, but you keep direct access to uvicorn --reload and the test suite.

conda create -n traderspace python=3.11 -y
conda activate traderspace
pip install -e ".[dev]"
git clone https://github.com/NVIDIA/cufolio.git extern/cufolio
pip install -e extern/cufolio
python scripts/cufolio_smoke_test.py     # verify cuOpt PDLP solves cleanly
uvicorn traderspace.api.chat_server:app --host 0.0.0.0 --port 8015 --reload
tip

If cufolio_smoke_test.py falls back to CPU, your CUDA driver is older than the one PyTorch was built against. Either upgrade the driver or set CUFOLIO_FORCE_CPU=1 while you sort it.

Environment variables

NVTrader reads its config from a .env file at the repo root and overrides via process env. The most important ones:

VarRequired?DefaultEffect
NVIDIA_API_KEYyesn/aNVIDIA Build auth. Walks Nemotron Super + Nano Omni + Kimi K2.6.
CHAT_MODELSnomoonshotai/kimi-k2.6,nvidia/nemotron-3-super-120b-a12bOrdered fallback chain for the PM chat.
BROKERnosimOne of sim · alpaca · webull · ibkr · tradier.
ALPACA_KEY_ID / ALPACA_SECRETif broker=alpacaStored encrypted at rest via Fernet once linked through the UI.
ALPACA_PAPERnotrueSet to false to use the live Alpaca endpoint. Do not do this until you have verified the account.
AUTH_DB_URLnosqlite:///data/auth.dbSet to a Postgres URL to migrate auth transparently.
JWT_SECRETgeneratedrandom per-hostPersisted to data/.auth_secret, chmod 600.
TAILSCALEnoIf set, the app binds to 0.0.0.0:8015 so the tailnet can reach it.
danger

.env is gitignored. Never commit it. data/.auth_secret is also chmod 600 and gitignored — losing it makes all encrypted API keys unreadable.

GPU smoke test

Confirm cuFOLIO + cuOpt see the GPU before you start the server:

python scripts/cufolio_smoke_test.py

Expected output:

device     = cuda:0 (NVIDIA DGX Spark · compute 12.1)
scenarios  = 5000 (KDE on GPU)
solver     = cuOpt PDLP
solve time = 251 ms  ← LP solve
weights    = [0.21 0.18 0.14 ...]  ← sums to 1.0
✓ smoke OK

If you see device = cpu instead, NemoRL will still train but cuFOLIO solves will run 30–100× slower. Verify with nvidia-smi; check torch.cuda.is_available().

First login

Open http://localhost:8015. The landing page auto-redirects to /login.html.

  1. The first user to register is automatically promoted to admin.
  2. Pick any email + password (bcrypt hashed; JWT session lasts 12h).
  3. You land on the Portfolio dashboard with an empty SimBroker portfolio ($100k starting cash).
  4. Go to Account → API keys to link real providers, or jump to the Setup Wizard.

That's the whole bootstrap. From here, see Setup wizard or your first backtest.

Troubleshooting

SymptomCauseFix
/api/health never returns 200Port 8015 in useEither lsof -i :8015 and kill, or set PORT=8016 in .env.
cuFOLIO falls back to CPUCUDA driver mismatchnvidia-smi shows driver version. Match to nvcc --version or use the Docker path.
NemoRL kicks but exits at 0 stepsSB3 missingpip install stable-baselines3[extra] gymnasium
Chat says "no models configured"NVIDIA_API_KEY missingGet one at build.nvidia.com; paste into .env; restart.
NVTrader v0.1.18 · docs ·⚠ Not financial advice ·Docs home ·App