{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://turing.viglet.org/models/catalog.schema.json",
  "title": "Turing Public Model Catalog",
  "description": "Vendor-neutral, kind-aware catalog of LLM / embedding / rerank / media models (Block BC / T759). The source file keys entries by provider plugin type and omits the redundant per-entry 'vendor' (it is the map key); the published artifact (scripts/emit-model-catalog.mjs) adds 'vendor' to each entry for consumer convenience — hence 'vendor' is optional here.",
  "type": "object",
  "required": ["version", "lastUpdated", "vendors"],
  "properties": {
    "version": {
      "type": "integer",
      "minimum": 1,
      "description": "Schema major version. Breaking changes bump this and the pinned catalog-vN.json URL."
    },
    "lastUpdated": {
      "type": "string",
      "format": "date",
      "description": "ISO-8601 date the catalog was last regenerated."
    },
    "schema": {
      "type": "string",
      "description": "URL of this JSON Schema."
    },
    "source": {
      "type": "string",
      "description": "Origin of the catalog (e.g. https://turing.viglet.org)."
    },
    "vendors": {
      "type": "object",
      "description": "Map of provider plugin type (lower-case) to its model entries.",
      "additionalProperties": {
        "type": "array",
        "items": { "$ref": "#/$defs/modelEntry" }
      }
    }
  },
  "$defs": {
    "modelEntry": {
      "type": "object",
      "required": ["id", "label", "kind"],
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1,
          "description": "The exact id sent to the vendor."
        },
        "label": {
          "type": "string",
          "minLength": 1,
          "description": "Human-friendly display name."
        },
        "kind": {
          "type": "string",
          "enum": [
            "CHAT",
            "EMBEDDING",
            "RERANK",
            "IMAGE",
            "TRANSCRIPTION",
            "SPEECH",
            "VIDEO",
            "MODERATION",
            "UNKNOWN"
          ],
          "description": "Model kind (the TurLlmModelKind taxonomy, Block BB / T750)."
        },
        "vendor": {
          "type": "string",
          "description": "Provider plugin type. Absent in the source (it is the map key); added to each entry in the published artifact."
        },
        "contextWindow": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum context tokens, when known."
        },
        "embeddingDimensions": {
          "type": "integer",
          "minimum": 1,
          "description": "Output vector size — only meaningful for kind = EMBEDDING."
        },
        "capabilities": {
          "type": "array",
          "items": { "type": "string" },
          "description": "Capability hints such as vision, tools, reasoning, multimodal."
        },
        "openWeights": {
          "type": "boolean",
          "description": "True when the model's weights are openly downloadable (open-weight), false when it is proprietary API-only. A universal, unambiguous fact that informs the type of use. Curated/anchored, omitted rather than guessed. Additive (Block I / T39)."
        },
        "parameters": {
          "type": "integer",
          "minimum": 1,
          "description": "Total parameter count, only when the vendor has publicly disclosed it (typical of open-weight models; absent for closed frontier models, so NOT a universal capability proxy). Curated/anchored, never guessed. Additive (Block I / T39)."
        },
        "deprecated": {
          "type": "boolean",
          "description": "True when the vendor has retired or superseded the id."
        },
        "maxOutputTokens": {
          "type": "integer",
          "minimum": 1,
          "description": "Maximum tokens the model can emit in a single response, when known. Additive (Block BD / T764)."
        },
        "modalities": {
          "$ref": "#/$defs/modalities",
          "description": "Supported input/output modalities, when known. Additive (Block BD / T764)."
        },
        "knowledgeCutoff": {
          "type": "string",
          "description": "Training-data knowledge cutoff, ISO-8601 date or year-month (e.g. 2025-03 or 2025-03-01). Additive (Block BD / T764)."
        },
        "releaseDate": {
          "type": "string",
          "format": "date",
          "description": "ISO-8601 date the model id became available. Additive (Block BD / T764)."
        },
        "aliases": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "description": "Alternate ids that resolve to this model (e.g. dated snapshots, -latest pointers). Additive (Block BD / T764)."
        },
        "status": {
          "type": "string",
          "enum": ["PREVIEW", "GA", "DEPRECATED", "RETIRED"],
          "description": "Lifecycle stage. GA = generally available; RETIRED = no longer served. Prefer this over the boolean `deprecated` when the exact stage is known. Additive (Block BD / T764)."
        },
        "sources": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "description": "Provenance — the source ids (e.g. openai-api, litellm, overrides) that contributed fields to this entry, recorded by the regeneration pipeline (Block BD / T765). Additive (Block BD / T764)."
        },
        "lastVerified": {
          "type": "string",
          "format": "date",
          "description": "ISO-8601 date this entry was last confirmed against its sources by the regeneration pipeline. Additive (Block BD / T764)."
        },
        "pricing": {
          "$ref": "#/$defs/pricing",
          "description": "Optional INDICATIVE US list price — a reference only, NOT an authoritative or contract-accurate quote (verify with the vendor). Never per-contract/region/negotiated. Provenance-gated + never invented. Additive (Block F / T30)."
        },
        "benchmarks": {
          "$ref": "#/$defs/benchmarks",
          "description": "Optional CITED third-party capability index (e.g. an Artificial Analysis Intelligence Index or LMArena Elo) — a reference to someone else's published number, NOT our quality verdict. Provenance-gated + never invented; verify at the source. Additive (Block I / T40)."
        },
        "performance": {
          "$ref": "#/$defs/performance",
          "description": "Optional CITED speed metrics (output throughput + time-to-first-token) — a second axis ('fast vs capable') alongside the capability index. A reference to a public measurement, NOT our own benchmark. Provenance-gated + never invented; verify at the source. Additive (Block I / T43)."
        }
      }
    },
    "pricing": {
      "type": "object",
      "additionalProperties": false,
      "required": ["indicative", "source", "lastVerified"],
      "description": "Indicative US list price for a model id. Bounded by STRATEGY §I (reversed, Block F): US list price only, optional, provenance-gated, never invented, flagged non-authoritative. NOT a billing engine — no per-contract/region/negotiated/committed-use pricing.",
      "properties": {
        "inputPer1M": {
          "type": "number",
          "minimum": 0,
          "description": "Indicative US list price in USD per 1,000,000 input (prompt) tokens."
        },
        "outputPer1M": {
          "type": "number",
          "minimum": 0,
          "description": "Indicative US list price in USD per 1,000,000 output (completion) tokens."
        },
        "currency": {
          "type": "string",
          "enum": ["USD"],
          "description": "Always USD — the catalog carries only an indicative US list price."
        },
        "unit": {
          "type": "string",
          "description": "Unit the per-* figures are expressed in (e.g. 'per_1M_tokens')."
        },
        "indicative": {
          "type": "boolean",
          "const": true,
          "description": "Always true — signals this is an indicative US list reference, NOT an authoritative or contract-accurate quote. Verify with the vendor."
        },
        "note": {
          "type": "string",
          "description": "Free-text disclaimer/qualifier travelling with the number (e.g. 'Indicative US list price — verify with vendor')."
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "Provenance — where the price came from (e.g. litellm, overrides, a vendor pricing-page URL). Required: pricing is never invented."
        },
        "lastVerified": {
          "type": "string",
          "format": "date",
          "description": "ISO-8601 date this price was last confirmed against its source."
        }
      }
    },
    "benchmarks": {
      "type": "object",
      "additionalProperties": false,
      "required": ["indicative", "source", "lastVerified"],
      "description": "Cited third-party capability numbers for a model id (Block I / T40). Treated exactly like `pricing`: a REFERENCE to a public, citable leaderboard — never our own quality verdict, never invented. Provenance-gated (indicative + source + lastVerified). Verify at the source. The per-domain `scores` map is added by T42.",
      "properties": {
        "intelligenceIndex": {
          "type": "number",
          "minimum": 0,
          "description": "A cited composite 'intelligence' index (e.g. the Artificial Analysis Intelligence Index). A third-party number, not our verdict."
        },
        "arenaElo": {
          "type": "number",
          "minimum": 0,
          "description": "A cited human-preference Elo rating (e.g. LMArena). An alternative capability signal to intelligenceIndex."
        },
        "scores": {
          "type": "object",
          "description": "Optional per-domain cited scores (Block I / T42) — so capability is comparable per use-case, not one opaque number. Recommended keys: 'reasoning' (general reasoning), 'coding' (e.g. SWE-bench), 'math'. Each value is cited from the object's `source` unless it carries its own. A model uneven across domains is shown honestly.",
          "additionalProperties": {
            "type": "object",
            "additionalProperties": false,
            "required": ["value"],
            "properties": {
              "value": {
                "type": "number",
                "minimum": 0,
                "description": "The cited score for this domain (scale defined by the source)."
              },
              "source": {
                "type": "string",
                "minLength": 1,
                "description": "Per-domain provenance override; falls back to the parent benchmarks.source when omitted."
              },
              "lastVerified": {
                "type": "string",
                "format": "date",
                "description": "Per-domain verification date; falls back to the parent benchmarks.lastVerified when omitted."
              }
            }
          }
        },
        "indicative": {
          "type": "boolean",
          "const": true,
          "description": "Always true — signals these are indicative, cited third-party numbers, NOT an authoritative or invented quality verdict. Verify at the source."
        },
        "note": {
          "type": "string",
          "description": "Free-text disclaimer/qualifier travelling with the numbers (e.g. 'Cited from Artificial Analysis — verify at the source')."
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "Provenance — the citable leaderboard the numbers came from (e.g. 'Artificial Analysis', an LMArena URL). Required: benchmarks are never invented."
        },
        "lastVerified": {
          "type": "string",
          "format": "date",
          "description": "ISO-8601 date these numbers were last confirmed against their source."
        }
      }
    },
    "performance": {
      "type": "object",
      "additionalProperties": false,
      "required": ["indicative", "source", "lastVerified"],
      "description": "Cited speed metrics for a model id (Block I / T43). A second axis ('fast vs cheap vs capable') paired with `pricing` and `benchmarks`. Treated exactly like `pricing`: a REFERENCE to a public measurement (often the same leaderboard as `benchmarks`), never our own benchmark, never invented. Provenance-gated (indicative + source + lastVerified). Verify at the source.",
      "properties": {
        "throughputTps": {
          "type": "number",
          "minimum": 0,
          "description": "Cited output throughput in tokens per second (higher = faster generation)."
        },
        "latencyTtftSec": {
          "type": "number",
          "minimum": 0,
          "description": "Cited time-to-first-token in seconds (lower = more responsive)."
        },
        "indicative": {
          "type": "boolean",
          "const": true,
          "description": "Always true — signals these are indicative, cited third-party measurements, NOT authoritative or invented. Verify at the source."
        },
        "note": {
          "type": "string",
          "description": "Free-text disclaimer/qualifier travelling with the numbers (e.g. 'Cited from Artificial Analysis — verify at the source')."
        },
        "source": {
          "type": "string",
          "minLength": 1,
          "description": "Provenance — the citable measurement source. Required: performance is never invented."
        },
        "lastVerified": {
          "type": "string",
          "format": "date",
          "description": "ISO-8601 date these numbers were last confirmed against their source."
        }
      }
    },
    "modalities": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "input": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["text", "image", "audio", "video", "pdf"]
          },
          "description": "Accepted input modalities."
        },
        "output": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": ["text", "image", "audio", "video", "embedding"]
          },
          "description": "Produced output modalities."
        }
      }
    }
  }
}
