Source: Rise of the Runelords Anniversary Edition, pg(s). 354
The Leng Device is a major artifact built by Runelord Karzoug and his almost-human denizens of Leng allies from the plane of Leng. The final project undertaken by Karzoug before he entered the Eye of Avarice to hide from Earthfall, the Leng Device was built by Karzoug to create a temporal portal that would allow travel from any point in the future to a specific day in the height of Shalast: Karzoug knew that he would need an army to conquer the world when he awoke from his slumber. When Earthfall hit, the Leng Device was nowhere near completion and had to be sealed away.
In truth, unknown to Karzoug, the original purpose of the Leng Device, and the reason why the almost-humans worked with him at the first place, was to awaken the Great Old One Mhar, slumbering beneath Mhar Massif where Karzoug's capital, Xin-Shalast, was located. In 4707 AR, when Karzoug was about to return to the Material Plane from the Eye of Avarice, under orders from an unknown patron from Kadath, several denizens of Leng sojourned to Xin-Shalast and secretly re-purposed the temporal portal to a time long before Thassilon; when Karzoug's runewell triggers, its power will be siphoned into the Leng Device, awakening Mhar. Their plans were thwarted by the same group of adventurers that killed Karzoug.