Lumiwealth/lumibot

Python trading framework with AI agents that actually place the trade. Backtest, paper and live trade on 12 brokers: stocks, options, futures, forex, crypto and prediction markets.

LumiBot – an open‑source Python framework for AI‑augmented trading

LumiBot (the lumibot package) lets you write a single Python Strategy class and run it as a pure rule‑based backtest, as a paper‑trading bot, or as a live‑trading bot. What makes it special is a built‑in runtime for LLM agents that can reason about market data, debate, and ultimately place orders through real broker APIs.

What you get out of the box

Feature What it means
Unified strategy lifecycle The same Strategy subclass works for backtesting, paper, and live trading – you only change the runner (Strategy.backtest(...) vs. Trader.run_all() or strategy.run_live()).
AI‑agent support LumiBot ships a lightweight agent framework (research, bull, bear, trader, etc.) that can call OpenAI models, query market tools, and write to a persistent DuckDB memory store.
Broker integrations Twelve brokers are supported, including Alpaca, Interactive Brokers, Tradier, Schwab, Tradovate, ProjectX, Bitunix, Polymarket and selected CCXT exchanges.
Asset coverage Stocks, options, futures, forex, crypto and even prediction‑market contracts (Polymarket).
Backtesting with real data Historical price data is fetched from Yahoo (free) or other sources; the backtest records every AI decision, order, and artefact so you can audit the model’s behaviour.
Safety gate Even when an LLM suggests a trade, a deterministic Python guard can approve/deny it before any broker call is made.
CLI helpers lumibot demo, lumibot init, lumibot backtest, lumibot run – all generate plain Python files, so nothing is hidden behind the command line.
Documentation & community Full docs site, example gallery, Discord and Reddit communities, and a hosted “BotSpot” platform for deploying strategies.

Typical workflow

  1. Install – pip install lumibot (or install a specific git tag).
  2. Create a starter – lumibot init my-bot --template ai writes a ready‑to‑edit Strategy subclass that uses the AI runtime.
  3. Backtest – lumibot backtest my-bot --days 90 runs the strategy on historical Yahoo data, logs every LLM prompt/response, and produces a tear‑sheet.
  4. Paper trade – Set ALPACA_API_KEY/SECRET (or another broker’s credentials) and run lumibot run my-bot --paper.
  5. Go live – Swap the paper credentials for a live account; the same code runs unchanged.

Example snippet (from the README)

from datetime import datetime
from lumibot.backtesting import YahooDataBacktesting
from lumibot.example_strategies.ai_researcher_trader import ResearcherTraderStrategy

ResearcherTraderStrategy.backtest(
    YahooDataBacktesting,
    datetime(2026, 4, 6),
    datetime(2026, 4, 11),
    budget=100_000,
    benchmark_asset="SPY",
    parameters={"symbol": "SPY", "max_position_pct": 10},
)

The snippet runs a five‑day backtest of an AI‑driven “research‑then‑trade” workflow on SPY, using the default openai/gpt-6-luna model.

Who might use LumiBot?

  • Quant developers who want to experiment with LLM‑driven ideas without abandoning their existing Python backtesting pipelines.
  • Research teams building multi‑agent “investment committee” simulations (researcher → bull ↔ bear → trader).
  • Individual traders looking for a low‑friction way to test AI‑generated signals before committing real capital.
  • Educators who need a concrete, open‑source example of how to combine deterministic trading logic with generative AI.

License & maturity

LumiBot is released under GPL‑3.0, has CI status badges, test coverage reporting, and is published on PyPI (over 1 k weekly downloads). The repository includes migration guides from Backtrader, extensive comparison tables, and a growing set of example strategies.


All details above are taken directly from the project's README; no external speculation is added.

Related

  • Project
  • Project
  • Project
  • Project