Sam Raimi is in negotiations to direct Lionsgate’s adaptation of “The Kingkiller Chronicle,” based on Pat Rothfuss’ classic novels.

In 2016, Lionsgate tapped “Hamilton” star and creator Lin-Manuel Miranda to serve as creative producer and musical mastermind of the feature film and TV series adaptations of “The Kingkiller Chronicle,” along with Rothfuss. Miranda has the option to be involved in future stage productions as well.

Lionsgate had no comment on the Raimi news.

The film’s script is being penned by Lindsey Beer, who served as a writer on “Transformers: The Last Knight.” It will be based on the first book in Rothfuss’ series, “The Name of the Wind.”

The series is centered on the wizard Kvothe, who survives a tragic childhood to become a notorious household name. “The Kingkiller Chronicle” series of books and novellas has sold 10 million copies, and the first two books — “The Name of the Wind” and “The Wise Man’s Fear” — were New York Times bestsellers.

Showtime is also currently developing a “Kingkiller Chronicle” TV show based on the series.

Raimi has been weighing several projects currently in development, including the Skydance pic “Bermuda Triangle,” but sources say this film is in the best position to be his next project.

Raimi, who may be best known for the “Evil Dead” series and the original “Spider-Man” trilogy, has been focused on his producing in recent years, and hasn’t directed anything since 2013’s “Oz the Great and Powerful” for Disney. He is repped by CAA.