shiyu-coder/Kronos
51.5
Adequate · 18 September 2026
8.3k
lines of production code
Python
primary language
1
measurement over time
What this system is
This system is a financial time-series prediction framework centered on the Kronos model, which utilizes Binary Spherical Quantization to compress and forecast market data. It provides comprehensive tools for adapting the model to specific datasets through fine-tuning pipelines for both Qlib and custom CSV inputs, including distributed training and backtesting capabilities. The system also offers multiple interfaces for generating and visualizing predictions, ranging from batch processing scripts and a Tkinter GUI to a web-based dashboard with interactive charting.
Features
Add custom CSV fine-tuning pipeline for Kronos
The finetune\_csv module now provides a complete workflow for fine-tuning Kronos models on user-provided CSV financial data. This includes a configuration loader, a custom dataset class for handling OHLCV time-series data, and training scripts for the tokenizer and predictor components. Users can run sequential training (tokenizer then predictor) or train components individually, with support for distributed training via DDP.
_finetune\csv · high confidence
Added example 5-minute K-line data for HK stock 09988
A new CSV file containing 5-minute K-line (candlestick) data for the Hong Kong stock 09988 has been added to the \finetune\_csv/data\ directory. This dataset includes timestamps, open, close, high, low, volume, and amount columns, covering trading days from November 26 to November 28, 2019, and serves as example data for fine-tuning workflows.
_finetune\csv/data · high confidence
Expanded stock prediction examples with batch processing and China A-share support
The examples directory now includes new scripts for batch prediction (\prediction\_batch\_example.py\), China A-share market analysis (\prediction\_cn\_markets\_day.py\), and a Tkinter-based GUI (\prediction\_new\_GUI.py\). These additions demonstrate the \KronosPredictor.predict\_batch\ capability for processing multiple data segments at once, provide specialized workflows for fetching and predicting daily K-line data for Chinese stocks using akshare, and offer a graphical interface for configuring and running predictions.
examples · high confidence
Introduce Kronos Web UI for financial prediction
A new web-based interface for the Kronos financial prediction model is now available in the webui directory. Users can launch the application via Flask (app.py) or provided shell scripts to load CSV/Feather data, select from Kronos-mini/small/base models, and generate predictions using adjustable parameters like temperature and nucleus sampling. The UI displays results using Plotly.js K-line charts and provides a comparison analysis between predicted and actual data. Prediction outputs are automatically saved as JSON files in the webui/prediction\_results directory for later review.
webui · high confidence
Introduce Kronos model with Binary Spherical Quantization
Adds the Kronos model architecture, including the KronosTokenizer, Kronos, and KronosPredictor classes, along with supporting modules. The implementation features a Binary Spherical Quantizer (BSQuantizer) for hybrid quantization, allowing the model to compress and decompress input data using encoder/decoder Transformer blocks and a codebook-based quantization scheme. The model is registered in a central dictionary for easy retrieval and supports auto-detection of the execution device.
model · high confidence
Introduce finetune module for model adaptation and backtesting
Adds a new \finetune\ package providing the complete pipeline to fine-tune the Kronos tokenizer and predictor on Qlib financial data and evaluate performance via backtesting. The module includes configuration management (\config.py\), data preprocessing and splitting logic (\qlib\_data\_preprocess.py\), a PyTorch dataset implementation (\dataset.py\) that strictly prevents data leakage by normalizing using only the lookback window, and distributed training scripts (\train\_tokenizer.py\, \train\_predictor.py\) supporting gradient accumulation and multi-GPU execution. It also provides a backtesting wrapper (\qlib\_test.py\) to generate trading signals and analyze portfolio metrics against a benchmark.
finetune · high confidence
Test coverage
Added regression tests for Kronos predictor outputs and MSE metrics
Added a new test suite (\test\_kronos\_regression.py\) and supporting fixture data (\regression\_input.csv\, \regression\_output\_256.csv\, \regression\_output\_512.csv\) to verify the deterministic behavior of the \KronosPredictor\. The tests validate that predictions for context lengths of 256 and 512 match expected outputs within a relative tolerance of 1e-5, and that the Mean Squared Error (MSE) for a sample of 30-step predictions stays within 1e-6 of expected baseline values (0.008979 and 0.003741 respectively).
tests · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 51.
Lenses
- Code Health 86
- Architecture 99
- Maturity 53
- Readiness 39
- Security 84
- Accessibility 55
Changes since last survey
- 76 commits — 58 feature/other, 18 fixes
By area
- (repo) — 19 commits
- (root) — 18 commits
- finetune_csv/README.md — 7 commits
- model/kronos.py — 6 commits
- webui/app.py — 4 commits
- model/module.py — 3 commits
- tests/data — 3 commits
- finetune/qlib_data_preprocess.py — 2 commits
- finetune/qlib_test.py — 2 commits
- webui/prediction_results — 2 commits
- webui/requirements.txt — 2 commits
- examples/prediction_batch_example.py — 1 commit
- examples/prediction_cn_markets_day.py — 1 commit
- examples/yuce — 1 commit
- figures/logo.png — 1 commit
- finetune/dataset.py — 1 commit
- finetune/train_predictor.py — 1 commit
- finetune/utils — 1 commit
- finetune_csv/examples — 1 commit
Notable commits
- fix: Add regression tests
- fix: Bug fix
- fix: Bug fix
- fix: Fix data leakage in normalization window (#227)
- fix: Merge pull request #211 from alexliao/fix-getting-started
- fix: Merge pull request #224 from randyy179/codex/fix-webui-python312-deps
- fix: Merge pull request #232 from kuishou68/fix/issue-231-sample-from-logits-topk-bug
- fix: Merge pull request #243 from ElhamDevelopmentStudio/fix/batch-dimension-training
- fix: Merge pull request #54 from ehan1990/bugfix/missing-dep-safe-tensor
- fix: Parametrize ctx len for mse regression test.
- fix: fix: add torch.cuda.empty_cache() during autoregressive inference
- fix: fix: define missing split_token in HierarchicalEmbedding
- fix: fix: preserve batch dimension in tokenizer and predictor training
- fix: fix: relax numpy requirement in webui dependencies
- fix: fix: remove incompatible numpy pin from webui requirements
- fix: fix: use torch.topk instead of calling top_k parameter as function in sample_from_logits
- fix: fix: 修复相对变化率转绝对价格的累积计算逻辑,使用cumprod确保价格连续性
- fix: fix: 解决Kronos模型预测连续性问题,通过价格转换保持数据连续性
- change: Auto-detect device for easier getting started
- change: Do not collect tokenizer metrics during inference
- …and 56 more
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
shiyu-coder/Kronos was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 18 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 67b630e67f6a18c9e9be918d9b4337c960db1e9a — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-5d04157a340d.