File size: 2,231 Bytes
29d1f68
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://huggingface.co/ryan-0608/MoS-DFlash-Routers/raw/main/schema/router_config.schema.json",
  "title": "MoS DFlash request-level router config",
  "type": "object",
  "required": [
    "schema_version",
    "artifact_id",
    "router_kind",
    "status",
    "target_model",
    "domain_outputs",
    "feature_contract",
    "head",
    "weights"
  ],
  "properties": {
    "schema_version": {"const": "1.0"},
    "artifact_id": {"type": "string", "minLength": 1},
    "router_kind": {"const": "request-level"},
    "status": {"const": "experimental"},
    "target_model": {
      "type": "object",
      "required": ["repo_id", "revision"],
      "properties": {
        "repo_id": {"type": "string", "minLength": 1},
        "revision": {"type": "string", "pattern": "^[0-9a-f]{40}$"}
      },
      "additionalProperties": false
    },
    "domain_outputs": {
      "type": "array",
      "minItems": 5,
      "maxItems": 5,
      "items": {
        "type": "object",
        "required": ["domain_id", "label", "expert_id"],
        "properties": {
          "domain_id": {"type": "integer", "minimum": 0, "maximum": 4},
          "label": {"type": "string"},
          "expert_id": {"type": "string"}
        },
        "additionalProperties": false
      }
    },
    "feature_contract": {"type": "object"},
    "head": {
      "type": "object",
      "required": ["input_dim", "hidden_dim", "output_dim", "dropout"],
      "properties": {
        "input_dim": {"type": "integer", "minimum": 1},
        "hidden_dim": {"type": "integer", "minimum": 1},
        "output_dim": {"const": 5},
        "dropout": {"type": "number", "minimum": 0, "maximum": 1}
      },
      "additionalProperties": true
    },
    "weights": {
      "type": "object",
      "required": ["filename", "format", "sha256", "size_bytes"],
      "properties": {
        "filename": {"const": "router_head.safetensors"},
        "format": {"const": "safetensors"},
        "sha256": {"type": "string", "pattern": "^[0-9a-f]{64}$"},
        "size_bytes": {"type": "integer", "minimum": 1}
      },
      "additionalProperties": true
    }
  },
  "additionalProperties": true
}