Optimizing Generative AI: Harnessing Flexibility in Model Selection