Have you read this post?
I think in general the best way to get rid of a sociopath is to poison the well. But first you have to be absolutely sure that you want to be rid of him. It sounds like you still like having him in your life or in your child's life.
But if you are sure you want to get rid of him, my advice specific to you would be to hit him where it will probably hurt the most, financially. Speak with a lawyer about what sort of child support he would be legally liable to pay. Start collecting damaging information about him that you could use in a custody battle. For example, does he have unsavory guests at his house, does he smoke, drink, or have a history of violence or crime? If he is a true sociopath, you should be able to come up with quite a bit of dirt. Consider hiring a private detective. Find out things that he does not want you to know, things that would make him seem very unsympathetic in a custody hearing. Clean up your own past. Make sure that you are seen as a model parent. This is all very important preparation. You know what they say about planning: "To be prepared is half the victory." Sociopaths typically think at least a few steps ahead for their own actions, so you have to come up with your own defensive and offensive strategies.
After you have made yourself seem like the perfect parent and made him look like a terrible parent (3-6 mos? Don't rush things, make sure they are right before you do anything), start complaining about how he never does enough for the child. Be whiney and annoying.Mmake him wish that he had never met you. Whenever your child sees the father, try to schedule times for when he is sure to be upset -- hungry, tired, teething, etc. I'm not necessarily suggesting that you torture your child for his sake, but it might help. After about a month or two of this, start complaining about child support. Say that you are going to hire an attorney unless he pays you (double that amount your attorney said you could get from him). Do not tell him that you have already consulted an attorney. Do not tell him that you have already done background checks on him. Never tell a sociopath that you are plotting against him. Always make yourself seem as incompetent as possible. Your weapons that you have gained against him (information, etc.) should only be used as a counterattack, not the initial attack. You are like the southern army at Gettysburg -- on a hill, the strong point. If you got off your hill because he draws you into an attack, all is lost.
Hopefully he will start thinking that you are more trouble than you are worth. If so, try to get him to think it would be a good idea if he gave up custody. Suggest that you might be getting married or dating someone else who wants to adopt the child.
If he does not give up custody, perhaps if you have provoked him into some sort of action, e.g. hiring a lawyer or trying to get custody himself, then your next best option is to give him enough rope to hang himself. Make him think that you are still doing nothing. Hide all the cards until he shows up one day in court and you have all these witnesses and evidence suggesting that he is a terrible person. All his misdeeds will be public, the court can order a restraining order, and you will hopefully be given legal protection from him for you and your child.
Hope this helps. If it is true that your ex is a sociopath, that means your child may also be a sociopath. Read this post. Get more savvy. Read books on manipulation like The 48 Laws of Power, so you can recognize when others are trying to manipulate you. Always have an escape plan for everything, a ready made excuse. But don't talk to people about this. People can't be trusted not to talk. In a war with a sociopath, information is the only real power you will have. Guard it with your life.