Kronos: The First Open-Source Foundation Model for Financial Candlesticks
Kronos is an MIT-licensed, decoder-only foundation model pre-trained on K-line (OHLCV) data from 45+ global exchanges, accepted at AAAI 2026, that turns candlestick forecasting into a language-modeling problem you can run, finetune, and backtest yourself.
- โญ 35481
- Python
- MIT
- Updated 2026-08-02
Vibe-Trading: HKU’s Open-Source Research Agent for Markets โข TimesFM 2.5: Google’s Time Series Foundation Model

What Is Kronos? #
Kronos describes itself as the first open-source foundation model built specifically for financial candlesticks (K-lines), pre-trained on data from 45+ global exchanges. Instead of bolting a generic time-series model onto finance data, Kronos treats OHLCV sequences as a language: a specialized tokenizer quantizes continuous, multi-dimensional candlestick data into hierarchical discrete tokens, and a decoder-only Transformer is pre-trained on those tokens the same way an LLM is pre-trained on text.
๐ GitHub: https://github.com/shiyu-coder/Kronos ๐ Paper: arXiv:2508.02739 โ accepted at AAAI 2026 ๐ค Models: huggingface.co/NeoQuasar
The project is MIT-licensed and has crossed 35,000+ GitHub stars and 5,900+ forks. Its most recent commit landed April 13, 2026 โ the codebase reads as a finished, paper-backed research release rather than a project mid rapid iteration, which matters if you’re deciding whether to build on it versus something still churning weekly.
Why “Language of Financial Markets”? The Two-Stage Framework #
Most time-series forecasting models predict raw numeric values directly. Kronos’s pitch is that financial K-line data is unusually high-noise and multi-dimensional (open/high/low/close/volume/amount all move together), so it borrows the LLM playbook instead:
- Tokenizer stage โ
KronosTokenizerquantizes continuous OHLCV sequences into hierarchical discrete tokens, compressing the signal into a vocabulary a Transformer can model the way it models words. - Autoregressive stage โ a decoder-only Transformer (
Kronos) is pre-trained on those tokens across markets and exchanges, learning a general-purpose representation of “what tends to follow what” in candlestick sequences.
Because both stages are pre-trained once and shipped as weights, you don’t train a model from scratch per asset โ you load a pre-trained checkpoint and either forecast directly or finetune it on your own market.
Model Zoo: Choosing a Kronos Size #
| Model | Tokenizer | Context Length | Params | Open Weights |
|---|---|---|---|---|
| Kronos-mini | Kronos-Tokenizer-2k | 2048 | 4.1M | โ NeoQuasar/Kronos-mini |
| Kronos-small | Kronos-Tokenizer-base | 512 | 24.7M | โ NeoQuasar/Kronos-small |
| Kronos-base | Kronos-Tokenizer-base | 512 | 102.3M | โ NeoQuasar/Kronos-base |
| Kronos-large | Kronos-Tokenizer-base | 512 | 499.2M | โ not released |
Kronos-mini’s 2048-token context is the outlier โ it uses a different tokenizer (Kronos-Tokenizer-2k) specifically to support a longer lookback window on constrained hardware, while small/base share the 512-context tokenizer and trade parameter count for capacity.
Installation & Quickstart #
pip install -r requirements.txt
Requires Python 3.10+. There’s no separate CLI โ everything is driven through the KronosPredictor Python class.
Load a pre-trained model and tokenizer #
from model import Kronos, KronosTokenizer, KronosPredictor
# Load from Hugging Face Hub
tokenizer = KronosTokenizer.from_pretrained("NeoQuasar/Kronos-Tokenizer-base")
model = Kronos.from_pretrained("NeoQuasar/Kronos-small")
Instantiate the predictor #
predictor = KronosPredictor(model, tokenizer, max_context=512)
Important: max_context for Kronos-small/base is capped at 512 โ the maximum sequence length the model can process. Longer input windows get truncated automatically rather than erroring out.
Making Forecasts: A Step-by-Step Walkthrough #
Kronos expects a pandas DataFrame with open, high, low, close (volume/amount optional), plus timestamp Series for the historical window and the future window you want predicted.
import pandas as pd
df = pd.read_csv("./data/XSHG_5min_600977.csv")
df['timestamps'] = pd.to_datetime(df['timestamps'])
lookback = 400
pred_len = 120
x_df = df.loc[:lookback-1, ['open', 'high', 'low', 'close', 'volume', 'amount']]
x_timestamp = df.loc[:lookback-1, 'timestamps']
y_timestamp = df.loc[lookback:lookback+pred_len-1, 'timestamps']
Then generate the forecast, with sampling controls for probabilistic output:
pred_df = predictor.predict(
df=x_df,
x_timestamp=x_timestamp,
y_timestamp=y_timestamp,
pred_len=pred_len,
T=1.0, # Temperature for sampling
top_p=0.9, # Nucleus sampling probability
sample_count=1 # Number of forecast paths to generate and average
)
print(pred_df.head())
predict() returns a DataFrame of forecasted open/high/low/close/volume/amount, indexed by the y_timestamp you provided. Bumping sample_count averages multiple stochastic forecast paths, which is the built-in way to get a steadier estimate than a single greedy pass.

