This blog post introduces the algorithm behind: https://quickwit.io/blog/whichlang-language-detection-librar...
It would be interesting to check on the dataset linked to this blog post from 6 years ago, evaluating fasttext model for language detection: https://alexott.blogspot.com/2017/10/evaluating-fasttexts-mo...