← all repositories
shiyu-coder/Kronos

LLMs for candlesticks: Kronos treats OHLCV like a language

An autoregressive foundation model that quantizes market data into discrete tokens and predicts the next "words" in a financial time series.

28.9k stars Python Language ModelsDomain Apps
Kronos
Velocity · 7d
+85
★ / day
Trend
steady
star history

What it does Kronos is a decoder-only Transformer pre-trained on K-line (candlestick) sequences from 45+ global exchanges. It takes multi-dimensional OHLCV data, tokenizes it through a custom hierarchical quantizer, then predicts future price action autoregressively — essentially treating market structure as a language model problem. The repo ships with four model sizes (4M to 499M params), three of them open on Hugging Face, plus a KronosPredictor wrapper that handles normalization, truncation, and batch inference.

The interesting bit The two-stage pipeline is the real architecture bet: a specialized tokenizer first compresses continuous, noisy financial data into discrete hierarchical tokens, and only then does the standard autoregressive Transformer do its next-token prediction dance. It’s the same LLM playbook applied to a domain where “tokens” are price bars, not words.

Key highlights

  • Pre-trained on 45+ global exchanges; claims to be the first open-source foundation model for candlesticks
  • Live demo forecasts BTC/USDT 24 hours ahead via browser
  • predict_batch() enables parallel multi-asset inference with automatic per-series normalization
  • Fine-tuning pipeline included, with A-share market example using Microsoft Qlib
  • Paper accepted at AAAI 2026; arXiv preprint available

Caveats

  • Kronos-large (499M params) is not open-sourced — only mini/small/base are downloadable
  • Context windows are tight: 512 for small/base, 2048 for mini; longer lookbacks get silently truncated
  • The fine-tuning backtest is explicitly labeled a “simplified example, not a production-ready quantitative trading system”

Verdict Worth a look if you’re building quant research infrastructure or experimenting with generative approaches to time series. Skip it if you need audited trading performance or long-horizon context windows beyond a few hundred bars.

heatdrop uses Google Analytics to see which pages get read — nothing else. Your call. How we handle data.