# ModelService

Source: https://v0-1.docs.modelplane.ai/reference/modelservices/

Expose model endpoints via a unified OpenAI-compatible URL.

Apply instances as `apiVersion: modelplane.ai/v1alpha1`, `kind: ModelService`.

[Concept guide: Expose a Model](https://v0-1.docs.modelplane.ai/models/model-service/index.md)

## Example

```yaml
apiVersion: modelplane.ai/v1alpha1
kind: ModelService
metadata:
  name: qwen-72b
  namespace: ml-team
spec:
  endpoints:
    - selector:
        matchLabels:
          modelplane.ai/deployment: qwen-72b
```

## Definition

The CompositeResourceDefinition this reference is generated from, with the complete OpenAPI schema, validation rules, and defaults:

```yaml
apiVersion: apiextensions.crossplane.io/v2
kind: CompositeResourceDefinition
metadata:
  name: modelservices.modelplane.ai
spec:
  group: modelplane.ai
  names:
    categories: [crossplane, modelplane]
    kind: ModelService
    plural: modelservices
    shortNames: [ms]
  scope: Namespaced
  versions:
  - name: v1alpha1
    served: true
    referenceable: true
    additionalPrinterColumns:
    - name: ADDRESS
      type: string
      jsonPath: .status.address
    schema:
      openAPIV3Schema:
        type: object
        required: [spec]
        properties:
          spec:
            type: object
            required: [endpoints]
            properties:
              endpoints:
                type: array
                description: >-
                  Endpoints to route traffic to. Each entry selects a
                  set of ModelEndpoints by label. Matched endpoints are
                  load-balanced equally.
                minItems: 1
                items:
                  type: object
                  required: [selector]
                  properties:
                    selector:
                      type: object
                      required: [matchLabels]
                      properties:
                        matchLabels:
                          type: object
                          additionalProperties:
                            type: string
          status:
            type: object
            properties:
              address:
                type: string
                description: >-
                  Public address where this service is reachable.
              conditions:
                type: array
                items:
                  type: object
```
