I concur with Bob; if this is a college/university program you're enrolled in, your first step should be to talk to the school/department and see what they recommend or perhaps require. Many programs require certain platforms and configurations, so it would be best to check with them first or you may find that you have bought a system that doesn't meet their requirements.
That said, AI systems and particularly large-language models (LLMs) are quite RAM-hungry, so I would strongly recommend that whatever you decide on that you get as much RAM as your budget will allow. Many laptops, including all current MacBooks, cannot have their RAM expanded later, so what you buy up front is probably what you'll have to live with. Internal storage in a MacBook can't be expanded either, but you can almost always use an external storage device to get more space.
Again, consult with your program and see what they tell you.
Regards.