Foundation models in artificial intelligence are revolutionizing biomedical research, yet single nucleotide polymorphism (SNP) data, critical for advancing biobank studies and decoding human genetic diversity, remain underexplored. We introduce SNPBag, a transformer-based foundation model that redefines genome-scale SNP analysis. Pre-trained on 1 million simulated genomes using 0.8 billion parameters, it captures evolutionary signatures of 6 million SNPs, encoding linkage disequilibrium and haplotype structures with high fidelity. This paradigm-shifting model supports versatile tasks. In genotype imputation, it matches leading algorithms in performance and, when fine-tuned, achieves state-of-the-art (SOTA) accuracy. In haplotype phasing, it outperforms non-reference methods and rivaling the best reference-based method with a 72-fold speedup. Notably, it compresses 6 million SNPs per individual into a 0.75 MB embedding, enabling efficient storage, transfer and downstream applications. In particular, SNPBag embeddings facilitate rapid ancestry inference across global populations and detection of genetic relationships up to 12th-degree relatives. To summarize, SNPBag establishes a scalable, self-sufficient, multitasking AI framework, poised to transform SNP data analysis and unlock the growing potential of biobank resources.