← Back to Leaderboard
Qmicrosoft

microsoft/qlib

Modular Python framework for quant research, from market data to backtests

AI FrameworkQuickstart ↓
Engineering Health (Methodology)
A+ · 93/100
Maintenance Activity
● Updated 29d ago
Latest Release
v0.9.8
Commercial License Check
MIT · Commercial Friendly

Automated SPDX check for reference only — not legal advice. Disclaimer

Maintenance31/35
Fork Adoption25/25
Release Cadence17/20
License Clarity20/20
DockerCLI
Total Stars
★ 50,825
24h Growth
+12
7d Growth
+197
Forks
8,020

GitHub Star History

Full-history star trajectory from GitHub official history. Switch ranges or hover any point for exact counts.

microsoft/qlib Star History (2020-09-19 - 2026-12-04) ALL-TIME STAR HISTORY (2020-09 – 2026-12) +50.8k in 2267d · avg +22/day 53.7k 26.8k 0 2020-09-19: ★ 12021-02-06: ★ 3,8792021-06-26: ★ 4,8022021-11-13: ★ 6,5502022-04-02: ★ 7,7342022-08-20: ★ 8,8962023-01-07: ★ 9,6192023-05-27: ★ 10,4762023-10-14: ★ 12,0672024-03-02: ★ 13,0012024-07-20: ★ 14,1682024-12-07: ★ 15,2372025-04-26: ★ 18,4352025-09-13: ★ 29,6952026-01-31: ★ 35,5582026-06-20: ★ 44,4592026-12-04: ★ 50,825 ★ 50.8k 2020-09 2023-10 2026-12

Evidence-Backed Technical Brief

AI Deep Review

Architecture & Core Mechanics

Qlib is a modular Python framework for quantitative investment research, not an LLM inference runtime. Its workflow turns market data into instrument pools and time-bounded features, passes prepared datasets to models, and feeds predictions into strategies and executors for simulation and analysis. The components are loosely coupled: a team can reuse the data API without adopting the entire workflow, or run a benchmark end to end through qrun and a configuration file.

The pyqlib package uses PyYAML and NumPy; its build stack includes setuptools, setuptools-scm, Cython, and NumPy. Model dependencies are separate concerns: the benchmark catalog spans tree learners, PyTorch, and TensorFlow. Configuration-driven extensions also have a version-sensitive trust boundary. The source migration path retains package imports but requires per-component trusted: true for local .py imports, restricts expressions, and requires explicit extension mappings.

Key Capabilities & Differentiators

The data layer supports date-bounded instrument and feature queries, including lagged values and rolling calculations. Daily and one-minute data preparation paths are exposed through the CLI, and v0.9.7 added Parquet support. The benchmark catalog spans LightGBM, XGBoost, CatBoost, PyTorch models such as LSTM and Transformer, and a legacy TensorFlow TFT example. Supervised learning, market-dynamics modeling, and reinforcement learning serve different parts of the research stack rather than requiring one model family.

Strategies and executors can be nested across granularities, allowing signal generation and execution behavior to be evaluated at different levels within a simulation. Experiment outputs include information coefficient (IC) and backtest results, and Qlib provides an online model-serving path. RD-Agent is a separate integration for automating factor mining and model optimization; that integration does not make Qlib an LLM-serving engine.

Trade-offs & Limitations

Compared with using a model library directly, Qlib takes on more of the research workflow: feature preparation, shared experiment configuration, and simulation. That pays off when several models need to be evaluated under the same assumptions. If signals are already produced elsewhere and the only task is evaluating trading rules, a dedicated backtester has a smaller integration surface. Neither Qlib's backtest nor its online model-serving path should be treated as a ready-made broker integration or evidence of live execution performance.

The model catalog is broader than any one compatible environment. The legacy TFT example calls for TensorFlow 1.15 and Python 3.6–3.7, outside the current core package's declared Python range. The batch benchmark runner is Linux-only, creates a separate virtual environment per model, and does not run repeated trials of the same model in parallel. Reproducibility therefore depends on pinning the data snapshot and model environment, not just saving the workflow configuration. The MIT license covers the code; market-data rights must be evaluated separately.

Hardware & Deployment Guide

For a first run, install pyqlib in an isolated Python environment, prepare a dataset, then run a LightGBM benchmark with qrun. The core package declares Python 3.8 or later and lists classifiers through 3.12; verify the requirements of the chosen benchmark separately. The Dockerfile uses a Miniconda base, Python 3.8, build-essential, and pins including NumPy 1.23.5 and pandas 1.5.3. Its default IS_STABLE=yes installs pyqlib from PyPI; the other branch invokes python setup.py install. Pin the image base and package version if you need reproducible builds. The Node manifest is for pull-request title checks, not the research runtime.

