This is the treadmill that generates the power that drives the machinery that operates the Ankh-Morpork Mint. It is massive, and its housing can be seen projecting from the roof of the Mint, giving the forbidding fortress-like building the appearance of a piggy-bank with a coin stuck in the slot.
It was formerly operated by convict labour on loan from the Tanty, but this is now no longer permissible under the "cruel and un-natural punishment clause. The unspoken reason for Vetinari's decision is the advisability of allowing convicted criminals access to the building that makes money. Moist von Lipwig, being a criminal himself, is in agreement with this - he's seen any number of ways in which a hypothetical criminal, given hypothetical entry to the Mint, might make a hypothetical exit, having hypothetically acquired a pocketful of hypothetical dollars, although he is risking a hypothetical hanging even for hypothesising about how to rob the Mint. Besides, he's been in the Tanty himself, in the days where he didn't have a Get Out of Jail Free card in his hand, and he's had to do his share on the Tanty treadmill, so he has some feeling for other unfortunates.
Such a thing did exist on Roundworld. Treadwheels were used in prisons as penal labour in the early Victorian period in Britain as a form of punishment. According to The Times in 1827, and reprinted in William Hone's Table-Book in 1838, the amount prisoners walked per day on average varied, from 6,600 feet at Lewes to 17,000 feet in just ten hours during the summertime at Warwick gaol. Some justified it as exercise; most used it as pointless punishment. In no case did it actually achieve anything such as creating power or even grinding corn.