ai-hedge-fund README

The project's README from github.com/virattt/ai-hedge-fund. As one markdown file: README.md.

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.

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

How to Install

pipx install aihf

(or uv tool install aihf, or pip install aihf 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:

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.

ai-hedge-fund (virattt/ai-hedge-fund)

Searching Database…

Что это такое?Прототип хедж-фонда на основе ИИ, который использует ИИ (так называемые «альфа-модели» на основе LLM) для принятия симулированных торговых решений. Проект явно предназначен для обучения и исследований, а не для реальной торговли или инвестиций.
Это торговый бот или терминальное приложение, которое я запускаю сам?Это инструмент командной строки на Python, который вы устанавливаете и запускаете локально. Без аргументов он открывает интерактивное терминальное приложение для создания и бэктестирования фонда.
Как установить и запустить?Установите командой 'uv tool install aihf' или 'pip install aihf' в своё окружение, затем запускайте из любого места; при запуске по умолчанию открывается интерактивное терминальное приложение.
Какие API-ключи мне нужны?Ключ Financial Datasets API для цен, фундаментальных данных и отчётов о прибылях, а также один ключ LLM от Anthropic, OpenAI, DeepSeek, Google, xAI или Kimi для работы альфа-моделей. Приложение запрашивает их при первом использовании и сохраняет в ~/.hedge-fund/.env.
Совершает ли это реальные сделки?Нет, система никогда не выставляет реальных заявок — она только симулирует решения и проводит их бэктестирование, а проект отказывается от любого использования для реальных инвестиций.
Что такое «мандат» в этом проекте?Мандат — это сохранённое описание фонда: его стратегии, сотрудники, настройки риска, капитал и периодичность ребалансировки. Он хранится в виде файла в ~/.hedge-fund/mandates/. Тикеры в нём не прописываются жёстко: вы передаёте --tickers при запуске, чтобы указать конкретные акции.
Что дальше с проектом?Команда переделывает его в постоянно работающий ИИ-хедж-фонд, в котором агенты-инвесторы становятся подключаемыми «альфа-моделями», которые можно тестировать на исторических данных, торговать на бумаге и, при желании, запускать в реальной торговле.
Можно ли запустить один цикл работы фонда без интерактивного интерфейса?Да, в неинтерактивном режиме можно запустить один цикл фонда из файла мандата: полная запись цикла выводится в stdout в формате JSON, а краткая сводка для человека — в stderr.
Creator
virattt
Size
4.1 MB
Stars
64K
Age
1y
Commits · 90 Days