A Worcester man who built a basement dungeon and fantasized about torturing, raping, killing, cooking and eating kidnapped children there should serve 27 years in federal prison for his crimes, federal prosecutors said in documents filed yesterday.

Geoffrey Portway, 40, pleaded guilty in May to solicitation to commit a crime of violence — kidnapping of a child — and distribution and possession of child pornography.

Portway faces sentencing in federal court Tuesday.

“Portway has pled guilty to some of the most vile and heinous crimes known to our society, namely participating in the sexual exploitation of young children through the possession and distribution of child pornography and soliciting the kidnapping of a child for the purpose of killing and consuming that child,” prosecutors wrote in sentencing papers.

The documents filed yesterday include disturbing excerpts from online chats with conspirators nationwide — including the now-convicted Ronald Brown of Largo, Fla., a puppeteer who planned along with Portway to kidnap children he knew through his work with a local church.

Brown even sent Portway a photo of one of the boys “with lines drawn on him to identify the different cuts of meat,” the sentencing memorandum states. They discussed taking that child to a rented house in the Everglades, mutilating him, eating his body over several weeks and feeding the “leftovers” to alligators.

Portway’s chats with Brown gave him an idea: “just need to open a mortuary,” he wrote. “any boy who is scheduled to be cremated, dissapears (sic). fake ashes given.”

The feds began investigating Portway in 2012 after linking him to a Web chat room obsessed with cannibalization and child rape. Investigators searched his home and found a soundproof, double-locked basement room with a “child-sized homemade coffin,” a steel cage, freezers and disposable scalpels. He has not been charged in any kidnappings or killings.

Laurel J. Sweet contributed to this report.