--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: controller-gen.kubebuilder.io/version: v0.20.1 name: externalmodels.locostack.com spec: group: locostack.com names: kind: ExternalModel listKind: ExternalModelList plural: externalmodels shortNames: - em singular: externalmodel scope: Namespaced versions: - additionalPrinterColumns: - jsonPath: .spec.category name: Category type: string - jsonPath: .spec.provider name: Provider type: string - jsonPath: .spec.modelName name: Model type: string - jsonPath: .status.conditions[?(@.type=='Ready')].status name: Ready type: string name: v1alpha1 schema: openAPIV3Schema: description: ExternalModel is the Schema for the externalmodels API properties: apiVersion: description: |- APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources type: string kind: description: |- Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds type: string metadata: type: object spec: description: spec defines the desired state of ExternalModel properties: apiBase: description: apiBase overrides the upstream base URL (Azure, on-prem proxies, OpenAI-compatible providers). type: string apiVersion: description: apiVersion sets the API version when the provider requires it (e.g. Azure). type: string auth: description: auth describes how to authenticate to the provider. properties: apiKey: description: apiKeySecretRef references a Secret key holding an API key and the header name to carry it in. properties: headerName: description: headerName is the HTTP header used to carry the key. type: string secretRef: description: secretRef references the Secret key holding the API key value. properties: key: description: The key of the secret to select from. Must be a valid secret key. type: string name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret or its key must be defined type: boolean required: - key type: object x-kubernetes-map-type: atomic required: - secretRef type: object bearerToken: description: |- bearerTokenSecretRef references a Secret key holding a bearer token. Injected as Authorization: Bearer on every request. properties: key: description: The key of the secret to select from. Must be a valid secret key. type: string name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret or its key must be defined type: boolean required: - key type: object x-kubernetes-map-type: atomic headers: description: |- headers are arbitrary HTTP headers sourced from Secrets. Use for providers requiring multiple credentials or non-standard auth schemes. items: description: |- HTTPHeaderSpec defines an HTTP header whose value is sourced from a Secret. Used wherever arbitrary headers must be sent with outbound requests without inlining credential values into the CR. properties: name: description: name is the HTTP header name (e.g. X-Api-Key, Authorization). type: string valueFrom: description: valueFrom is the source for the header value — typically a secretKeyRef. properties: configMapKeyRef: description: Selects a key of a ConfigMap. properties: key: description: The key to select. type: string name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the ConfigMap or its key must be defined type: boolean required: - key type: object x-kubernetes-map-type: atomic fieldRef: description: |- Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. properties: apiVersion: description: Version of the schema the FieldPath is written in terms of, defaults to "v1". type: string fieldPath: description: Path of the field to select in the specified API version. type: string required: - fieldPath type: object x-kubernetes-map-type: atomic fileKeyRef: description: |- FileKeyRef selects a key of the env file. Requires the EnvFiles feature gate to be enabled. properties: key: description: |- The key within the env file. An invalid key will prevent the pod from starting. The keys defined within a source may consist of any printable ASCII characters except '='. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters. type: string optional: default: false description: |- Specify whether the file or its key must be defined. If the file or key does not exist, then the env var is not published. If optional is set to true and the specified key does not exist, the environment variable will not be set in the Pod's containers. If optional is set to false and the specified key does not exist, an error will be returned during Pod creation. type: boolean path: description: |- The path within the volume from which to select the file. Must be relative and may not contain the '..' path or start with '..'. type: string volumeName: description: The name of the volume mount containing the env file. type: string required: - key - path - volumeName type: object x-kubernetes-map-type: atomic resourceFieldRef: description: |- Selects a resource of the container: only resources limits and requests (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. properties: containerName: description: 'Container name: required for volumes, optional for env vars' type: string divisor: anyOf: - type: integer - type: string description: Specifies the output format of the exposed resources, defaults to "1" pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ x-kubernetes-int-or-string: true resource: description: 'Required: resource to select' type: string required: - resource type: object x-kubernetes-map-type: atomic secretKeyRef: description: Selects a key of a secret in the pod's namespace properties: key: description: The key of the secret to select from. Must be a valid secret key. type: string name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string optional: description: Specify whether the Secret or its key must be defined type: boolean required: - key type: object x-kubernetes-map-type: atomic type: object required: - name - valueFrom type: object type: array type: object category: description: |- category is the model category: language, embedding, or reranker. Determines which gateway endpoint clients use and the routing mode in the proxy config. enum: - language - embedding - reranker type: string defaultInferenceParams: description: |- inference holds per-model inference defaults baked into the gateway's proxy config entry for this model. Applied to every request unless the client overrides them. properties: extra: additionalProperties: type: string description: |- extra are pass-through key-value pairs forwarded as provider-specific parameters to the gateway when the model is gateway-bound. type: object maxTokens: description: maxTokens is the maximum number of tokens to generate for language models. format: int32 type: integer temperature: description: temperature is the sampling temperature for language models. type: string topP: description: topP is the nucleus sampling parameter for language models. type: string type: object extraParams: additionalProperties: type: string description: |- extraParams are pass-through provider-specific parameters forwarded to the gateway proxy config (e.g. aws_region_name, vertex_project, vertex_location). type: object modelName: description: |- modelName is the identifier exposed to clients and used as the model identifier in the gateway's proxy configuration. type: string provider: description: provider identifies the upstream provider (e.g. openai, anthropic). type: string providerModel: description: providerModel is the provider-side model id (e.g. gpt-4o-2024-11-20). type: string stackRef: description: stackRef associates this model with a stack. properties: name: default: "" description: |- Name of the referent. This field is effectively required, but due to backwards compatibility is allowed to be empty. Instances of this type with an empty value here are almost certainly wrong. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names type: string type: object x-kubernetes-map-type: atomic required: - category - modelName - provider - providerModel type: object status: description: status defines the observed state of ExternalModel properties: conditions: description: |- conditions represent the current state of the ExternalModel resource. Each condition has a unique type and reflects the status of a specific aspect of the resource. Standard condition types include: - "Available": the resource is fully functional - "Progressing": the resource is being created or updated - "Degraded": the resource failed to reach or maintain its desired state The status of each condition is one of True, False, or Unknown. items: description: Condition contains details for one aspect of the current state of this API Resource. properties: lastTransitionTime: description: |- lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. format: date-time type: string message: description: |- message is a human readable message indicating details about the transition. This may be an empty string. maxLength: 32768 type: string observedGeneration: description: |- observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. format: int64 minimum: 0 type: integer reason: description: |- reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. maxLength: 1024 minLength: 1 pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ type: string status: description: status of the condition, one of True, False, Unknown. enum: - "True" - "False" - Unknown type: string type: description: type of condition in CamelCase or in foo.example.com/CamelCase. maxLength: 316 pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ type: string required: - lastTransitionTime - message - reason - status - type type: object type: array x-kubernetes-list-map-keys: - type x-kubernetes-list-type: map observedGeneration: description: observedGeneration is the .metadata.generation last reconciled. format: int64 type: integer type: object required: - spec type: object served: true storage: true subresources: status: {}