examples/prediction_example.py โ from the Kronos repo
Batch Prediction for Multiple Assets #
For forecasting several instruments at once, predict_batch parallelizes across a list of DataFrames rather than looping predict() calls one at a time:
df_list = [df1, df2, df3]
x_timestamp_list = [x_ts1, x_ts2, x_ts3]
y_timestamp_list = [y_ts1, y_ts2, y_ts3]
pred_df_list = predictor.predict_batch(
df_list=df_list,
x_timestamp_list=x_timestamp_list,
y_timestamp_list=y_timestamp_list,
pred_len=pred_len,
T=1.0,
top_p=0.9,
sample_count=1,
verbose=True
)
for i, pred_df in enumerate(pred_df_list):
print(f"Predictions for series {i}:")
print(pred_df.head())
Every series in a batch must share the same lookback length and pred_len; volume/amount are still optional and get zero-filled per series if absent.
Live Demo #
Kronos ships a hosted demo forecasting the BTC/USDT pair over the next 24 hours, useful for sanity-checking the model’s behavior before installing anything locally:
๐ shiyu-coder.github.io/Kronos-demo
Finetuning on Your Own Data (A-Share Market Example) #
Kronos includes a full finetuning pipeline demonstrated on the Chinese A-share market via Qlib, Microsoft’s quant research toolkit:
pip install pyqlib
1. Configure โ edit finetune/config.py for qlib_data_path, dataset_path, save_path, backtest_result_path, and the pretrained checkpoint paths to start from.
2. Prepare the dataset:
python finetune/qlib_data_preprocess.py
3. Finetune the tokenizer, then the predictor โ both are multi-GPU via torchrun:
torchrun --standalone --nproc_per_node=NUM_GPUS finetune/train_tokenizer.py
torchrun --standalone --nproc_per_node=NUM_GPUS finetune/train_predictor.py
4. Backtest the finetuned model with a simple top-K strategy:
python finetune/qlib_test.py --device cuda:0

