open source · algorithmic trading · portfolio optimization · foundation models · llm agents
Four GitHub repos, roughly 94,000 stars between them as of August 2026, and together they cover every desk of a quantitative hedge fund. A candlestick foundation model out of Tsinghua. A portfolio optimizer that speaks scikit-learn. An execution engine that crypto exchanges officially partner with. An LLM agent platform from the lab behind LightRAG.
Here is the part that surprised me: nobody has connected them. I went looking for an article, a video, a glue repo, anything wiring even two of the four together. Nothing.
So I read all four codebases and their documentation to answer one question. If you plugged them into each other, what would each one do, and where exactly are the seams?
Two ground rules before the fun part. Everything below runs in paper mode, on simulated fills, because that is what these tools default to and it is the only sane way to learn with them. And what a laptop can run is a hedge fund's technology, not a hedge fund. A fund is a legal structure with investors, auditors and regulators. That difference gets its own section, with numbers.

Strip away the mystique and a quant fund is four jobs in a row.
Research produces forecasts. Portfolio construction turns forecasts into positions sized against risk. Execution turns target positions into orders without leaking money along the way. Oversight watches all of it: journals, reports, risk reviews, the uncomfortable questions.
At a real fund those are desks with salaries. On GitHub, each one now has an open-source counterpart that is genuinely good at its slice. The rest of this article walks the line station by station, then wires it end to end.
Kronos is the first open-source foundation model for financial candlesticks: a decoder-only transformer that treats OHLCV bars the way GPT treats words. It comes out of Tsinghua University, the paper was accepted at AAAI 2026, and it was pre-trained on over 12 billion K-lines from 45 exchanges. Three sizes are open, from 4.1M to 102.3M parameters. The small one pulls about 1.09 million downloads a month on Hugging Face and runs on a laptop CPU. One catch: there is no pip package, you clone the repo.
Now the honest part. An independent test on 5-minute bitcoin scored Kronos at a Brier of 0.189 against 0.188 for a Brownian-motion baseline, statistically indistinguishable from the coin-flip model. And the README itself says raw outputs need portfolio construction before anyone should act on them.
That is not a reason to drop it from the stack. It is the job description: Kronos produces views with uncertainty attached, not commands. Hold that thought, because the whole architecture turns on it.
skfolio is portfolio optimization on the scikit-learn contract: fit on a returns DataFrame, predict a portfolio object, cross-validate like any other estimator. BSD-3 licensed, v0.20.1 shipped April 2026, commercially backed. The catalog runs from mean-CVaR through hierarchical risk parity, with covariance denoising, walk-forward validation and combinatorially purged cross-validation built in.
The reason it belongs in this stack is one class. BlackLitterman accepts views as plain strings, absolute or relative, exactly the shape a forecasting model can emit.
I also respect what its README admits: mean-variance optimization is hypersensitive to expected returns, and naive equal weight often beats it out of sample. This library is written by people who assume your backtest is lying. Good. So do I.
NautilusTrader is an event-driven trading engine with a Rust core and a Python strategy API, and one central promise: the same strategy code runs in backtest, in sandbox, and live. Version 1.231.0 landed in August 2026 with 20 integrations marked stable, from Interactive Brokers to Binance, OKX and Coinbase. Several of those exchanges are official partners of the project, which is not a common thing for open source.
Honesty section: the docs themselves warn that the learning curve is steep, releases still carry a Beta label, and breaking changes arrive on a bi-weekly cadence. More interesting for us, it deliberately ships no "rebalance to target weights" helper. That missing piece is exactly where our glue code goes.
Vibe-Trading is the newest of the four: launched April 1, 2026 by the HKU Data Intelligence Lab (the LightRAG people) and at about 30,500 stars four months later. It wires LLM agents to deterministic finance tooling: 70+ tools exposed over MCP, a library of 462 alpha factors, 9 backtest engines, and 13 broker connectors that all default to paper trading. Live orders sit behind explicit user mandates, size caps and a kill switch.
In this stack it is the PM layer. Because it runs as an MCP server, an agent can pull backtest reports, run factor studies and keep the trade journal without touching the execution path.
Fair warnings: it is 0.1.x software moving fast, a reviewer estimated half its surface is tuned to Chinese A-share markets, and the team has publicly disavowed a token scam using its name. They have never launched a token. Anything claiming otherwise is a scam.
Here is the whole system as a single Monday afternoon.
At 16:00 a timer fires inside NautilusTrader. The strategy pulls the last 400 daily bars for each asset from its cache and hands them to the research desk.
Kronos samples. Not one prediction: 32 sampled futures per asset, each a full sequence of forecast candles. The mean path return becomes the view. The dispersion across paths becomes how much we trust it.
from model import Kronos, KronosTokenizer, KronosPredictor
tokenizer = KronosTokenizer.from_pretrained("NeoQuasar/Kronos-Tokenizer-base")
model = Kronos.from_pretrained("NeoQuasar/Kronos-small") # 24.7M params, CPU is fine
predictor = KronosPredictor(model, tokenizer, max_context=512)
# 32 sampled futures per asset (sample_count averages internally, so loop instead)
paths = [
predictor.predict(df=history, x_timestamp=hist_ts, y_timestamp=week_ts,
pred_len=5, T=1.0, top_p=0.9, sample_count=1)
for _ in range(32)
]
mu = np.mean([weekly_return(p) for p in paths]) # the view
sigma = np.std([weekly_return(p) for p in paths]) # how much to trust itThose forecasts cross the first seam as Black-Litterman views. skfolio blends them with the market equilibrium, then optimizes with the constraints a real desk would insist on: long only, turnover capped, transaction costs inside the objective rather than discovered afterwards.
from skfolio import RiskMeasure
from skfolio.optimization import MeanRisk, ObjectiveFunction
from skfolio.prior import BlackLitterman
views = [f"QQQ - SPY == {mu_qqq - mu_spy:.4f}"] # straight from the forecaster
model = MeanRisk(
risk_measure=RiskMeasure.CVAR,
objective_function=ObjectiveFunction.MAXIMIZE_RATIO,
prior_estimator=BlackLitterman(views=views),
min_weights=0.0, # long only
previous_weights=w_prev,
max_turnover=0.10, # do not churn
transaction_costs=0.001, # 10 bps each way, in the objective
)
model.fit(returns)
weights = model.weights_The weights cross the second seam back into NautilusTrader, which compares them to current positions and submits the difference as orders. In backtest they hit a simulated exchange. In sandbox mode they hit live market data with simulated fills. The strategy code does not change.
class StackStrategy(Strategy):
def on_start(self):
for bar_type in self.config.bar_types:
self.subscribe_bars(bar_type)
self.clock.set_timer("rebalance", interval=pd.Timedelta(days=7))
def on_event(self, event):
if isinstance(event, TimeEvent) and event.name == "rebalance":
weights = self.run_desks() # Kronos -> skfolio, the code above
equity = float(self.portfolio.account(self.venue).balance_total())
for iid, w in weights.items():
price = float(self.cache.bar(self.bar_type(iid)).close)
delta = w * equity / price - self.net_qty(iid)
if abs(delta) > self.config.min_trade:
self.submit_order(self.order_factory.market(
instrument_id=iid,
order_side=OrderSide.BUY if delta > 0 else OrderSide.SELL,
quantity=self.instrument(iid).make_qty(abs(delta)),
))This is a sketch, not a library. Every line of glue between these repos is code you write yourself, which is precisely why building it teaches you more than any single repo can.
Three practical notes from tracing the APIs. One Python 3.12 environment covers Kronos, skfolio and NautilusTrader together (Nautilus requires 3.12 to 3.14, the others 3.10+); Vibe-Trading lives in its own install and talks over MCP. Weekly or daily rebalancing is comfortable because Nautilus runs strategy callbacks on a single deterministic thread, so a few seconds of model inference just delays the clock. At tick frequency the same design would be a mistake, so nobody should try to make this stack fast before making it honest.
The most important wire in the whole diagram is the uncertainty, so I computed that mechanism instead of asserting it.
Black-Litterman updates equilibrium returns with a view through
where is the variance you assign to the view. Everything interesting lives in . Send it to zero and the optimizer takes the forecast literally. Send it to infinity and the posterior falls back to equilibrium, and the weights fall back to the benchmark.
I ran the sweep on two years of real ETF daily returns (SPY, QQQ, TLT, GLD, through August 2026) with one view: QQQ beats SPY by 3 points a year.

