Depends what you mean by 'work.' You can definitely use them, but GPT-4 is the only model that generates good SQL without lots of training + fine-tuning (and it is very difficult/impossible to come up with Nl <> SQL training sets). So GPT-4 is the only model that works well in terms of accuracy for now.
That being said, I am pretty sure the self hosted models will get there very soon.
Are you looking to deploy a solution with a self-hosted model?