AI Hedge Fund
LLM investor personas score a ticker, deterministic code sizes the book, nothing trades.
by Virat Singh
Last updated
What it is
aihf is a terminal app and importable Python package that assembles a fake fund out of alpha
models and replays it over history. Five of those models are LLM investor personas — Buffett,
Munger, Graham, Lynch, Druckenmiller — and one, post-earnings-announcement drift, is arithmetic.
All return the same object: a conviction in [-1, +1] plus a written thesis. Deterministic code,
not the language model, blends those views into target weights, clamps them against per-position
and gross-exposure limits, and sends orders to a simulated broker.
A persona is a system prompt and nothing more — buffett.py is 54 lines, most of it prose. The
engineering is elsewhere: the fundamentals snapshot an agent sees is filtered on filing date
rather than report period, and every prompt and response is cached by content hash, so an
unchanged snapshot never pays for a second call.
Version 2 deleted v1's React frontend and LangGraph pipeline outright. Last release v2.2.0 on
7 August 2026, last commit to main on 3 September 2026, MIT, not archived, 63.4k stars.
Pricing
Free software, paid inputs. Data comes from Financial Datasets and only from there; that API has no free tier as of today, starting at $20 one-time for 1,000 requests. Then one LLM key. Because the prompt cache keys on the filing snapshot, a weekly backtest re-reasons only when a new filing lands — the snapshot is trailing-twelve-month rows, so roughly four calls per persona-ticker-year rather than one per rebalance date.
Data & coverage
US equity fundamentals and daily bars, filed-date-aware, cached to ~/.hedge-fund/cache. No
intraday, no options, no futures, no crypto. The mandate's benchmark, SPY by default, sets the
trading-day grid.
Integrations
Installed as pipx install aihf, and the name matters. The obvious guess, pip install ai-hedge-fund, is a different author's package — a 0.1.1 set of Claude Code slash commands
uploaded in April 2026. hedge-fund is this author's own, abandoned at 2.1.0 three days after he
published it. Only aihf — 2.2.0, uploaded 7 August 2026 — is this project.
It wants two keys, asked for on first use and written to ~/.hedge-fund/.env, with shell
variables overriding the file: one for Financial Datasets, one for any of the nine models across
six providers — Anthropic, OpenAI, Google, DeepSeek, xAI, Kimi — listed in
hedge_fund/llm/api_models.json.
The data source and the broker are both Python Protocols, so a replacement needs no
inheritance; the data protocol's docstring sketches a yfinance client as its example. Neither has
a second implementation in the tree. There is no MCP server, no Dockerfile and no web UI. A
non-interactive run prints the whole cycle record as JSON on stdout and a human summary on
stderr, and a fund is a YAML mandate under ~/.hedge-fund/mandates/.
Limitations
- Nothing executes.
SimBrokeris the only broker; paper and live are roadmap items. - The backtest models no trading costs: full fills at the reference close, no commission, slippage or spread, and no margin — cash is allowed to go negative and stay visible.
- Each persona returns bullish, bearish or neutral with a 0–100 confidence on a named security. That is a rating on a stock, whatever the disclaimer says, and the project's own answer is that it is for education and research only.
- Personas see fundamentals alone — no prices, no news, no transcripts.
- The always-on fund the vision describes is not built: no scheduler, and NAV resets to the mandate's capital each run because the ledger's read half is unfinished.
- 53 open issues and 109 open pull requests on 14 September 2026, a good number of both written against v1 code that no longer exists.
Alternatives
TradingAgents and FinRobot run multi-agent debates over more data types; Vibe-Trading wires an agent to real brokers. For a backtester with no LLM in it at all, see the backtesting frameworks category, and for the rest of this one, MCP servers and AI agents.
Specs
- Interfaces
- Python, Python
- Export
- JSON
- Asset classes
- Stocks
- Markets
- US
- Platforms
- CLI, Library
- AI features
- Recommendations
- Capabilities
- Backtesting
- Pricing verified
- Capabilities verified
- Coverage verified
Also worth comparing
- FinGPT — Financial LLM adapters, instruction datasets and training notebooks, all MIT.
- MaverickMCP — Thirty-seven stock-analysis tools for any MCP client, on Yahoo data and no key.
- SEC EDGAR MCP — SEC filings and XBRL financials as MCP tools, under AGPL or a paid commercial licence.
- TradingAgents — Analyst, bull, bear, risk and portfolio-manager agents argue over one ticker.
- Vibe-Trading — A local finance research agent with 74 MCP tools, nine backtest engines and 14 brokers.
- Equibles — Scrapes SEC, FINRA, FRED and CFTC data into your own Postgres and serves it over MCP.
FAQ
What does it actually cost to run?
The code is free. The data is not. It reads Financial Datasets and nothing else, and that API has no free tier as of September 2026 — the cheapest entry is $20 one-time for 1,000 requests, then $200 a month for 100,000. On top of that you supply one LLM key (Anthropic, OpenAI, DeepSeek, Google, xAI or Kimi). LLM spend is one call per persona per ticker per distinct fundamentals snapshot, and every prompt and response is cached to disk, so re-runs cost nothing.
Does it place trades?
No. The only broker implementation in the repository is SimBroker, an in-memory book used by the backtester; paper and live brokers are listed as planned. The README states plainly that the system does not make any trades, and the project describes itself as educational, not investment advice.
Are the investor personas more than prompts?
No, and the project says so — a persona is a name plus a system prompt, with all the machinery in one shared LLMAgent class. Five are ported to v2 — Buffett, Munger, Graham, Lynch and Druckenmiller. Cathie Wood, Michael Burry, Bill Ackman and Aswath Damodaran are on the roadmap as not yet done.
Is the backtest realistic?
Only in one direction. Point-in-time discipline is genuine — the data layer filters on filing date, so an agent cannot read a number before it was published. Trading realism is absent — SimBroker fills every order in full at the reference close, with no commission, slippage or spread, and margin is not modelled at all.