FrugalGPT: How to Use Large Language Models While Reducing Cost and Improving Performance