At high confidence the optimizer moves the QQQ weight up 57 points and shorts SPY against it. That violence is not a bug: SPY and QQQ correlate at 0.95 in this window, and a confident relative view between near-twins is a leveraged spread trade. At a view volatility of 10 percent, the same forecast moves QQQ by 2.4 points, and the portfolio sits essentially on its benchmark.
This is why a forecaster that is honestly uncertain, like Kronos sampling 32 futures, can live safely inside a portfolio system. The model's job is not to be right. It is to be calibrated about how wrong it might be, and the optimizer prices that humility automatically.
You may have noticed the LLM layer never touches an order in my wiring. That is deliberate, and there is data behind it.
In late 2025, Alpha Arena gave six frontier LLMs 10,000 USD of real money each to trade crypto perpetuals for 17 days. Four of six lost money. GPT-5 finished at minus 62.7 percent, Gemini 2.5 Pro at minus 56.7, Claude Sonnet 4.5 at minus 30.8.

There is also a quieter problem with LLM trading backtests: the pretraining corpus usually contains the backtest window, so "prediction" can be memory. Researchers have a name for the resulting performance, the profit mirage, and it evaporates on data the model has never seen.
Vibe-Trading's own architecture agrees with this reading. Its connectors default to paper, live trading hides behind explicit mandates, and its real strength is the deterministic tooling around the agent: point-in-time fundamentals, lookahead-gated factor tests, reproducible run manifests. Used that way, as the desk that reads everything, drafts research and keeps the journal, an LLM earns its seat. Handed the order book, it becomes the GPT-5 bar in the chart above.
Now the section the Instagram caption cannot hold.
A hedge fund is typically two legal entities: a Delaware limited partnership holding investor capital, and a management company acting as general partner. Money comes from accredited investors under a Reg D private placement. Below 150 million USD under management the adviser can file as exempt reporting; above it, full SEC registration.
None of that is free. Offering documents alone run 15,000 to 75,000 USD. An annual audit runs 20,000 to 100,000 USD. Ongoing legal and compliance, 10,000 to 50,000 USD a year. A single Bloomberg seat is about 32,000 USD a year, and institutional data licensing climbs from there.

