This study aimed to introduce a novel machine learning (ML) model designed to predict the need of interventions during endoscopy in patients with upper gastrointestinal bleeding (UGIB). The risk stratification tools in current use, such as the Glasgow Blatchford Score (GBS) and pre-endoscopic Rockall score, have limitations in accurately predicting the need for endoscopic interventions. All patients diagnosed with UGIB from January 2013 to October 2023 who underwent endoscopy were included in the study. Variables extracted included demographics, social history ,clinical history, clinical presentation and symptoms, drug history, management prior to endoscopy, findings during endoscopy, laboratory variables and vitals, and post-endoscopic results. Three machine learning models including Random Forest Classifier (RFC), Gradient Boosting Classifier (GBC), and AdaBoost Classifier were used to evaluate the need for intervention during endoscopy in our study. A total of 1372 patients were included from three major hospitals in Jordan, of whom 242 underwent endoscopic intervention. The GBC outperformed all other models and pre-endoscopic scores in predicting the need for endoscopic intervention with an area under the curve of 0.861. Findings during endoscopy, platelet count, pulse rate and systolic blood pressure during admission were the most contributing features in predicting the need for the need of endoscopic intervention. This study highlights the potential of machine learning models in enhancing decision making for UGIB management.