--- title: Kronos Market Forecast emoji: 📈 colorFrom: purple colorTo: indigo sdk: docker app_port: 7860 pinned: false license: mit --- # Kronos Market Forecast A small web app that turns the open-source [Kronos](https://github.com/shiyu-coder/Kronos) financial foundation model into an interactive, multi-asset forecasting tool — plus a surface-roughness research lab for calibrating and fine-tuning it. > ⚠️ **Research / educational demo — not financial advice.** Forecasts are probabilistic > samples from a model pre-trained largely on crypto K-lines, and are frequently wrong. > The leverage optimizer is a mechanical translation of a forecast into trade structure, > not a recommendation. Leverage can lose your entire margin (and more). Do not trade on this. ## What's inside | Component | Path | What it does | |---|---|---| | **Chart UI** | `crypto_ui/` (`/`) | Search any asset (crypto via Binance, stocks/ETFs/FX/indices/commodities via Yahoo), forecast it with Kronos-small/base, see ghost-candle predictions + a p10–p90 uncertainty band. | | **Portfolio Analyzer** | `crypto_ui/` (`/analyzer`) | Forecast one ticker across a matrix of intervals × horizons × both models; color-graded heatmaps, model-agreement consensus, save to JSON + standalone HTML report. | | **Leverage Trade Optimizer** | `crypto_ui/app.py` (`/api/optimize`) | Turns a forecast cell into Conservative/Balanced/Aggressive trade setups (entry, stop, take-profits, leverage sized so the stop sits inside liquidation) with full reasoning. Suppresses setups when the two models disagree on direction. | | **Surface-roughness lab** | `roughness_lab/` | Treats price as a measured surface profile (ISO-16610 Gaussian waviness/roughness split; Ra/Rq/Rz/RSm/Rsk/Rku/Wa). Calibrates Kronos sampling settings so forecast *texture* matches real market texture. | | **GPU fine-tune pipeline** | `roughness_lab/gpu_finetune/` | Roughness-aware fine-tuning: per-epoch checkpoints selected by texture realism, ready to run on a GPU box. | ## Run locally ```bash python -m venv .venv .venv/Scripts/python -m pip install -r crypto_ui/requirements.txt # Windows # source .venv/bin/activate && pip install -r crypto_ui/requirements.txt # macOS/Linux python crypto_ui/app.py # open http://127.0.0.1:8765 (analyzer at /analyzer) ``` Models (`NeoQuasar/Kronos-small`, `NeoQuasar/Kronos-base`, `NeoQuasar/Kronos-Tokenizer-base`) download automatically from the Hugging Face Hub on first use. CPU works; a forecast takes ~15 s (small) to a few minutes (base). The app imports the Kronos `model/` package — when deployed, that package is vendored alongside the app (see deploy notes). ## Credits & license Built on [shiyu-coder/Kronos](https://github.com/shiyu-coder/Kronos) (MIT). Kronos: *A Foundation Model for the Language of Financial Markets*, Shi et al., AAAI 2026 ([arXiv:2508.02739](https://arxiv.org/abs/2508.02739)). This project is MIT-licensed; the vendored `model/` package retains its upstream MIT license and copyright.