private void copyModelToRepository(String externalModelPath, OnnxEvaluatorOptions options) {
        var modelRepository = Defaults.getDefaults().underVespaHome(config.modelRepositoryPath());
        var repositoryModelRoot = Paths.get(modelRepository, modelName(externalModelPath));
        var modelVersionRoot = repositoryModelRoot.resolve("1");
        var repositoryModelFile = modelVersionRoot.resolve("model.onnx");
        var configFile = repositoryModelRoot.resolve("config.pbtxt");
        try {
            // Create directory for model name and version with correct permissions
            Files.createDirectories(
                    modelVersionRoot,
                    PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwxr-x")));

            Files.copy(Paths.get(externalModelPath), repositoryModelFile, StandardCopyOption.REPLACE_EXISTING);
            var modelConfig = options.rawConfig()
                    .orElseGet(() -> generateConfigFromEvaluatorOptions(externalModelPath, options).toString());
            Files.writeString(configFile, modelConfig);

            // To ensure that the Triton can read the model files, explicitly grant world read
            addReadPermissions(repositoryModelFile);
            addReadPermissions(configFile);
        } catch (IOException e) {
            throw new UncheckedIOException("Failed to copy model file to repository", e);
        }
    }
Copies the model file to the model repository and serializes the config
model-integration/src/main/java/ai/vespa/triton/TritonOnnxRuntime.java