The official sample dataset is marked temporarily unavailable; plan on a vetted community snapshot or your own data conversion. In addition to the data-layer changes in v0.9.7, the v0.9.8 release entry lists restrictions on executable recorder artifacts. Before upgrading, test saved-model reloads, resumed or delayed training, and DDG-DA; check whether HIST mappings or high-frequency cache paths need migration. Source, tagged, and PyPI builds can differ, so verify the exact version before relying on a migration flag or configuration setting.

Data API: Query instrument pools such as csi500 and request date-bounded features with expressions such as Ref($close, 1) and Mean($close, 3).
Workflow entry points: Use qrun for configuration-driven runs or examples/workflow_by_code.py for Python integration.
Model zoo: Compare XGBoost, LightGBM, CatBoost, PyTorch sequence models, and a legacy TensorFlow TFT example, subject to per-model dependencies.
Simulation: Nest strategies and executors across granularities and evaluate runs with IC and backtest outputs.
Release evolution: v0.9.7 added Parquet support and unified the data-handler fetch interface through BaseDataHandler.
Artifact trust: v0.9.8 lists restrictions on executable recorder artifacts while keeping fresh in-memory training and supported data-only reads available without opt-in.
Best For

Quant teams that want to compare factors and models on a shared, versioned data and backtest workflow, with room for custom Python components.

Skip If

You need an LLM inference server, turnkey live brokerage integration, or a single ready-to-run environment for every legacy benchmark.

Reviewed on 2026-12-03 · Grounded in GitHub README, root file tree & releasesMethodology

Quick Start & Installation

DockerCLI
pip install pyqlib

Comparison vs. Top LLMs & Inference Alternatives

Full comparison →
RepositoryStars7d TrendStackLicenseCore Positioning
qlib ★50.8k+197PythonMITModular Python framework for quant research, from market data to backtests
transformers169.6k+337PythonApache-2.0A PyTorch model-definition SDK for unified inference and training across modalit
pytorch105.9k+299Python—Python-first tensor SDK for GPU-accelerated training and inference
scikit-learn68.5k+126PythonBSD-3-ClauseIn-process Python library for machine learning and data mining

AI Context Briefing (for Claude / Cursor / Windsurf)

Standardized architecture summary & quickstart commands ready to paste into coding agents.

Raw .md ↗
curl -sL https://repoforai.com/repo/microsoft/qlib.md

Embed Star History Chart & Badges in README.md

Full-history Star History SVGs and velocity cards on GitHub Camo: drop-in replacement for OSSInsight and Star History widgets.

microsoft/qlib Star History on RepoForAI

Active README embeds unlock Hot-Tier 6h Telemetry Refresh automatically (zero pay-to-rank).

Frequently Asked Questions about qlib

Do I have to adopt the entire workflow to use Qlib's data or modeling components?

No. Use qrun to launch a configuration-driven benchmark, or use examples/workflow_by_code.py as a starting point for a Python integration. The data API can be used independently through D.instruments, D.list_instruments, and D.features. When moving a workflow between source and packaged releases, verify the configuration rules for the target version before reusing local extensions.

How should I size hardware for a first run?

Start with a daily-data LightGBM benchmark and measure peak RAM, disk usage, and runtime on your own universe. There is no single VRAM requirement: GPU needs depend on the model backend and configuration, and CPU-oriented baselines are a reasonable starting point. Minute-level data, feature materialization, and concurrent jobs increase resource demand; size those separately from neural-model training.

Can we self-host Qlib for commercial research?

Qlib is MIT-licensed and can be run locally or in a self-managed container. Review market-data rights separately: the code license does not grant permission to use or redistribute third-party datasets. Restrict writes to shared artifact storage, and enable trusted loading only after verifying the artifact producer and storage permissions.

When is Qlib preferable to standalone modeling and backtesting tools?

Choose Qlib when you want to reuse the same data, model, evaluation, and backtest workflow across multiple experiments. A standalone learner is simpler if you already have those surrounding pieces; a backtest-only stack is a better fit if your signals are already generated elsewhere. RD-Agent is a separate project for research automation, not a reason to select Qlib as an LLM inference server.

Upstream README & Documentation

This profile focuses on independent engineering analysis and live telemetry. Read the full upstream README, changelog, and examples directly on GitHub.

Maintaining microsoft/qlib? Pin to Homepage + competitor /alternatives pages with a custom Cloud/Demo CTA.Feature microsoft/qlib on Homepage & Alternatives ($19)
WEEKLY BREAKOUT DIGEST

Top 10 Breakout Open-Source AI Repos, Every Thursday

Signal-only digest of fast-growing AI repos, SPDX license alerts, and architecture picks. Zero spam.

Zero spam · 1-click unsubscribe · Privacy Policy

Saved in your browser · Export Markdown RFC tables or jump into /vs compare