locostack.com_externalmodels.yaml 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438
  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. fileKeyRef:
  189. description: |-
  190. FileKeyRef selects a key of the env file.
  191. Requires the EnvFiles feature gate to be enabled.
  192. properties:
  193. key:
  194. description: |-
  195. The key within the env file. An invalid key will prevent the pod from starting.
  196. The keys defined within a source may consist of any printable ASCII characters except '='.
  197. During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters.
  198. type: string
  199. optional:
  200. default: false
  201. description: |-
  202. Specify whether the file or its key must be defined. If the file or key
  203. does not exist, then the env var is not published.
  204. If optional is set to true and the specified key does not exist,
  205. the environment variable will not be set in the Pod's containers.
  206. If optional is set to false and the specified key does not exist,
  207. an error will be returned during Pod creation.
  208. type: boolean
  209. path:
  210. description: |-
  211. The path within the volume from which to select the file.
  212. Must be relative and may not contain the '..' path or start with '..'.
  213. type: string
  214. volumeName:
  215. description: The name of the volume mount containing
  216. the env file.
  217. type: string
  218. required:
  219. - key
  220. - path
  221. - volumeName
  222. type: object
  223. x-kubernetes-map-type: atomic
  224. resourceFieldRef:
  225. description: |-
  226. Selects a resource of the container: only resources limits and requests
  227. (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported.
  228. properties:
  229. containerName:
  230. description: 'Container name: required for volumes,
  231. optional for env vars'
  232. type: string
  233. divisor:
  234. anyOf:
  235. - type: integer
  236. - type: string
  237. description: Specifies the output format of the
  238. exposed resources, defaults to "1"
  239. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
  240. x-kubernetes-int-or-string: true
  241. resource:
  242. description: 'Required: resource to select'
  243. type: string
  244. required:
  245. - resource
  246. type: object
  247. x-kubernetes-map-type: atomic
  248. secretKeyRef:
  249. description: Selects a key of a secret in the pod's
  250. namespace
  251. properties:
  252. key:
  253. description: The key of the secret to select from. Must
  254. be a valid secret key.
  255. type: string
  256. name:
  257. default: ""
  258. description: |-
  259. Name of the referent.
  260. This field is effectively required, but due to backwards compatibility is
  261. allowed to be empty. Instances of this type with an empty value here are
  262. almost certainly wrong.
  263. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  264. type: string
  265. optional:
  266. description: Specify whether the Secret or its key
  267. must be defined
  268. type: boolean
  269. required:
  270. - key
  271. type: object
  272. x-kubernetes-map-type: atomic
  273. type: object
  274. required:
  275. - name
  276. - valueFrom
  277. type: object
  278. type: array
  279. type: object
  280. category:
  281. description: |-
  282. category is the model category: language, embedding, or reranker.
  283. Determines which gateway endpoint clients use and the routing mode in the proxy config.
  284. enum:
  285. - language
  286. - embedding
  287. - reranker
  288. type: string
  289. defaultInferenceParams:
  290. description: |-
  291. inference holds per-model inference defaults baked into the gateway's proxy config
  292. entry for this model. Applied to every request unless the client overrides them.
  293. properties:
  294. extra:
  295. additionalProperties:
  296. type: string
  297. description: |-
  298. extra are pass-through key-value pairs forwarded as provider-specific parameters
  299. to the gateway when the model is gateway-bound.
  300. type: object
  301. maxTokens:
  302. description: maxTokens is the maximum number of tokens to generate
  303. for language models.
  304. format: int32
  305. type: integer
  306. temperature:
  307. description: temperature is the sampling temperature for language
  308. models.
  309. type: string
  310. topP:
  311. description: topP is the nucleus sampling parameter for language
  312. models.
  313. type: string
  314. type: object
  315. extraParams:
  316. additionalProperties:
  317. type: string
  318. description: |-
  319. extraParams are pass-through provider-specific parameters forwarded to the gateway
  320. proxy config (e.g. aws_region_name, vertex_project, vertex_location).
  321. type: object
  322. modelName:
  323. description: |-
  324. modelName is the identifier exposed to clients and used as the model identifier
  325. in the gateway's proxy configuration.
  326. type: string
  327. provider:
  328. description: provider identifies the upstream provider (e.g. openai,
  329. anthropic).
  330. type: string
  331. providerModel:
  332. description: providerModel is the provider-side model id (e.g. gpt-4o-2024-11-20).
  333. type: string
  334. stackRef:
  335. description: stackRef associates this model with a stack.
  336. properties:
  337. name:
  338. default: ""
  339. description: |-
  340. Name of the referent.
  341. This field is effectively required, but due to backwards compatibility is
  342. allowed to be empty. Instances of this type with an empty value here are
  343. almost certainly wrong.
  344. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
  345. type: string
  346. type: object
  347. x-kubernetes-map-type: atomic
  348. required:
  349. - category
  350. - modelName
  351. - provider
  352. - providerModel
  353. type: object
  354. status:
  355. description: status defines the observed state of ExternalModel
  356. properties:
  357. conditions:
  358. description: |-
  359. conditions represent the current state of the ExternalModel resource.
  360. Each condition has a unique type and reflects the status of a specific aspect of the resource.
  361. Standard condition types include:
  362. - "Available": the resource is fully functional
  363. - "Progressing": the resource is being created or updated
  364. - "Degraded": the resource failed to reach or maintain its desired state
  365. The status of each condition is one of True, False, or Unknown.
  366. items:
  367. description: Condition contains details for one aspect of the current
  368. state of this API Resource.
  369. properties:
  370. lastTransitionTime:
  371. description: |-
  372. lastTransitionTime is the last time the condition transitioned from one status to another.
  373. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
  374. format: date-time
  375. type: string
  376. message:
  377. description: |-
  378. message is a human readable message indicating details about the transition.
  379. This may be an empty string.
  380. maxLength: 32768
  381. type: string
  382. observedGeneration:
  383. description: |-
  384. observedGeneration represents the .metadata.generation that the condition was set based upon.
  385. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
  386. with respect to the current state of the instance.
  387. format: int64
  388. minimum: 0
  389. type: integer
  390. reason:
  391. description: |-
  392. reason contains a programmatic identifier indicating the reason for the condition's last transition.
  393. Producers of specific condition types may define expected values and meanings for this field,
  394. and whether the values are considered a guaranteed API.
  395. The value should be a CamelCase string.
  396. This field may not be empty.
  397. maxLength: 1024
  398. minLength: 1
  399. pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
  400. type: string
  401. status:
  402. description: status of the condition, one of True, False, Unknown.
  403. enum:
  404. - "True"
  405. - "False"
  406. - Unknown
  407. type: string
  408. type:
  409. description: type of condition in CamelCase or in foo.example.com/CamelCase.
  410. maxLength: 316
  411. 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])$
  412. type: string
  413. required:
  414. - lastTransitionTime
  415. - message
  416. - reason
  417. - status
  418. - type
  419. type: object
  420. type: array
  421. x-kubernetes-list-map-keys:
  422. - type
  423. x-kubernetes-list-type: map
  424. observedGeneration:
  425. description: observedGeneration is the .metadata.generation last reconciled.
  426. format: int64
  427. type: integer
  428. type: object
  429. required:
  430. - spec
  431. type: object
  432. served: true
  433. storage: true
  434. subresources:
  435. status: {}