finetune/qlib_test.py โ from the Kronos repo
From Demo to Production: What Kronos Is Honest About #
The README is unusually direct about the gap between “runs a backtest” and “is a trading system,” which is worth taking at face value rather than glossing over:
- Raw signals โ pure alpha โ the demo’s output is a raw forecast; a real workflow would feed it into a portfolio-optimization step that neutralizes exposure to market beta and style factors (size, value) before treating it as tradeable alpha.
- The finetuning pipeline is explicitly a demonstration, not “a robust quantitative strategy,” per the maintainers’ own disclaimer.
- The simple top-K backtest strategy is a starting point โ production backtests need transaction costs, slippage, and market impact modeled to be trustworthy.
- Some code comments inside
finetune/were AI-generated (Gemini 2.5 Pro) for explanatory purposes and may contain inaccuracies โ the maintainers recommend trusting the code over the comments.
Kronos vs. TimesFM vs. a Traditional Trading Bot #
| Aspect | Kronos | TimesFM (Google) | Typical trading bot (e.g. Freqtrade) |
|---|---|---|---|
| Domain | Financial K-line data only | General-purpose (retail, weather, web traffic, finance, etc.) | Financial markets, execution-focused |
| Core capability | Forecasting via a pre-trained tokenizer + Transformer | Forecasting via a pre-trained decoder-only Transformer | Rule-based or ML-signal strategy execution |
| Ships a live-trading engine | No โ forecasting/backtesting research tool | No | Yes โ order execution against exchanges |
| Finetunable | Yes, documented pipeline (tokenizer + predictor) | Yes, via Google’s fine-tuning APIs | Strategy-dependent, not model-finetuning |
| License | MIT | Apache-2.0 | Varies (Freqtrade: GPL-3.0) |
| Best fit | Research-grade candlestick forecasting to feed into your own strategy layer | Cross-domain time-series forecasting where finance is one use case among many | Executing an already-defined strategy against a live or paper exchange |
Use Cases #
1. Forecasting Research Without Training From Scratch #
Load a pre-trained Kronos checkpoint and generate multi-asset forecasts in a few lines, instead of standing up your own tokenizer-plus-Transformer training run per market.
2. Signal Generation for an Existing Strategy Layer #
Use Kronos’s forecasts as one input into a portfolio-construction or risk-management system you already run โ the maintainers are explicit this is the intended split of responsibilities, not an end-to-end trading system.
3. Domain-Specific Finetuning #
Follow the A-share/Qlib pipeline as a template to finetune Kronos-small or Kronos-base on your own exchange’s historical data, then backtest with your own top-K or custom strategy logic.
4. Academic Benchmarking #
Because the paper (AAAI 2026) and pre-trained weights are both public, Kronos is a citable baseline for time-series-forecasting research that specifically targets financial data rather than general-purpose benchmarks.
Related Repositories #
| Repository | Purpose |
|---|---|
| Qlib | Microsoft’s quant research toolkit โ used by Kronos’s own A-share finetuning example |
| TimesFM | Google’s general-purpose time-series foundation model โ the closest non-finance-specific comparison |
Related Articles #
- TimesFM 2.5: Google’s Time Series Foundation Model โ the general-purpose counterpart to Kronos’s finance-specialist approach
- Vibe-Trading: HKU’s Open-Source Research Agent for Markets โ an agent layer that could consume forecasts like Kronos’s as one input
- AI-Trader: The Agent-Native Trading Platform from HKUDS โ for agent-driven execution rather than forecasting research
Conclusion #
Kronos is a narrow, well-scoped bet: rather than another general time-series model or another trading bot, it’s a pre-trained, MIT-licensed foundation model for exactly one thing โ candlestick sequences โ backed by a peer-reviewed paper (AAAI 2026) and 45+ exchanges of pre-training data. At 35,000+ stars and with pre-trained weights openly hosted on Hugging Face, it’s become a common reference point for anyone doing serious time-series-forecasting research on financial data, provided you respect its own disclaimer that a raw forecast is not the same thing as a production trading strategy.
Best for: Researchers and quant developers who want a pre-trained forecasting backbone for K-line data to finetune or benchmark against โ not traders looking for a plug-and-play bot.
GitHub: https://github.com/shiyu-coder/Kronos
Recommended Infrastructure for Finetuning #
Finetuning Kronos is multi-GPU (torchrun) work, so the practical bottleneck is GPU access rather than the model itself:
- DigitalOcean โ $200 free credit for 60 days across 14+ regions, including GPU droplets, enough to run the Qlib data-prep and a tokenizer finetune while you evaluate whether Kronos fits your market.
- HTStack โ Hong Kong VPS with low-latency access from mainland China, useful if your data pipeline (e.g. A-share/Qlib) is China-market-focused. Same IDC that hosts dibi8.com.
Affiliate links โ they don’t cost you extra and they help keep dibi8.com running.
Last updated: 2026-08-02
๐ฌ Discussion