And even with all of it paid, the hard part remains. Quantopian gave 300,000 people a free research platform, Point72's backing, and real allocations. Its own research found that user backtest performance had almost no predictive value out of sample, and it shut down in 2020. Alpha stayed rare after the tools became free, because the tools were never the moat.
So no, this stack does not make you a hedge fund. What it gives you is something I find more interesting: the same separation of concerns the desks actually use, runnable end to end on hardware you already own, in paper mode where mistakes cost nothing.
1. Learn the seams, not just the repos. Forecast to view, view to weight, weight to order. Those three data contracts are the architecture of every systematic fund, and gluing them yourself teaches more than any tutorial on a single tool.
2. Demand uncertainty from every model. A forecaster that only outputs a number is unusable in a portfolio system. Sample it, measure the dispersion, and let the optimizer decide how much to listen. The math above does it for free.
3. Put costs inside the optimization, not the postmortem. skfolio takes turnover caps and transaction costs as parameters. The difference between a paper edge and a real one usually dies exactly there.
4. Keep the LLM out of the order path. The real-money evidence is one chart up. Analyst, journalist, risk reviewer: yes. Trader: the data says no.
5. Paper mode is the product, not the compromise. Sandbox execution against live data is how these engines themselves expect you to run for months. The repos default to it for the same reason this article insists on it.
If you want to build the foundations this stack quietly assumes, the probability, the portfolio math, the Python, that is exactly what QuantFrame teaches: interactive math problems, browser-run coding problems, and projects that make you build the real thing. Your personalized roadmap is at quantframe.io.
Found this useful?
Likes decide what gets written next.Sign in to like
QuantFrame teaches you the math, code, and projects to break into quant. Plus a personalized roadmap built for your background and goals.