@@ -580,6 +580,95 @@ func TestConfig(t *testing.T) {
580580` ,
581581 fail : true ,
582582 },
583+ // valid: minimal config with required fields only
584+ {
585+ config : `
586+ {
587+ "descriptor": {
588+ "name": "xyz-3-8B-Instruct"
589+ },
590+ "config": {
591+ "paramSize": "8b"
592+ },
593+ "modelfs": {
594+ "type": "layers",
595+ "diffIds": [
596+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
597+ ]
598+ }
599+ }
600+ ` ,
601+ fail : false ,
602+ },
603+ // valid: full config with all optional fields populated
604+ {
605+ config : `
606+ {
607+ "descriptor": {
608+ "createdAt": "2025-01-01T00:00:00Z",
609+ "authors": ["xyz@xyz.com"],
610+ "vendor": "XYZ Corp.",
611+ "family": "xyz3",
612+ "name": "xyz-3-8B-Instruct",
613+ "version": "3.1",
614+ "title": "XYZ 3 8B Instruct",
615+ "description": "xyz is a large language model.",
616+ "docURL": "https://www.xyz.com/get-started/",
617+ "sourceURL": "https://github.com/xyz/xyz3",
618+ "datasetsURL": ["https://www.xyz.com/datasets/"],
619+ "revision": "1234567890",
620+ "licenses": ["Apache-2.0"]
621+ },
622+ "config": {
623+ "architecture": "transformer",
624+ "format": "safetensors",
625+ "paramSize": "8b",
626+ "precision": "float16",
627+ "quantization": "gptq",
628+ "capabilities": {
629+ "inputTypes": ["text"],
630+ "outputTypes": ["text"],
631+ "knowledgeCutoff": "2024-05-21T00:00:00Z",
632+ "reasoning": true,
633+ "toolUsage": false
634+ }
635+ },
636+ "modelfs": {
637+ "type": "layers",
638+ "diffIds": [
639+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
640+ "sha256:abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890"
641+ ]
642+ }
643+ }
644+ ` ,
645+ fail : false ,
646+ },
647+ // valid: multimodal model with image input and output
648+ {
649+ config : `
650+ {
651+ "descriptor": {
652+ "name": "xyz-vl-7B"
653+ },
654+ "config": {
655+ "architecture": "transformer",
656+ "paramSize": "7b",
657+ "capabilities": {
658+ "inputTypes": ["text", "image"],
659+ "outputTypes": ["text", "image", "embedding"]
660+ }
661+ },
662+ "modelfs": {
663+ "type": "layers",
664+ "diffIds": [
665+ "sha256:1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
666+ ]
667+ }
668+ }
669+ ` ,
670+ fail : false ,
671+ },
583672 } {
584673 r := strings .NewReader (tt .config )
585674 err := schema .ValidatorMediaTypeModelConfig .Validate (r )
0 commit comments