# ML4T Configuration Template # Copy this to .env to get started: # cp .env.example .env # The defaults work as-is for the early chapters — you do NOT need to edit # anything to run your first notebooks. Come back and fill in a line below only # when a chapter asks for it. Two of them are free and need no account: # EDGAR_IDENTITY (your own name and email, for the SEC) and UID/GID (only if # `id -u` or `id -g` prints something other than 1000). The rest are API keys. # ============================================================================ # Path Configuration # ============================================================================ # Repository path (auto-detected, rarely needs to be set) # ML4T_PATH=/path/to/third-edition # Data directory path — LEAVE THIS COMMENTED OUT unless you keep your data on a # separate drive. The default is the repo's own data folder, and it is the same # folder whichever directory you start from, so you do not need to set or edit # this to get started. Only uncomment and set a path to store data outside the # repository; a relative path is taken relative to the repository root: # ML4T_DATA_PATH=/path/to/data # ============================================================================ # Docker Configuration (Only needed when using Docker) # ============================================================================ # User mapping, so files the container writes belong to you rather than to root. # # Run `id -u` and `id -g`. They are independent, so check both. If either prints # something other than 1000, replace that default with the number it printed. On most # single-user Linux and WSL2 installs both are 1000 and there is nothing to change. # # Put the NUMBER, never the command. Docker Compose reads this file without a shell, so # a literal `UID=$(id -u)` is passed through as text and the container refuses to start: # Error response from daemon: unable to find user $(id -u): no matching entries in passwd file UID=1000 GID=1000 # ============================================================================ # Test / CI # ============================================================================ # Output redirection (used by the pytest harness - not needed for manual runs). # When set, notebook outputs go here instead of chapter/output/. The harness # also reduces epochs/folds/rows by injecting papermill `parameters`-tagged # cells at execution time; there is no global fast-mode flag for manual runs. # ML4T_OUTPUT_DIR=/tmp/ml4t-test-output # ============================================================================ # API Keys (Optional - only needed for downloading data) # ============================================================================ # SEC EDGAR - free, no account, no sign-up: put your own name and email on the # line below. The SEC mandates a real User-Agent on every EDGAR request and # blocks placeholder addresses, so anything that calls EDGAR live refuses to run # while this is empty: Ch04 NB02 (SEC filing explorer) and NB14 (text # extraction), Ch22 NB01 (SEC filing pipeline), and the two download scripts # data/equities/positioning/form4_download.py and # data/equities/fundamentals/filings_download.py. Every other SEC-derived # notebook reads a committed snapshot and needs nothing here. # Format: "Jane Doe jane@example.org" EDGAR_IDENTITY= # NASDAQ Data Link (formerly Quandl) - Wiki US equity prices, used by # data/equities/market/us_equities/download.py. The variable keeps its legacy # name; NASDAQ_DATA_LINK_API_KEY is read as an alias. # Get key: https://data.nasdaq.com/sign-up QUANDL_API_KEY= # FRED - Federal Reserve Economic Data (free API key) # Get key: https://fred.stlouisfed.org/docs/api/api_key.html FRED_API_KEY= # DataBento - Futures and market data (paid) # Get key: https://databento.com DATABENTO_API_KEY= # Oanda - Forex data (free tier available) # Get key: https://www.oanda.com/ OANDA_API_KEY= # Alpaca - Equity and crypto trading (free tier available) # Get key: https://alpaca.markets/ ALPACA_API_KEY= ALPACA_SECRET_KEY= # Polygon - Multi-asset market data (free tier available) # Get key: https://polygon.io/ POLYGON_API_KEY= # LLM providers for Ch. 24 Autonomous Agent demo (any one is enough; the # client auto-selects Anthropic -> OpenAI -> Google -> OpenRouter -> local # Ollama, then falls back to a deterministic mock if none are set). ANTHROPIC_API_KEY= OPENAI_API_KEY= GOOGLE_API_KEY= # OpenRouter: one key, any model. Optionally pin OPENROUTER_MODEL. OPENROUTER_API_KEY= # OPENROUTER_MODEL=anthropic/claude-sonnet-4 # Tavily - Agentic web search for Ch. 24 Autonomous Agent demo TAVILY_API_KEY= # TabPFN - Ch. 12 (12_gradient_boosting/03_dl_vs_gbm). The tabpfn package # requires a one-time license acceptance to download model weights for local # inference. Register at https://ux.priorlabs.ai, accept the license, and copy # your API key from https://ux.priorlabs.ai/account. The other models in the # notebook (LightGBM, MLP, TabM) run without it. TABPFN_TOKEN= # Ch. 24 research operator (nb11) — companion skill library (github.com/ml4t/skills). # Default: cloned next to the code repo (../skills). Set this to override, or # when running in Docker (where ../skills is not present). # RESEARCH_OPERATOR_SKILLS_ROOT=/path/to/skills