As essential components of ionic polymer electrolytes (IPEs), ionic liquids (ILs) with high ionic conductivity and wide electrochemical window are promising candidates to enable safe and high-energy-density lithium metal batteries (LMBs). Here, we describe a machine learning workflow embedded with quantum calculation and graph convolutional neural network to discover potential ILs for IPEs. By selecting subsets of the recommended ILs, combining with a rigid-rod polyelectrolyte and a lithium salt, we develop a series of thin (~50 μm) and robust (>200 MPa) IPE membranes. The Li|IPEs|Li cells exhibit ultrahigh critical-current-density (6 mA cm−2) at 80 °C. The Li|IPEs|LiFePO4(10.3 mg cm−2) cells deliver outstanding capacity retention in 350 cycles (>96% at 0.5C; >80% at 2C), fast charge/discharge capability (146 mAh g−1at 3C) and excellent efficiency (>99.92%). This performance is rarely reported by other single-layer polymer electrolytes without any flammable organics for LMBs.