As early as possible, but even if you're far into pregnancy now, you can still switch to a midwife. We decided at 30 weeks we wanted to switch and made the switch at 32 weeks. I was afraid we couldn't do it that late in the pregnancy, but it wasn't a problem! Next time, I plan on going to my midwife from the pregnancy test on.