In this paper we apply system identification techniques in order to build a model suitable for the prediction of glycemia levels of critically ill patients admitted to the intensive care unit. These patients typically show increased glycemia levels, and it has been shown that glycemia control by means of insulin therapy significantly reduces morbidity and mortality. Based on a real-life dataset from 15 critically ill patients, an initial input-output model is estimated which captures the insulin effect on glycemia under different settings. To incorporate patient-specific features, an adaptive modeling strategy is also proposed in which the model is re-estimated at each time step (i.e., every hour). Both one-hour-ahead predictions and four-hours-ahead simulations are executed. The optimized adaptive modeling technique outperforms the general initial model. To avoid data selection bias, 500 permutations, in which the patients are randomly selected, are considered. The results are satisfactory both in terms of forecasting ability and in the clinical interpretation of the estimated coefficients.