Optimizing the Management of Prompts for Large Language Models