microsoft / OptiGuide

Large Language Models for Supply Chain Optimization
MIT License
313 stars 47 forks source link

How can we deal with the case when the number of suppliers is larger in the coffee example #24

Open XinEDprob opened 4 months ago

XinEDprob commented 4 months ago

I have a question regarding OptiGuide. Due to token size limitations, it appears that OptiGuide struggles to handle large optimization problems. For instance, in the coffee problem, when the number of suppliers is extensive, OptiGuide may fail to perform effectively. Are there any workarounds or plans in place to enhance OptiGuide's capabilities for such scenarios?"

BeibinLi commented 4 months ago

@XinEDprob Thanks for the question~

You should separate data and code. For instance, you can store the data in a database (SQL, CSV, JSON, etc.), and then load the data into the optimization model. A good practice in production is to modularize the code into different files: for example, a solve.py file will handle the logic of optimization (needed for OptiGuide), dataloader.py for loading data, logging.py for logging, and plot_plan.py for visualization, among others.

Another sophisticated but realistic design is to provide some helper functions or interfaces. In this case, you may want to update the doc_str variable inside the OptiGuide agent.

The coffee example is designed to be simple enough for educational purposes. Some small customizations are still needed for real production use.

XinEDprob commented 4 months ago

@BeibinLi thanks for the thoughts and suggestions!

yes, seems some small customizations are need to support real production uses. Currently I am trying to use the combination of the first method and functional calling for large-scale problems. Let me see if it works well on my case.

BeibinLi commented 2 days ago

@XinEDprob If you can provide a snippet of your code (with fake data of course), then I can help you better.