{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://0xcopy.github.io/models-metadata/schemas/benchmarks.v0.json",
  "title": "Model benchmarks v0 (proposal)",
  "description": "Benchmark results for one subject, published and revised separately from the facts and signalled by its own descriptor. Every member is optional. See spec/profile.md.",
  "type": "object",
  "properties": {
    "$schema": {
      "type": "string"
    },
    "as_of": {
      "type": "string",
      "pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2}))?$"
    },
    "subject": {
      "type": "object",
      "properties": {
        "provider": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "measured_on": {
          "enum": [
            "route",
            "elsewhere"
          ],
          "description": "route: measured on the route that publishes this document. elsewhere: a reference run."
        },
        "deployment": {
          "type": "object",
          "properties": {
            "engine": {
              "type": "string"
            },
            "format": {
              "type": "string"
            },
            "quantization": {
              "type": "string"
            },
            "precision": {
              "type": "string"
            },
            "profile": {
              "type": "string"
            },
            "gpu": {
              "type": "string"
            },
            "gpus": {
              "type": "integer",
              "minimum": 1
            },
            "source": {
              "type": "string",
              "description": "URL of the page or API response the values come from."
            },
            "basis": {
              "enum": [
                "published",
                "reported",
                "measured",
                "contracted",
                "assumed"
              ],
              "description": "published: a docs page or public catalog. reported: returned by the provider's API for this account. measured: observed by a client. contracted: negotiated terms. assumed: illustrative."
            },
            "note": {
              "type": "string"
            },
            "size_bytes": {
              "type": "integer",
              "minimum": 0
            },
            "vram_bytes": {
              "type": "integer",
              "minimum": 0
            },
            "kv_bytes_per_token": {
              "type": "integer",
              "minimum": 0
            },
            "sliding_window": {
              "type": "integer",
              "minimum": 0
            }
          },
          "patternProperties": {
            "^x-": true
          },
          "additionalProperties": false
        },
        "label": {
          "type": "string",
          "description": "The model as named by the source, when that differs from an API id."
        }
      },
      "additionalProperties": false
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "benchmark": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "higher_is_better": {
            "type": "boolean"
          },
          "x": {
            "type": "string",
            "description": "Key of the independent variable in each point."
          },
          "y": {
            "type": "string",
            "description": "Key of the measured value in each point."
          },
          "points": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": {
                "type": "number"
              },
              "minProperties": 2
            }
          },
          "value": {
            "type": "number"
          },
          "stderr": {
            "type": "number",
            "minimum": 0
          },
          "threshold": {
            "type": "number"
          },
          "claimed_context": {
            "type": "integer",
            "minimum": 0
          },
          "effective_context": {
            "type": "integer",
            "minimum": 0
          },
          "rank": {
            "type": "object",
            "properties": {
              "position": {
                "type": "integer",
                "minimum": 1
              },
              "of": {
                "type": "integer",
                "minimum": 1
              },
              "by": {
                "type": "string"
              }
            },
            "additionalProperties": false
          },
          "method": {
            "type": "string",
            "description": "URL of the workflow or harness that produced the result."
          },
          "source": {
            "type": "string",
            "description": "URL of the page or API response the values come from."
          },
          "basis": {
            "enum": [
              "published",
              "reported",
              "measured",
              "contracted",
              "assumed"
            ],
            "description": "published: a docs page or public catalog. reported: returned by the provider's API for this account. measured: observed by a client. contracted: negotiated terms. assumed: illustrative."
          },
          "note": {
            "type": "string"
          },
          "by": {
            "type": "string",
            "description": "Key in each point that splits the points into series (for example depth_percent)."
          }
        },
        "dependentRequired": {
          "points": [
            "x",
            "y"
          ]
        },
        "patternProperties": {
          "^x-": true
        },
        "additionalProperties": false
      }
    }
  },
  "patternProperties": {
    "^x-": true
  },
  "additionalProperties": false
}
