Kronos
by
shiyu-coder

Description: Kronos: A Foundation Model for the Language of Financial Markets

View shiyu-coder/Kronos on GitHub ↗

Summary Information

Updated 22 minutes ago
Added to GitGenius on April 23rd, 2026
Created on July 1st, 2025
Open Issues/Pull Requests: 175 (+0)
Number of forks: 3,727
Total Stargazers: 20,887 (+1)
Total Subscribers: 188 (+0)

Issue Activity (beta feature)

Open issues: 150
New in 7 days: 7
Closed in 7 days: 0
Avg open age: 163 days
Stale 30+ days: 120
Stale 90+ days: 109

Recent activity

Opened in 7 days: 7
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

No label distribution available yet.

Detailed Description

Kronos, developed by shiyu-coder, is a groundbreaking open-source foundation model specifically designed for the financial markets. It aims to understand and predict the "language" of financial data, particularly focusing on K-line (candlestick) sequences, a fundamental representation of price movements in trading. Unlike general-purpose Time Series Foundation Models (TSFMs), Kronos is tailored to the unique characteristics of financial data, which is often characterized by high noise and volatility. The project offers a live demo showcasing its forecasting capabilities, and pre-trained models are readily available on the Hugging Face Hub.

The core purpose of Kronos is to provide a powerful and accessible tool for various quantitative tasks within the financial domain. Its key feature is its ability to process and understand K-line data from over 45 global exchanges. The model utilizes a novel two-stage framework. First, a specialized tokenizer converts the continuous, multi-dimensional K-line data (Open, High, Low, Close, Volume, and Amount - OHLCV) into hierarchical discrete tokens. This quantization process simplifies the complex financial data into a format that the model can efficiently process. Second, a large, autoregressive Transformer model is pre-trained on these tokens. This Transformer architecture allows Kronos to learn the patterns and relationships within the financial data, enabling it to generate forecasts and perform other quantitative analyses.

The repository provides a comprehensive "Getting Started" guide, including detailed installation instructions and code examples. Users can easily install the necessary dependencies using pip and then utilize the `KronosPredictor` class to generate forecasts. The guide walks users through loading the pre-trained model and tokenizer from the Hugging Face Hub, instantiating the predictor, preparing input data (including the required 'open', 'high', 'low', and 'close' columns, and optional 'volume' and 'amount' columns), and generating predictions. The `predict` method allows users to specify parameters like temperature (`T`), top-p sampling probability, and the number of forecast paths (`sample_count`) to control the sampling process and generate probabilistic forecasts. The repository also offers a `predict_batch` method for efficient parallel prediction across multiple time series, which is particularly useful for analyzing multiple assets or time periods simultaneously.

Beyond basic forecasting, the repository provides a complete pipeline for fine-tuning Kronos on custom datasets. This is particularly valuable for adapting the model to specific markets or trading strategies. The fine-tuning process involves four main steps: configuration, data preparation, model fine-tuning, and backtesting. The repository provides example scripts using Qlib, a quantitative finance library, to demonstrate how to prepare data from the Chinese A-share market. The fine-tuning process involves adjusting both the tokenizer and the predictor model using multi-GPU training. The repository also includes a backtesting script to evaluate the performance of the fine-tuned model, providing insights into its potential for generating trading signals. The repository emphasizes that the provided backtesting example is a simplified demonstration and that real-world quantitative strategies require more sophisticated techniques for portfolio optimization, risk management, and accurate modeling of transaction costs.

The repository also includes a model zoo, which lists various pre-trained models with different capacities, allowing users to choose the model that best suits their computational resources and application needs. The models are readily accessible on the Hugging Face Hub. The project is licensed under the MIT License, making it freely available for research and commercial use. The repository also provides a citation for the research paper describing Kronos, encouraging proper attribution for its use. The project is actively maintained, with recent updates including the release of fine-tuning scripts and the availability of the paper on arXiv.

Kronos
by
shiyu-codershiyu-coder/Kronos

Repository Details

Fetching additional details & charts...