locostack.com_externalmodels.yaml 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  1. ---
  2. apiVersion: apiextensions.k8s.io/v1
  3. kind: CustomResourceDefinition
  4. metadata:
  5. annotations:
  6. controller-gen.kubebuilder.io/version: v0.20.1
  7. name: externalmodels.locostack.com
  8. spec:
  9. group: locostack.com
  10. names:
  11. kind: ExternalModel
  12. listKind: ExternalModelList
  13. plural: externalmodels
  14. shortNames:
  15. - em
  16. singular: externalmodel
  17. scope: Namespaced
  18. versions:
  19. - additionalPrinterColumns:
  20. - jsonPath: .spec.category
  21. name: Category
  22. type: string
  23. - jsonPath: .spec.provider
  24. name: Provider
  25. type: string
  26. - jsonPath: .spec.modelName
  27. name: Model
  28. type: string
  29. - jsonPath: .status.conditions[?(@.type=='Ready')].status
  30. name: Ready
  31. type: string
  32. name: v1alpha1
  33. schema:
  34. openAPIV3Schema:
  35. description: ExternalModel is the Schema for the externalmodels API
  36. properties:
  37. apiVersion:
  38. description: |-
  39. APIVersion defines the versioned schema of this representation of an object.
  40. Servers should convert recognized schemas to the latest internal value, and
  41. may reject unrecognized values.
  42. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
  43. type: string
  44. kind:
  45. description: |-
  46. Kind is a string value representing the REST resource this object represents.
  47. Servers may infer this from the endpoint the client submits requests to.
  48. Cannot be updated.
  49. In CamelCase.
  50. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
  51. type: string
  52. metadata:
  53. type: object
  54. spec:
  55. description: spec defines the desired state of ExternalModel
  56. properties:
  57. apiBase:
  58. description: apiBase overrides the upstream base URL (Azure, on-prem
  59. proxies, OpenAI-compatible providers).
  60. type: string
  61. apiVersion:
  62. description: apiVersion sets the API version when the provider requires
  63. it (e.g. Azure).
  64. type: string
  65. auth:
  66. description: auth describes how to authenticate to the provider.
  67. properties:
  68. apiKey:
  69. description: apiKeySecretRef references a Secret key holding an
  70. API key and the header name to carry it in.
  71. properties:
  72. headerName:
  73. description: headerName is the HTTP header used to carry the
  74. key.
  75. type: string
  76. secretRef:
  77. description: secretRef references the Secret key holding the
  78. API key value.
  79. properties:
  80. key:
  81. description: The key of the secret to select from. Must
  82. be a valid secret key.
  83. type: string
  84. name:
  85. default: ""
  86. description: |-
  87. Name of the referent.
  88. This field is effectively required, but due to backwards compatibility is
  89. allowed to be empty. Instances of this type with an empty value here are
  90. almost certainly wrong.
  91. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  92. type: string
  93. optional:
  94. description: Specify whether the Secret or its key must
  95. be defined
  96. type: boolean
  97. required:
  98. - key
  99. type: object
  100. x-kubernetes-map-type: atomic
  101. required:
  102. - secretRef
  103. type: object
  104. bearerToken:
  105. description: |-
  106. bearerTokenSecretRef references a Secret key holding a bearer token.
  107. Injected as Authorization: Bearer <token> on every request.
  108. properties:
  109. key:
  110. description: The key of the secret to select from. Must be
  111. a valid secret key.
  112. type: string
  113. name:
  114. default: ""
  115. description: |-
  116. Name of the referent.
  117. This field is effectively required, but due to backwards compatibility is
  118. allowed to be empty. Instances of this type with an empty value here are
  119. almost certainly wrong.
  120. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  121. type: string
  122. optional:
  123. description: Specify whether the Secret or its key must be
  124. defined
  125. type: boolean
  126. required:
  127. - key
  128. type: object
  129. x-kubernetes-map-type: atomic
  130. headers:
  131. description: |-
  132. headers are arbitrary HTTP headers sourced from Secrets.
  133. Use for providers requiring multiple credentials or non-standard auth schemes.
  134. items:
  135. description: |-
  136. HTTPHeaderSpec defines an HTTP header whose value is sourced from a Secret.
  137. Used wherever arbitrary headers must be sent with outbound requests without
  138. inlining credential values into the CR.
  139. properties:
  140. name:
  141. description: name is the HTTP header name (e.g. X-Api-Key,
  142. Authorization).
  143. type: string
  144. valueFrom:
  145. description: valueFrom is the source for the header value
  146. — typically a secretKeyRef.
  147. properties:
  148. configMapKeyRef:
  149. description: Selects a key of a ConfigMap.
  150. properties:
  151. key:
  152. description: The key to select.
  153. type: string
  154. name:
  155. default: ""
  156. description: |-
  157. Name of the referent.
  158. This field is effectively required, but due to backwards compatibility is
  159. allowed to be empty. Instances of this type with an empty value here are
  160. almost certainly wrong.
  161. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  162. type: string
  163. optional:
  164. description: Specify whether the ConfigMap or its
  165. key must be defined
  166. type: boolean
  167. required:
  168. - key
  169. type: object
  170. x-kubernetes-map-type: atomic
  171. fieldRef:
  172. description: |-
  173. Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['<KEY>']`, `metadata.annotations['<KEY>']`,
  174. spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs.
  175. properties:
  176. apiVersion:
  177. description: Version of the schema the FieldPath
  178. is written in terms of, defaults to "v1".
  179. type: string
  180. fieldPath:
  181. description: Path of the field to select in the
  182. specified API version.
  183. type: string
  184. required:
  185. - fieldPath
  186. type: object
  187. x-kubernetes-map-type: atomic
  188. resourceFieldRef:
  189. description: |-
  190. Selects a resource of the container: only resources limits and requests
  191. (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
  192. properties:
  193. containerName:
  194. description: 'Container name: required for volumes,
  195. optional for env vars'
  196. type: string
  197. divisor:
  198. anyOf:
  199. - type: integer
  200. - type: string
  201. description: Specifies the output format of the
  202. exposed resources, defaults to "1"
  203. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
  204. x-kubernetes-int-or-string: true
  205. resource:
  206. description: 'Required: resource to select'
  207. type: string
  208. required:
  209. - resource
  210. type: object
  211. x-kubernetes-map-type: atomic
  212. secretKeyRef:
  213. description: Selects a key of a secret in the pod's
  214. namespace
  215. properties:
  216. key:
  217. description: The key of the secret to select from. Must
  218. be a valid secret key.
  219. type: string
  220. name:
  221. default: ""
  222. description: |-
  223. Name of the referent.
  224. This field is effectively required, but due to backwards compatibility is
  225. allowed to be empty. Instances of this type with an empty value here are
  226. almost certainly wrong.
  227. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  228. type: string
  229. optional:
  230. description: Specify whether the Secret or its key
  231. must be defined
  232. type: boolean
  233. required:
  234. - key
  235. type: object
  236. x-kubernetes-map-type: atomic
  237. type: object
  238. required:
  239. - name
  240. - valueFrom
  241. type: object
  242. type: array
  243. type: object
  244. category:
  245. description: |-
  246. category is the model category: language, embedding, or reranker.
  247. Determines which gateway endpoint clients use and the routing mode in the proxy config.
  248. enum:
  249. - language
  250. - embedding
  251. - reranker
  252. type: string
  253. defaultInferenceParams:
  254. description: |-
  255. inference holds per-model inference defaults baked into the gateway's proxy config
  256. entry for this model. Applied to every request unless the client overrides them.
  257. properties:
  258. extra:
  259. additionalProperties:
  260. type: string
  261. description: |-
  262. extra are pass-through key-value pairs forwarded as provider-specific parameters
  263. to the gateway when the model is gateway-bound.
  264. type: object
  265. maxTokens:
  266. description: maxTokens is the maximum number of tokens to generate
  267. for language models.
  268. format: int32
  269. type: integer
  270. temperature:
  271. description: temperature is the sampling temperature for language
  272. models.
  273. type: string
  274. topP:
  275. description: topP is the nucleus sampling parameter for language
  276. models.
  277. type: string
  278. type: object
  279. extraParams:
  280. additionalProperties:
  281. type: string
  282. description: |-
  283. extraParams are pass-through provider-specific parameters forwarded to the gateway
  284. proxy config (e.g. aws_region_name, vertex_project, vertex_location).
  285. type: object
  286. modelName:
  287. description: |-
  288. modelName is the identifier exposed to clients and used as the model identifier
  289. in the gateway's proxy configuration.
  290. type: string
  291. provider:
  292. description: provider identifies the upstream provider (e.g. openai,
  293. anthropic).
  294. type: string
  295. providerModel:
  296. description: providerModel is the provider-side model id (e.g. gpt-4o-2024-11-20).
  297. type: string
  298. stackRef:
  299. description: stackRef associates this model with a stack.
  300. properties:
  301. name:
  302. default: ""
  303. description: |-
  304. Name of the referent.
  305. This field is effectively required, but due to backwards compatibility is
  306. allowed to be empty. Instances of this type with an empty value here are
  307. almost certainly wrong.
  308. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  309. type: string
  310. type: object
  311. x-kubernetes-map-type: atomic
  312. required:
  313. - category
  314. - modelName
  315. - provider
  316. - providerModel
  317. type: object
  318. status:
  319. description: status defines the observed state of ExternalModel
  320. properties:
  321. conditions:
  322. description: |-
  323. conditions represent the current state of the ExternalModel resource.
  324. Each condition has a unique type and reflects the status of a specific aspect of the resource.
  325. Standard condition types include:
  326. - "Available": the resource is fully functional
  327. - "Progressing": the resource is being created or updated
  328. - "Degraded": the resource failed to reach or maintain its desired state
  329. The status of each condition is one of True, False, or Unknown.
  330. items:
  331. description: Condition contains details for one aspect of the current
  332. state of this API Resource.
  333. properties:
  334. lastTransitionTime:
  335. description: |-
  336. lastTransitionTime is the last time the condition transitioned from one status to another.
  337. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  338. format: date-time
  339. type: string
  340. message:
  341. description: |-
  342. message is a human readable message indicating details about the transition.
  343. This may be an empty string.
  344. maxLength: 32768
  345. type: string
  346. observedGeneration:
  347. description: |-
  348. observedGeneration represents the .metadata.generation that the condition was set based upon.
  349. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
  350. with respect to the current state of the instance.
  351. format: int64
  352. minimum: 0
  353. type: integer
  354. reason:
  355. description: |-
  356. reason contains a programmatic identifier indicating the reason for the condition's last transition.
  357. Producers of specific condition types may define expected values and meanings for this field,
  358. and whether the values are considered a guaranteed API.
  359. The value should be a CamelCase string.
  360. This field may not be empty.
  361. maxLength: 1024
  362. minLength: 1
  363. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  364. type: string
  365. status:
  366. description: status of the condition, one of True, False, Unknown.
  367. enum:
  368. - "True"
  369. - "False"
  370. - Unknown
  371. type: string
  372. type:
  373. description: type of condition in CamelCase or in foo.example.com/CamelCase.
  374. maxLength: 316
  375. 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])$
  376. type: string
  377. required:
  378. - lastTransitionTime
  379. - message
  380. - reason
  381. - status
  382. - type
  383. type: object
  384. type: array
  385. x-kubernetes-list-map-keys:
  386. - type
  387. x-kubernetes-list-type: map
  388. observedGeneration:
  389. description: observedGeneration is the .metadata.generation last reconciled.
  390. format: int64
  391. type: integer
  392. type: object
  393. required:
  394. - spec
  395. type: object
  396. served: true
  397. storage: true
  398. subresources:
  399. status: {}