Inspiration

Forecasting demand is notoriously difficult in retail, where factors like weather, promotions, seasonality, and competitor pricing can change consumer behavior overnight. We were inspired to build DemandFlow to bring together modern time series learning and generative AI explanations so businesses can not only predict demand but also understand why those predictions are made.


What it does

DemandFlow predicts expected units sold for any product over a selected future period. The system dynamically:

  • Collects contextual factors (weather, holidays, competitor pricing).
  • Combines user inputs (planned price, discount).
  • Runs a time series forecasting model (TimeLLM) to predict sales.
  • Generates an easy-to-understand explanation of the prediction using an LLM hosted on AWS SageMaker.

How we built it

  • Model Training:
    We developed and trained TimeLLM, which processes historical sequences using patch embeddings and a transformer backbone (GPT-2).

  • Backend API:
    FastAPI handles prediction requests, scales inputs, and prepares data for the model.

  • Frontend Interface:
    Streamlit provides an intuitive web app for users to enter product and pricing details.

  • Explanations:
    A SageMaker-hosted LLM generates descriptive narratives about the forecasts.

  • Deployment:
    All components run on a single AWS EC2 instance with public access for evaluation.


Challenges we ran into

  • Managing large model checkpoints within GitHub’s repository size limits.
  • Scaling synthetic dataset predictions into realistic output ranges.
  • Coordinating multiple services (FastAPI, Streamlit, SageMaker) reliably on EC2.
  • Designing a workflow simple enough for non-technical users without losing important input features.

Accomplishments that we're proud of

  • Successfully integrating time series forecasting with generative language explanations.
  • Deploying a complete pipeline that runs end-to-end in real time on AWS.
  • Creating a transparent prediction system where users can see and adjust the assumptions that drive forecasts.

What we learned

  • Combining LLMs with time series models opens up new ways to improve interpretability in forecasting.
  • Even synthetic datasets require extensive scaling and validation to produce believable results.
  • Simplifying the user experience without sacrificing predictive power is critical for adoption.

What's next for DemandFlow

  • Expand to multilingual support.
  • Add user authentication and historical forecast tracking.
  • Retrain the model on real retailer datasets for production-grade accuracy.

Built With

Share this project:

Updates