-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel.cue
More file actions
306 lines (281 loc) · 9.31 KB
/
model.cue
File metadata and controls
306 lines (281 loc) · 9.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
package model
// ============================================================
// Section 1: Shared param definitions
// ============================================================
#ModelParam: {
defaultValue?: string | number | bool | null
key: #ModelParamKey
maxValue?: number
minValue?: number
type?: #ModelParamType
}
#ModelParamKey:
"json_schema" |
"max_completion_tokens" |
"max_tokens" |
"min_tokens" |
"n" |
"parallel_tool_calls" |
"reasoning" |
"reasoning_effort" |
"response_format" |
"seed" |
"stop" |
"stream" |
"temperature" |
"thinking" |
"tool_choice" |
"top_k" |
"top_p" |
"verbosity"
#ModelParamType:
"array-of-strings" |
"boolean" |
"json" |
"number" |
"string"
// ============================================================
// Section 2: Default provider config
// ============================================================
// Schema for default.yaml files (provider-level defaults)
#DefaultConfig: {
// Official documentation links for models, pricing, and deprecations
documentation?: [...string]
// Message types supported
messages?: #MessageConfig
// Configurable parameters with defaults
params?: [...#ModelParam]
}
// ============================================================
// Section 3: Model config definitions
// ============================================================
// AWS region identifiers
#AWSRegion:
"af-south-1" |
"ap-east-1" |
"ap-east-2" |
"ap-northeast-1" |
"ap-northeast-2" |
"ap-northeast-3" |
"ap-south-1" |
"ap-south-2" |
"ap-southeast-1" |
"ap-southeast-2" |
"ap-southeast-3" |
"ap-southeast-4" |
"ap-southeast-5" |
"ap-southeast-6" |
"ap-southeast-7" |
"ca-central-1" |
"ca-west-1" |
"cn-north-1" |
"cn-northwest-1" |
"eu-central-1" |
"eu-central-2" |
"eu-north-1" |
"eu-south-1" |
"eu-south-2" |
"eu-west-1" |
"eu-west-2" |
"eu-west-3" |
"il-central-1" |
"me-central-1" |
"me-south-1" |
"mx-central-1" |
"sa-east-1" |
"us-east-1" |
"us-east-2" |
"us-gov-east-1" |
"us-gov-west-1" |
"us-west-1" |
"us-west-2"
#AzureRegion:
"datazone_eu" |
"datazone_us" |
"global"
#Cost: {
cache_creation_input_audio_token_cost?: number & >= 0
cache_creation_input_token_cost?: number & >= 0
cache_read_input_audio_token_cost?: number & >= 0
cache_read_input_token_cost?: number & >= 0
cache_storage_cost_per_token_per_hour?: number & >= 0
input_cost_per_annotated_page?: number & >= 0
input_cost_per_audio_token?: number & >= 0
input_cost_per_character?: number & >= 0
input_cost_per_image?: number & >= 0
input_cost_per_image_token?: number & >= 0
input_cost_per_page?: number & >= 0
input_cost_per_query?: number & >= 0
input_cost_per_request?: number & >= 0
input_cost_per_second?: number & >= 0
input_cost_per_token?: number & >= 0
input_cost_per_token_batches?: number & >= 0
input_cost_per_video_token?: number & >= 0
output_cost_per_audio_token?: number & >= 0
output_cost_per_image?: number & >= 0
output_cost_per_image_token?: number & >= 0
output_cost_per_second?: number & >= 0
output_cost_per_token?: number & >= 0
output_cost_per_token_batches?: number & >= 0
output_cost_per_video_token?: number & >= 0
tiered_pricing?: #TieredPricing
// Resolution-based image pricing: matches fields like output_cost_per_image_1k, output_cost_per_image_4k, etc.
[=~"^output_cost_per_image_\\d+[pk]$"]: number & >= 0
// Resolution-based video pricing: matches fields like output_cost_per_second_480p, output_cost_per_second_4k, etc.
[=~"^output_cost_per_second_\\d+[pk]$"]: number & >= 0
}
// Pricing entry; "*" applies to all regions
#CostWithRegion: {
region: "*" | #AWSRegion | #GCPRegion | #AzureRegion
#Cost
}
// Supported feature flags a model can declare
#Feature:
"assistant_prefill" | // Caller can seed the assistant turn to guide the response
"cache_control" | // Caller can apply fine-grained cache breakpoints on content blocks
"code_execution" | // Model can execute code natively as part of its response
"function_calling" | // Model supports tool/function calling
"json_output" | // Model can return output in JSON format
"parallel_function_calling" | // Model can invoke multiple tools in a single turn
"prompt_caching" | // Provider caches repeated prompt prefixes to reduce cost and latency
"structured_output" | // Model can return output conforming to a JSON schema
"system_messages" | // Model accepts a system prompt
"tool_choice" // Caller can force or restrict which tool the model uses
// GCP region identifiers
#GCPRegion:
"asia-east1" |
"asia-east2" |
"asia-northeast1" |
"asia-northeast2" |
"asia-northeast3" |
"asia-south1" |
"asia-south2" |
"asia-southeast1" |
"asia-southeast2" |
"australia-southeast1" |
"australia-southeast2" |
"europe-central2" |
"europe-north1" |
"europe-southwest1" |
"europe-west1" |
"europe-west2" |
"europe-west3" |
"europe-west4" |
"europe-west6" |
"europe-west8" |
"europe-west9" |
"global" |
"me-central1" |
"me-central2" |
"me-west1" |
"northamerica-northeast1" |
"northamerica-northeast2" |
"southamerica-east1" |
"us-central1" |
"us-east1" |
"us-east4" |
"us-east5" |
"us-south1" |
"us-west1" |
"us-west2" |
"us-west3" |
"us-west4"
#Limits: {
context_window?: int & >= 0 // Maximum number of tokens the model can hold in its context at once
max_input_tokens?: int & >= 0 // Maximum tokens allowed in the input/prompt
max_output_tokens?: int & >= 0 // Maximum tokens the model can produce in the output
max_query_tokens?: int & >= 0 // Maximum tokens for the query in embedding/rerank requests
max_tokens?: int & >= 0 // Maximum tokens the model can generate in a response
output_vector_size?: int & >= 0 // Dimensionality of the embedding vector produced
tool_use_system_prompt_tokens?: int & >= 0 // Tokens consumed by the built-in system prompt when tools are enabled
}
// Message role values supported by a model or provider
#MessageOption: "assistant" | "developer" | "system" | "user"
#MessageConfig: {
options?: [...#MessageOption]
}
// Input/output modality types
#Modality:
"audio" | // Audio streams or files
"code" | // Source code files or snippets
"doc" | // Office/word-processor documents
"embedding" | // Dense vector embeddings
"image" | // Raster or vector images
"pdf" | // PDF documents
"text" | // Plain or structured text
"video" // Video streams or files
#Modalities: {
input?: [...#Modality]
output?: [...#Modality]
}
// Canonical mode values for a model
#Mode:
"audio_transcription" |
"audio_translation" |
"chat" |
"completion" |
"embedding" |
"image" |
"moderation" |
"realtime" |
"rerank" |
"responses" |
"text_to_speech" |
"unknown" |
"video"
#ModelConfig: {
// Pricing entries per region; use "*" for global/uniform pricing
costs?: [...#CostWithRegion]
// Date after which the model is considered deprecated (YYYY-MM-DD)
deprecationDate?: string & =~"^\\d{4}-\\d{2}-\\d{2}$"
// Feature flags for capabilities like function calling, prompt caching, etc.
features?: [...#Feature]
// Whether the model is deprecated
isDeprecated?: bool
// Token and context window limits
limits?: #Limits
// Message roles accepted by this model
messages?: #MessageConfig
// Input/output modality support (e.g. text, image, audio)
modalities?: #Modalities
// Required: Canonical mode describing the model's primary capability
mode: #Mode
// Required: Model identifier used by the provider's API
model: string
// Param overrides or additions relative to the provider default
params?: [...#ModelParam]
// How the model is made available: serverless API or dedicated/deployed capacity
provisioning?: #Provisioning
// Param keys to remove from the provider default
removeParams?: [...#ModelParamKey]
// Param keys that must always be provided by callers
requiredParams?: [...#ModelParamKey]
// Documentation or pricing source URLs
sources?: [...string]
// Lifecycle status of the model
status?: #Status
// Additional modes this model can be accessed through beyond its primary mode
supportedModes?: [...#Mode]
// Whether the model supports extended thinking / reasoning
thinking?: bool
}
#PricingTier: {
cost_per_token: number & >= 0
from: int & >= 0
}
// How the model is made available to callers
#Provisioning:
"serverless" | // Managed API, pay-per-token/request
"provisioned" // Dedicated capacity or user-deployed instance
// Lifecycle status of a model
#Status:
"active" | // Model is fully supported and recommended for use (aka stable, ga)
"deprecated" | // Model is deprecated and may be removed in the future (aka sunset, end-of-life)
"preview" | // Model is in early access and may change or have limited support (aka beta, experimental)
"retired" // Model has been fully removed and is no longer accessible (aka removed, deleted)
#TieredPricing: {
cache_read?: [...#PricingTier]
cache_write?: [...#PricingTier]
input?: [...#PricingTier]
output?: [...#PricingTier]
}