feat: add safe tensor model type to SBOM output (#4844)

---------
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
Co-authored-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Christopher Angelo Phillips
2026-07-15 17:14:03 -04:00
committed by GitHub
co-authored by Alex Goodman
parent ed499fd2d0
commit aff2c247db
37 changed files with 7829 additions and 89 deletions
File diff suppressed because it is too large Load Diff
+53 -1
View File
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "anchore.io/schema/syft/json/16.1.9/document",
"$id": "anchore.io/schema/syft/json/16.1.10/document",
"$ref": "#/$defs/Document",
"$defs": {
"AlpmDbEntry": {
@@ -2925,6 +2925,9 @@
{
"$ref": "#/$defs/RustCargoLockEntry"
},
{
"$ref": "#/$defs/SafetensorsModelInfo"
},
{
"$ref": "#/$defs/SnapEntry"
},
@@ -4216,6 +4219,55 @@
],
"description": "RustCargoLockEntry represents a locked dependency from a Cargo.lock file with precise version and checksum information."
},
"SafetensorsModelInfo": {
"properties": {
"format": {
"type": "string",
"description": "Format is the source format label (always \"safetensors\" for this metadata type).\nPresent because the Docker AI model config blob carries an explicit format field"
},
"architecture": {
"type": "string",
"description": "Architecture is the model architecture (e.g., \"LlamaForCausalLM\",\n\"Qwen3MoeForConditionalGeneration\"). It is not present in the SafeTensors\nheader itself; it is enriched from the companion config.json\n\"architectures\" array when one is found alongside the model."
},
"quantization": {
"type": "string",
"description": "Quantization describes tensor precision (e.g., \"BF16\", \"F16\", \"F32\", \"INT8\")."
},
"parameters": {
"type": "integer",
"description": "Parameters is the total number of model parameters, computed from the tensor\nshapes in the SafeTensors header(s). For a sharded model it is the sum across\nevery shard."
},
"tensorCount": {
"type": "integer",
"description": "TensorCount is the number of tensor entries in the file header."
},
"totalSize": {
"type": "string",
"description": "TotalSize is the total byte size of tensor data across all shards when known\n(from the Docker AI model config \"size\" field)."
},
"shardCount": {
"type": "integer",
"description": "ShardCount is the number of .safetensors shards for a sharded model (1 for a\nsingle-file model)."
},
"userMetadata": {
"$ref": "#/$defs/KeyValues",
"description": "UserMetadata is the optional \"__metadata__\" map from a .safetensors file header\n(string-to-string key/values set by the producer)."
},
"metadataHash": {
"type": "string",
"description": "MetadataHash is an xxhash over the on-disk SafeTensors header (sorted tensor\nentries + __metadata__). It is derived ONLY from the safetensors file bytes."
},
"parts": {
"items": {
"$ref": "#/$defs/SafetensorsModelInfo"
},
"type": "array",
"description": "Parts contains metadata from additional SafeTensors shards or OCI layers that\nwere merged into this package during post-processing."
}
},
"type": "object",
"description": "SafeTensorsModelInfo holds the model details extracted from SafeTensors content."
},
"Schema": {
"properties": {
"version": {