private ExpressionNode transformFeature(ReferenceNode feature, RankProfileTransformContext context) {
        if ( ! feature.getName().equals("lightgbm")) return feature;

        try {
            FeatureArguments arguments = asFeatureArguments(feature.getArguments());
            ConvertedModel convertedModel =
                    convertedLightGBMModels.computeIfAbsent(arguments.path(),
                                                           path -> ConvertedModel.fromSourceOrStore(path, true, context));
            return convertedModel.expression(arguments, context);
        } catch (IllegalArgumentException | UncheckedIOException e) {
            throw new IllegalArgumentException("Could not use LightGBM model from " + feature, e);
        }
    }
A cache of imported models indexed by model path. This avoids importing the same model multiple times.
config-model/src/main/java/com/yahoo/schema/expressiontransforms/LightGBMFeatureConverter.java