The selection of the appropriate AI model from a variety of different classes of models for network security is a challenging and time-consuming task. In this study, we introduce an innovative meta-learning approach for optimizing model selection for network intrusion detection tasks using advanced machine learning techniques. Our method involves training an ensemble of seven state-of-the-art artificial intelligence (AI) models, each with varied hyperparameters resulting in a total of 64 unique model configurations. This approach aims to address the critical challenge of identifying the most effective model for detecting and classifying network threats without the necessity of repetitively training and evaluating each model on new datasets. By leveraging the output probabilities of these models as inputs to a trained regressor, we generate expected probabilities that predict the performance of each model configuration on unseen data. This novel meta-learning mechanism significantly streamlines the process of model selection by utilizing the regressor to identify the optimal model, thereby circumventing the computationally expensive and time-consuming task of model selection. Our comprehensive experiments demonstrate the effectiveness of our approach, showcasing superior performance in threat detection and classification on the NSL-KDD and CICIDS-2017 datasets compared to conventional model selection strategies.