Liu Wei 劉隗 (273-333), courtesy name Dalian 大連, was a high state official of the Eastern Jin period 東晉 (317-420). He hailed from Pengcheng 彭城 (today’s Xuzhou 徐州, Jiangsu) and was chamberlain (neishi 內史) of the Princedom of Pengcheng and General overseeing the army (guanjun jiangjun 冠軍將軍). When the Jin dynasty lost northern China, Liu Wei participated in the re-establishment of the central government by Sima Rui 司馬睿, the Prince of Langya 琅琊, in Jiankang 建康 (today's Nanjing 南京, Jiangsu), and was first appointed palace gentleman for service (congshi zhonglang 從事中郎). When Sima Rui assumed the title of emperor (Emperor Yuan 晉元帝, r. 317-322) in 317, Liu Wei was Vice Censor-in-chief (yushi zhongcheng 御史中丞), palace attendant (shizhong 侍中), and metroplitan magistrate (yin 尹) of Danyang 丹陽.
Liu Wei and Diao Xie 刁協 (d. 322) belonged to the most trusted advisors of Emperor Yuan, but military matters were in the hands of Wang Dao 王導 (276-339) and his cousin Wang Dun 王敦 (266-324), so that Liu and Diao constituted a civilian balance against the Wangs.
Liu's position was strengthened, when he was given the title of General defending the north (zhenbei jiangjun 鎮北將軍) and the command over the armies in the provinces of Qingzhou 青州, Xuzhou 徐州, Youzhou 幽州, and Pingzhou 平州. He was equipped with a special warrant (jiajie 假節) as Cavalier attendant-in-ordinary (sanji changshi 散騎常侍). The forces defending the city of Sikou 泗口 alone amounted to 10,000 troops.
Wang Dun saw his position threatened, and therefore decided in 322 to rebel against the dynasty, with the pretext of punishing Liu Wei for inappropriate conduct. The rebel occupied the imperial capital Jiankang 建康 (today's Nanjing 南京, Jiangsu) and forced Liu Wei to flee. The latter rendered himself to northern China, where he offered the Jie 羯-Xiongnu 匈奴 chieftain Shi Le 石勒 (r. 319-333) his services. Shi Le, ruler of the Later Zhao empire 後趙 (319-350), appointed Liu Wei palace gentleman for service, right clerk of the Counsellor-in-chief (chengxiang zuo changshi 丞相左長史) and Grand Mentor of the Heir Apparent (taizi taiwei 太子太傅) and was bestowed the title of a marquis (liehou 列侯).
Liu Wei died during Shi Hu's 石虎 (r. 334-349) campaign against the city of Chang'an 長安 (Xi'an 西安, Shaanxi).