An AI Hedge Fund Team
This is a proof of concept for an AI-powered hedge fund. The goal of this project is to explore the use of AI to make trading decisions. This project is for educational purposes only and is not intended for real trading or investment.
🚧 The project is evolving. We're rebuilding it into a persistent, always-on AI hedge fund — a fund as a first-class entity you can backtest, paper-trade, and (opt-in) run live, with the investor agents reimagined as pluggable, backtestable "alpha models." Read the Vision → and the Roadmap →.
Note: the system does not actually make any trades.
This project is for educational and research purposes only.
By using this software, you agree to use it solely for learning purposes.
pipx install aihf(or uv tool install aihf, or pip install aihf into an environment of your choice)
Then run it from anywhere:
aihfThe app asks for keys the first time it needs them and saves them to ~/.hedge-fund/.env — nothing to configure up front. It needs:
Keys exported in your shell always win over the saved file.
aihfWith no arguments, this launches the interactive terminal app. Build a fund — pick stocks, strategies, rebalance cadence — or backtest a saved fund and watch its equity curve draw against its benchmark. Funds you build are saved as mandate files in ~/.hedge-fund/mandates/.
Run one fund cycle from a mandate file. The full cycle record prints to stdout as JSON; a short human summary goes to stderr:
aihf ~/.hedge-fund/mandates/example.yaml --tickers AAPL,MSFTBacktest the mandate over history at its rebalance cadence:
aihf ~/.hedge-fund/mandates/example.yaml --tickers AAPL,MSFT --backtestA mandate is the desk — strategies, staff, risk, capital, cadence — and never names tickers; --tickers says what to point it at for this run.
git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
poetry install
poetry run aihf
poetry run pytest hedge_fundImportant: Please keep your pull requests small and focused. This will make it easier to review and merge.
If you have a feature request, please open an issue and make sure it is tagged with enhancement.
This project is licensed under the MIT License - see the LICENSE file for details.
question
Model memory can still leak into backtests through the ticker and filing dates in the snapshot
Reject NaN prices before SimBroker mutates the book
Bug: App ignores OPENAI_BASE_URL overrides and fails to route to custom endpoints (Groq)
Financial Data sets API not working
The Unlimited Access Idea
Proposal: add point-in-time momentum alpha model to v2
'Inconsistent fundamental metrics (D/E, ROE) across agents in the same run; Valuation Analyst results dropped from final output; empty news sentiment data'.
能否增加支持qwen的大模型?
有没有哥们试过?分析一个耗费多少 token?