Skip to main content

AI Hedge Fund

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.

Twitter Follow

Disclaimer

This project is for educational and research purposes only.

  • Not intended for real trading or investment
  • No investment advice or guarantees provided
  • Creator assumes no liability for financial losses
  • Consult a financial advisor for investment decisions
  • Past performance does not indicate future results

By using this software, you agree to use it solely for learning purposes.

How to Install

pipx install hedge-fund

(or uv tool install hedge-fund, or pip install hedge-fund into an environment of your choice)

Then run it from anywhere:

aihf

API keys

The app asks for keys the first time it needs them and saves them to ~/.hedge-fund/.env — nothing to configure up front. It needs:

  • A Financial Datasets API key, for prices, fundamentals, and earnings.
  • One LLM API key for the LLM-powered alpha models. Supported providers: Anthropic, OpenAI, DeepSeek, Google, xAI, Kimi.

Keys exported in your shell always win over the saved file.

How to Run

Interactive app

aihf

With 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/.

Non-interactive

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,MSFT

Backtest the mandate over history at its rebalance cadence:

aihf ~/.hedge-fund/mandates/example.yaml --tickers AAPL,MSFT --backtest

A mandate is the desk — strategies, staff, risk, capital, cadence — and never names tickers; --tickers says what to point it at for this run.

Development

git clone https://github.com/virattt/ai-hedge-fund.git
cd ai-hedge-fund
poetry install
poetry run aihf
poetry run pytest hedge_fund

How to Contribute

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

Important: Please keep your pull requests small and focused. This will make it easier to review and merge.

Feature Requests

If you have a feature request, please open an issue and make sure it is tagged with enhancement.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hedge_fund-2.1.0.tar.gz (96.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hedge_fund-2.1.0-py3-none-any.whl (120.4 kB view details)

Uploaded Python 3

File details

Details for the file hedge_fund-2.1.0.tar.gz.

File metadata

  • Download URL: hedge_fund-2.1.0.tar.gz
  • Upload date:
  • Size: 96.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.8 Darwin/24.1.0

File hashes

Hashes for hedge_fund-2.1.0.tar.gz
Algorithm Hash digest
SHA256 416514799834ad71fb6c4be1bb42fa1c19d8fd74757a2706eeaadba835dd4724
MD5 b0041a35d02d82bf5a437d9e1d6bc743
BLAKE2b-256 91aee7a2583a771de6647f58ef84dd6a44103daab3cf8339c604a06cc88bc514

See more details on using hashes here.

File details

Details for the file hedge_fund-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: hedge_fund-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 120.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.5 CPython/3.11.8 Darwin/24.1.0

File hashes

Hashes for hedge_fund-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5629dbdb5e1492fe5ceffde07b7fa058d9a687773cd26e188b5b022e8ccbe184
MD5 78f31458e329401c46d72b101b757b3f
BLAKE2b-256 c51243625f32a150df5be0e2af7f0bc831f7d5e60bc94d17f0afe0fb66518013

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page