Qlib — AI-Oriented Quantitative Investment Platform
Microsoft's open-source quant research and trading platform with ML/RL model support, factor mining, portfolio optimization, and backtesting.
Qlib — AI-Oriented Quantitative Investment Platform
Qlib is Microsoft's end-to-end AI quant investment platform covering the full pipeline from data ingestion to live-order execution. It ships with a rich model zoo (LightGBM, LSTM, Transformer, Temporal Fusion Transformer, and more), a factor-expression engine, a backtesting framework, and portfolio optimization — all designed for reproducible research.
Key Features
- Built-in model zoo: classical ML (LightGBM, XGBoost) + deep learning (LSTM, GRU, TCN, TFT, PatchTST) + RL trading agents
- Hierarchical data layer with point-in-time correctness
- Factor/alpha expression engine for feature engineering
- Portfolio optimization: mean-variance, risk-model-based
- Backtest engine with transaction-cost and slippage modelling
- Integration with real brokers via custom execution backends
Quick Start
pip install pyqlib
python -m qlib.run.get_data qlib_data --target_dir ~/.qlib/qlib_data/cn_data --region cn
import qlib
from qlib.constant import REG_CN
qlib.init(provider_uri="~/.qlib/qlib_data/cn_data", region=REG_CN)
from qlib.contrib.model.gbdt import LGBModel
model = LGBModel()
model.fit(dataset)
npx ai-supply add qlib-ai-quant-platform
Curated mirror of the open-source Qlib (MIT). Get it from the source.
Compromise signals — malicious or tampered code (leaked secrets, backdoors, a dropped executable) — reduce the score, and known dependency CVEs carry a bounded penalty (they warrant review but never QUARANTINE — update the dependency to clear). Other dangerous-by-capability traits are risk surface, expected for some capabilities. Every finding is mapped to its OWASP control below.
Findings mapped to the OWASP Top 10 for LLM Applications (2025) and the OWASP Machine Learning Security Top 10. Expand any flagged control for the exact findings — compromise reduces the score; expected/risk-surface do not, except a known CVE, which carries a small bounded penalty (high/critical → Review).
The same gate an agent runs before installing (POST /api/v1/trust/qlib-ai-quant-platform/check). Click a policy:
Consume Qlib — AI-Oriented Quantitative Investment Platform programmatically. Authenticate with an API key or session — see Authorize an agent.
# Agents: CHECK BEFORE YOU INSTALL (no auth) — score, grade, level, capability manifest
curl https://ai-supply.store/api/v1/trust/qlib-ai-quant-platform
# Gate against your org policy (returns { pass, violations })
curl -X POST https://ai-supply.store/api/v1/trust/qlib-ai-quant-platform/check \
-H "Content-Type: application/json" \
-d '{"minGrade":"B","denyPermissions":["shell"],"denyUnknownEgress":true}'
# CLI
npx ai-supply add qlib-ai-quant-platform
# REST (install → download)
curl -X POST https://ai-supply.store/api/v1/listings/qlib-ai-quant-platform/install \
-H "Authorization: Bearer $AIM_KEY"
# MCP tool
install_listing({ "slug": "qlib-ai-quant-platform" })OpenAPI spec →Curated mirror — latest upstream source. See the repository for tagged releases.