{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/kinference-ai/json-schema/kinference-ai-inferenceworkerset-schema.json",
  "title": "InferenceWorkerSet (kinference.buoyant.io/v1alpha1)",
  "x-source": "https://github.com/Kinference-AI/kinference/blob/main/charts/kinference-crds/templates/kinference.buoyant.io_inferenceworkersets.yaml",
  "x-derived-from": "Kubernetes CRD spec.versions[].schema.openAPIV3Schema, copied unmodified",
  "x-generated": "2026-11-05",
  "description": "A set of local model-server pods, defined by a Service. Headless\nServices ok; traffic will be routed directly to individual pods.",
  "type": "object",
  "properties": {
    "apiVersion": {
      "type": "string"
    },
    "kind": {
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "type": "object",
      "required": [
        "serviceRef",
        "profile",
        "kvBlockSize"
      ],
      "properties": {
        "profile": {
          "description": "KInference routing profile used to determine latency\nestimation.",
          "type": "string",
          "minLength": 1,
          "maxLength": 253
        },
        "kvBlockSize": {
          "description": "Tokens per block in the KV-cache events published by the\nengines.  Note this is not necessarily the engine's\n--block-size configuration (e.g Gemma 4 reports block_size=64\nbut publishes 256-token blocks.)",
          "type": "integer",
          "minimum": 1,
          "maximum": 4096
        },
        "metricsPort": {
          "description": "Prometheus metrics port. If unset, resolves to the port named\n`metrics` if the Service has one, and otherwise to\nserviceRef.port.",
          "x-kubernetes-int-or-string": true
        },
        "serviceRef": {
          "description": "The underlying Service for the workers that will serve the\nrequest.",
          "type": "object",
          "required": [
            "name",
            "port"
          ],
          "properties": {
            "name": {
              "type": "string",
              "maxLength": 253
            },
            "port": {
              "x-kubernetes-int-or-string": true
            }
          }
        },
        "kvEvents": {
          "description": "Optional. The socket on which the model servers publish KV\ncache events. If unset, prefix cache data will not be used,\nwhich will result in degrading load balancing decisions.",
          "type": "object",
          "required": [
            "port"
          ],
          "properties": {
            "port": {
              "description": "Port for the ZMQ event PUBLISH socket.",
              "x-kubernetes-int-or-string": true
            },
            "replayPort": {
              "description": "Port for the ZMQ event REPLAY socket.  If unset, resolves\nto the port named `kv-replay` if the Service has one, and\notherwise disables replay.",
              "x-kubernetes-int-or-string": true
            }
          }
        },
        "modelDiscovery": {
          "description": "Model discovery endpoint.",
          "type": "object",
          "properties": {
            "mode": {
              "type": "string",
              "enum": [
                "Endpoint",
                "Static"
              ],
              "default": "Endpoint"
            },
            "interval": {
              "type": "string",
              "default": "30s",
              "pattern": "^([0-9]{1,5}(h|m|s|ms)){1,4}$"
            }
          }
        },
        "models": {
          "description": "Optional. If unset, models will be discovered via the\n`modelDiscovery` endpoint. Setting `aliases` provides for\nextra client-facing names for models.",
          "type": "array",
          "maxItems": 64,
          "x-kubernetes-list-type": "atomic",
          "items": {
            "type": "object",
            "required": [
              "name"
            ],
            "properties": {
              "name": {
                "description": "Upstream name",
                "type": "string",
                "maxLength": 512
              },
              "aliases": {
                "type": "array",
                "maxItems": 32,
                "x-kubernetes-list-type": "atomic",
                "items": {
                  "type": "string",
                  "maxLength": 512
                }
              }
            }
          }
        }
      }
    },
    "status": {
      "type": "object",
      "properties": {
        "state": {
          "type": "string",
          "maxLength": 256
        },
        "models": {
          "type": "array",
          "maxItems": 64,
          "x-kubernetes-list-type": "atomic",
          "items": {
            "type": "object",
            "required": [
              "upstreamName"
            ],
            "properties": {
              "upstreamName": {
                "type": "string",
                "maxLength": 512
              },
              "aliases": {
                "type": "array",
                "maxItems": 64,
                "x-kubernetes-list-type": "atomic",
                "items": {
                  "type": "string",
                  "maxLength": 512
                }
              },
              "readyEndpoints": {
                "type": "integer"
              },
              "contextWindow": {
                "type": "object",
                "properties": {
                  "min": {
                    "type": "integer"
                  },
                  "max": {
                    "type": "integer"
                  }
                }
              }
            }
          }
        },
        "referencedBy": {
          "type": "array",
          "maxItems": 64,
          "x-kubernetes-list-type": "atomic",
          "items": {
            "type": "string",
            "maxLength": 253
          }
        },
        "endpoints": {
          "type": "object",
          "properties": {
            "ready": {
              "type": "integer"
            },
            "terminating": {
              "type": "integer"
            }
          }
        },
        "kvEvents": {
          "type": "object",
          "properties": {
            "configured": {
              "type": "boolean"
            },
            "subscribedEndpoints": {
              "type": "integer"
            }
          }
        },
        "conditions": {
          "type": "array",
          "maxItems": 8,
          "x-kubernetes-list-type": "map",
          "x-kubernetes-list-map-keys": [
            "type"
          ],
          "items": {
            "type": "object",
            "required": [
              "type",
              "status",
              "lastTransitionTime",
              "reason",
              "message"
            ],
            "properties": {
              "type": {
                "type": "string",
                "maxLength": 316
              },
              "status": {
                "type": "string",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ]
              },
              "observedGeneration": {
                "type": "integer",
                "format": "int64",
                "minimum": 0
              },
              "lastTransitionTime": {
                "type": "string",
                "format": "date-time"
              },
              "reason": {
                "type": "string",
                "maxLength": 1024
              },
              "message": {
                "type": "string",
                "maxLength": 32768
              }
            }
          }
        }
      }
    }
  }
}