{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$id" : "https://voltdb.com/voltsp/schemas/resource/onnx",
  "title" : "Onnx Resource Configuration",
  "description" : "This `onnx` resource loads and initializes a general (single file) ONNX model that processors\ncan reference. It handles downloading and caching of model files, as well as loading the necessary native libraries.\n\nSee the official ONNX [github repo](https://github.com/microsoft/onnxruntime) for more information.\n\n## Models\n\nSupports standard ONNX models (`.onnx` files) for various machine learning tasks including\nclassification, regression, and anomaly detection.\n\n## Downloads\n\nThe `modelUri` can point to a location on a local disk (using `file://` scheme) or on a remote storage.\nRemote storage support depends on available plugins, e.g., S3 plugin allows downloads from an S3-compatible bucket.\n",
  "type" : "object",
  "properties" : {
    "onnx" : {
      "type" : "object",
      "properties" : {
        "modelUri" : {
          "type" : "string",
          "format" : "uri",
          "description" : "URI to the ONNX model file. Required if modelResource is not specified."
        },
        "printDownloadProgress" : {
          "type" : "boolean",
          "description" : "Whether to display progress information during model file downloads.",
          "default" : "false"
        },
        "cache" : {
          "type" : "object",
          "description" : "This configuration controls how model files are cached locally, including the cache location,\nsize limits, expiration policy, and cleanup behavior. If not provided files will be cached in the /tmp directory.\n",
          "properties" : {
            "directory" : {
              "type" : "string",
              "description" : "Directory where files will be cached. If not specified, a temporary directory will be created."
            },
            "maxCacheSize" : {
              "type" : "integer",
              "description" : "Maximum size of the cache in bytes. Files will be evicted when the cache exceeds this size. Use 0 for unlimited.",
              "default" : "0",
              "minimum" : -9223372036854775808,
              "maximum" : 9223372036854775807
            },
            "expirationTime" : {
              "type" : "string",
              "pattern" : "^(\\d+[smhd]|P(T|\\d+[YMD]).*)",
              "description" : "Duration after which cached files are considered stale and will not be used by the system."
            },
            "cleanupOnStart" : {
              "type" : "boolean",
              "description" : "Whether to clean up expired or invalid cache entries when the cache is initialized.",
              "default" : "false"
            }
          },
          "additionalProperties" : false
        }
      },
      "required" : [ "modelUri" ],
      "additionalProperties" : false
    }
  },
  "required" : [ "onnx" ],
  "additionalProperties" : false
}
