{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/aicomputeradar-dev/json-schema/aicomputeradar-dev-fit-response-schema.json",
  "title": "FitResponse",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/aicomputeradar-dev-v1-openapi.json#/components/schemas/FitResponse",
  "type": "object",
  "properties": {
    "hardware": {
      "$ref": "#/$defs/Hardware"
    },
    "assumptions": {
      "type": "object"
    },
    "best": {
      "oneOf": [
        {
          "$ref": "#/$defs/Fit"
        },
        {
          "type": "null"
        }
      ]
    },
    "fits": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Fit"
      }
    }
  },
  "$defs": {
    "Fit": {
      "type": "object",
      "properties": {
        "model": {
          "type": "object"
        },
        "quantization": {
          "type": "string"
        },
        "label": {
          "type": "string",
          "enum": [
            "EXCELLENT",
            "GOOD",
            "TIGHT",
            "OFFLOAD_REQUIRED",
            "NOT_RECOMMENDED",
            "UNKNOWN"
          ]
        },
        "score": {
          "type": [
            "integer",
            "null"
          ]
        },
        "confidence": {
          "type": "string",
          "enum": [
            "high",
            "medium",
            "low"
          ]
        },
        "estimateGb": {
          "type": "object",
          "description": "Memory in GB: weights, contextCache, overhead, total, usableMemory, offload. Null where the attention shape is unpublished."
        },
        "basis": {
          "type": "object",
          "description": "Where each part of estimateGb comes from: weights are measured from the GGUF file listing, contextCache is computed from the model's config, overhead is a declared assumption, usableMemory is the profile's memory after declared margins. No part is a speed figure or a forecast.",
          "properties": {
            "weights": {
              "type": "string",
              "enum": [
                "measured"
              ]
            },
            "contextCache": {
              "type": "string",
              "enum": [
                "computed"
              ]
            },
            "overhead": {
              "type": "string",
              "enum": [
                "assumed"
              ]
            },
            "usableMemory": {
              "type": "string",
              "enum": [
                "computed"
              ]
            }
          }
        },
        "utilization": {
          "type": [
            "number",
            "null"
          ]
        },
        "explanation": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "links": {
          "type": "object"
        }
      }
    },
    "Hardware": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "memoryGb": {
          "type": "number"
        },
        "memoryArchitecture": {
          "type": "string",
          "enum": [
            "discrete",
            "unified"
          ]
        },
        "category": {
          "type": "string"
        },
        "usableMemoryGb": {
          "type": "number"
        },
        "usableMemoryNote": {
          "type": [
            "string",
            "null"
          ]
        },
        "memoryBandwidthGbps": {
          "type": [
            "number",
            "null"
          ]
        },
        "page": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri"
        }
      }
    }
  }
}