This study explores gender prediction using Nepali names in the Devanagari script, comparing traditional machine learning algorithms and advanced transformer architectures like BERT. The research found that BERT variants, specifically DeBERTa and DistilBERT, significantly outperform traditional methods, particularly when incorporating last character encoding. The dataset comprised over 502,000 names, and methodology enhancements led to a 10% performance improvement in traditional models by considering name endings.