This repo now contains both parts of the system in one place:
- The daily trading bot at the repo root
- The train-once quant model platform under
quant_platform/
- Root: live trading bot, daily orchestration, SQLite state, email/reporting
quant_platform/: corpus building, one-time GPU training, frozen LoRA adapter workflow, backtesting/research platform
trading_bot/
├── main.py # Daily core bot + AI bot orchestration
├── llm_trader.py # AI trading branch using the trained model
├── trained_model_client.py # Remote HTTP client for trained-model inference
├── trained_model_service_runtime.py
├── lightning_trained_model_app.py
├── deploy_lightning_inference.py
├── backtesting/ # Existing research stack in the bot repo
└── quant_platform/ # Merged train-once quant platform repo
- Core bot remains unchanged in principle: price ingestion, feature generation, OLS ranking, meta-learner, portfolio logic
- AI trading bot is separate and now prefers the trained quant model over HTTP when Lightning full-runtime is available
- If the full runtime is unavailable or unaffordable, the AI path falls back to a deterministic local distilled manager that reuses the AI memory journal
TRAINED_MODEL_INFERENCE_URL: deployed inference URL for the AI trading botTRAINED_MODEL_API_KEY: optional auth for the trained-model endpointTWELVEDATA_API_KEYS,ALPHAVANTAGE_API_KEYS: optional price providers
MODAL_TOKEN_IDMODAL_TOKEN_SECRET
.github/workflows/daily_trading_bot.yml- Daily root bot workflow
- Core + AI orchestration
.github/workflows/ai_trading_smoke.yml- AI-only smoke test against the trained-model path
- Does not run the core strategy
.github/workflows/deploy_lightning_inference.yml- Deploys the trained-model inference service to Lightning AI
- Leaves the core bot untouched
Manual:
python run_ai_trading_smoke.pyGitHub Actions:
- Actions -> AI Trading Smoke
- This tests only the AI trading branch and the trained-model endpoint
The full train-once quant platform has been merged into:
That subtree contains:
- corpus builders
- training scripts
- backtest engine
- inference/API scaffolding
- configs, docs, and tests from the original train-once repo
Start there if you want to inspect the model/training system rather than the daily bot.
pip install -r requirements.txt
python main.py daily_jobFor AI-only testing:
python run_ai_trading_smoke.py- The AI bot is not remote-only anymore:
- preferred path: Lightning-hosted trained-model inference
- fallback path: local distilled manager with shared AI memory
- The current preferred deployment target is Lightning AI CPU when project balance allows it.
- The Lightning inference app can either mount a ready adapter directory or download a
tar.gz/.ziparchive viaTRAINED_MODEL_ADAPTER_ARCHIVE_URL. - The core bot and AI bot remain logically separate even though they now live in one combined repo.
- The funded Lightning deployment account for this repo is
Rohan San - Username:
rohansanthoshkumar1 - Email:
rohan.santhoshkumar1@gmail.com - The repo should use the GitHub secrets
LIGHTNING_USERNAME,LIGHTNING_API_KEY, andLIGHTNING_USER_IDfor that account - Do not switch deployment to the separate
rohansanthoshkumaraccount unless explicitly told to do so