My only hope is when my children are old enough to have a rational conversation, I can explain to them that their mom is sick.
I'm in another support group through my therapist where we discuss our relationships with our high conflict co-parents. I'm not an expert, but from what the other members have explained, this is a long process. You'll need to be careful because you can't cause parental alienation. As your children start to ask questions like, "why does mommy behave this way?" you'll need to give them answers at their level. Remember anything you say to the children will go right back to their mother until they're at least teenagers. This will only cause you more drama.
You do have another hope though, that your co-parent with BPD becomes so unhinged that she gets committed to a hospital and is forced to accept help. Remember it is somewhat treatable in the unlikely event that a patient is able to accept the diagnosis of the condition and work on themselves.
I have taken to popping those delta 8 gummies to deal with her and just stay mellow with her so she doesn't imagine some "abuse" against her and add it to her journal.
Funny, I went the other direction. I used to be a stoner, but I stopped communing with the mother herb, so I could have a clear mind when I was dealing with my exwBPD.
I forgot to mention she keeps a journal of all my horrible "abuses" like the time I asked why she did all of her laundry but none of mine and appeared annoyed.
As time consuming and sucky as it is, you should start documenting her behavior, as well. If this ever escalates to the legal system, you'll need to counter her evidence with your own. I take screen captures of dysregulated text messages and set them up in PDF documents. Then I send it all to my therapist. I also make recordings of in person conversations if I think there will be a dysregulation. I don't think it's admissible in court, but it does help when she distorts conversations later to fit her own narrative. You can listen back to it and prove to yourself, you never said these things. When I first joined this group, my head was so scrambled from all the gaslighting and blame shifting, that I thought I was the person with BPD.
My friends all speak to me about "getting a good lawyer so that you have full custody" and inside I'm like "oh yeah so she can smear my name and try to destroy my life with all her fantasies and ghost me with my kids for who knows how long" as if BPD people pay close attention to what is legal and who has custody. It's an awful situation but just talking with people like all of you have already made me feel much better. Simply knowing I am not alone and with people who actually understand.
Remember this is about protecting the kids more than protecting yourself. You might want to get some consultations with lawyers to see what they say about how to move forward.
Do you have a therapist? If not you should find one that specializes in couples and co-parenting support. My therapist recognized what was going on very early in our couples sessions. I send them all of the documentation of dysregulations to keep on file. In addition, my therapist was able to recommend me a really good attorney. The advice he provided helped me keep things out of the court system. You are right to want to avoid the legal system if possible. You really don't want to go there if you can avoid it. The horror stories the other members of my support group come in with about court are just awful, and it's expensive. You might not have a choice, though. Your co-parent with BPD sounds very difficult.