retab 0.0.35__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. retab-0.0.35.dist-info/METADATA +417 -0
  2. retab-0.0.35.dist-info/RECORD +111 -0
  3. retab-0.0.35.dist-info/WHEEL +5 -0
  4. retab-0.0.35.dist-info/top_level.txt +1 -0
  5. uiform/__init__.py +4 -0
  6. uiform/_resource.py +28 -0
  7. uiform/_utils/__init__.py +0 -0
  8. uiform/_utils/ai_models.py +100 -0
  9. uiform/_utils/benchmarking copy.py +588 -0
  10. uiform/_utils/benchmarking.py +485 -0
  11. uiform/_utils/chat.py +332 -0
  12. uiform/_utils/display.py +443 -0
  13. uiform/_utils/json_schema.py +2161 -0
  14. uiform/_utils/mime.py +168 -0
  15. uiform/_utils/responses.py +163 -0
  16. uiform/_utils/stream_context_managers.py +52 -0
  17. uiform/_utils/usage/__init__.py +0 -0
  18. uiform/_utils/usage/usage.py +300 -0
  19. uiform/client.py +701 -0
  20. uiform/py.typed +0 -0
  21. uiform/resources/__init__.py +0 -0
  22. uiform/resources/consensus/__init__.py +3 -0
  23. uiform/resources/consensus/client.py +114 -0
  24. uiform/resources/consensus/completions.py +252 -0
  25. uiform/resources/consensus/completions_stream.py +278 -0
  26. uiform/resources/consensus/responses.py +325 -0
  27. uiform/resources/consensus/responses_stream.py +373 -0
  28. uiform/resources/deployments/__init__.py +9 -0
  29. uiform/resources/deployments/client.py +78 -0
  30. uiform/resources/deployments/endpoints.py +322 -0
  31. uiform/resources/deployments/links.py +452 -0
  32. uiform/resources/deployments/logs.py +211 -0
  33. uiform/resources/deployments/mailboxes.py +496 -0
  34. uiform/resources/deployments/outlook.py +531 -0
  35. uiform/resources/deployments/tests.py +158 -0
  36. uiform/resources/documents/__init__.py +3 -0
  37. uiform/resources/documents/client.py +255 -0
  38. uiform/resources/documents/extractions.py +441 -0
  39. uiform/resources/evals.py +812 -0
  40. uiform/resources/files.py +24 -0
  41. uiform/resources/finetuning.py +62 -0
  42. uiform/resources/jsonlUtils.py +1046 -0
  43. uiform/resources/models.py +45 -0
  44. uiform/resources/openai_example.py +22 -0
  45. uiform/resources/processors/__init__.py +3 -0
  46. uiform/resources/processors/automations/__init__.py +9 -0
  47. uiform/resources/processors/automations/client.py +78 -0
  48. uiform/resources/processors/automations/endpoints.py +317 -0
  49. uiform/resources/processors/automations/links.py +356 -0
  50. uiform/resources/processors/automations/logs.py +211 -0
  51. uiform/resources/processors/automations/mailboxes.py +435 -0
  52. uiform/resources/processors/automations/outlook.py +444 -0
  53. uiform/resources/processors/automations/tests.py +158 -0
  54. uiform/resources/processors/client.py +474 -0
  55. uiform/resources/prompt_optimization.py +76 -0
  56. uiform/resources/schemas.py +369 -0
  57. uiform/resources/secrets/__init__.py +9 -0
  58. uiform/resources/secrets/client.py +20 -0
  59. uiform/resources/secrets/external_api_keys.py +109 -0
  60. uiform/resources/secrets/webhook.py +62 -0
  61. uiform/resources/usage.py +271 -0
  62. uiform/types/__init__.py +0 -0
  63. uiform/types/ai_models.py +645 -0
  64. uiform/types/automations/__init__.py +0 -0
  65. uiform/types/automations/cron.py +58 -0
  66. uiform/types/automations/endpoints.py +21 -0
  67. uiform/types/automations/links.py +28 -0
  68. uiform/types/automations/mailboxes.py +60 -0
  69. uiform/types/automations/outlook.py +68 -0
  70. uiform/types/automations/webhooks.py +21 -0
  71. uiform/types/chat.py +8 -0
  72. uiform/types/completions.py +93 -0
  73. uiform/types/consensus.py +10 -0
  74. uiform/types/db/__init__.py +0 -0
  75. uiform/types/db/annotations.py +24 -0
  76. uiform/types/db/files.py +36 -0
  77. uiform/types/deployments/__init__.py +0 -0
  78. uiform/types/deployments/cron.py +59 -0
  79. uiform/types/deployments/endpoints.py +28 -0
  80. uiform/types/deployments/links.py +36 -0
  81. uiform/types/deployments/mailboxes.py +67 -0
  82. uiform/types/deployments/outlook.py +76 -0
  83. uiform/types/deployments/webhooks.py +21 -0
  84. uiform/types/documents/__init__.py +0 -0
  85. uiform/types/documents/correct_orientation.py +13 -0
  86. uiform/types/documents/create_messages.py +226 -0
  87. uiform/types/documents/extractions.py +297 -0
  88. uiform/types/evals.py +207 -0
  89. uiform/types/events.py +76 -0
  90. uiform/types/extractions.py +85 -0
  91. uiform/types/jobs/__init__.py +0 -0
  92. uiform/types/jobs/base.py +150 -0
  93. uiform/types/jobs/batch_annotation.py +22 -0
  94. uiform/types/jobs/evaluation.py +133 -0
  95. uiform/types/jobs/finetune.py +6 -0
  96. uiform/types/jobs/prompt_optimization.py +41 -0
  97. uiform/types/jobs/webcrawl.py +6 -0
  98. uiform/types/logs.py +231 -0
  99. uiform/types/mime.py +257 -0
  100. uiform/types/modalities.py +68 -0
  101. uiform/types/pagination.py +6 -0
  102. uiform/types/schemas/__init__.py +0 -0
  103. uiform/types/schemas/enhance.py +53 -0
  104. uiform/types/schemas/evaluate.py +55 -0
  105. uiform/types/schemas/generate.py +32 -0
  106. uiform/types/schemas/layout.py +58 -0
  107. uiform/types/schemas/object.py +631 -0
  108. uiform/types/schemas/templates.py +107 -0
  109. uiform/types/secrets/__init__.py +0 -0
  110. uiform/types/secrets/external_api_keys.py +22 -0
  111. uiform/types/standards.py +39 -0
@@ -0,0 +1,645 @@
1
+ from typing import Literal
2
+
3
+ AIProvider = Literal["OpenAI", "Gemini", "xAI", "UiForm"] # , "Anthropic", "xAI"]
4
+ OpenAICompatibleProvider = Literal["OpenAI", "xAI"] # , "xAI"]
5
+ GeminiModel = Literal[
6
+ "gemini-2.5-pro-preview-05-06",
7
+ "gemini-2.5-flash-preview-05-20",
8
+ "gemini-2.5-flash-preview-04-17",
9
+ "gemini-2.5-pro-exp-03-25",
10
+ "gemini-2.0-flash-lite",
11
+ "gemini-2.0-flash",
12
+ ]
13
+
14
+ AnthropicModel = Literal[
15
+ "claude-3-5-sonnet-latest", "claude-3-5-sonnet-20241022", "claude-3-5-haiku-20241022", "claude-3-opus-20240229", "claude-3-sonnet-20240229", "claude-3-haiku-20240307"
16
+ ]
17
+ OpenAIModel = Literal[
18
+ "gpt-4o",
19
+ "gpt-4o-mini",
20
+ "chatgpt-4o-latest",
21
+ "gpt-4.1",
22
+ "gpt-4.1-mini",
23
+ "gpt-4.1-nano",
24
+ "gpt-4o-2024-11-20",
25
+ "gpt-4o-2024-08-06",
26
+ "gpt-4o-2024-05-13",
27
+ "gpt-4o-mini-2024-07-18",
28
+ "o3-mini",
29
+ "o3-mini-2025-01-31",
30
+ "o1",
31
+ "o1-2024-12-17",
32
+ "o1-preview-2024-09-12",
33
+ "o1-mini",
34
+ "o1-mini-2024-09-12",
35
+ "o3",
36
+ "o3-2025-04-16",
37
+ "o4-mini",
38
+ "o4-mini-2025-04-16",
39
+ "gpt-4.5-preview",
40
+ "gpt-4.5-preview-2025-02-27",
41
+ "gpt-4o-audio-preview-2024-12-17",
42
+ "gpt-4o-audio-preview-2024-10-01",
43
+ "gpt-4o-realtime-preview-2024-12-17",
44
+ "gpt-4o-realtime-preview-2024-10-01",
45
+ "gpt-4o-mini-audio-preview-2024-12-17",
46
+ "gpt-4o-mini-realtime-preview-2024-12-17",
47
+ ]
48
+ xAI_Model = Literal["grok-3-beta", "grok-3-mini-beta"]
49
+ UiFormModel = Literal["auto", "auto-small"]
50
+ LLMModel = Literal[OpenAIModel, "human", AnthropicModel, xAI_Model, GeminiModel, UiFormModel]
51
+
52
+ import datetime
53
+
54
+ from pydantic import BaseModel, Field
55
+
56
+ from uiform.types.jobs.base import InferenceSettings
57
+
58
+
59
+ class FinetunedModel(BaseModel):
60
+ object: Literal["finetuned_model"] = "finetuned_model"
61
+ organization_id: str
62
+ model: str
63
+ schema_id: str
64
+ schema_data_id: str
65
+ finetuning_props: InferenceSettings
66
+ evaluation_id: str | None = None
67
+ created_at: datetime.datetime = Field(default_factory=lambda: datetime.datetime.now(datetime.timezone.utc))
68
+
69
+
70
+ from typing import Dict, List, Literal, Optional
71
+
72
+ from pydantic import BaseModel
73
+
74
+
75
+ # Monthly Usage
76
+ class MonthlyUsageResponseContent(BaseModel):
77
+ request_count: int
78
+
79
+
80
+ MonthlyUsageResponse = MonthlyUsageResponseContent
81
+
82
+
83
+ class Amount(BaseModel):
84
+ value: float
85
+ currency: str
86
+
87
+
88
+ class TokenPrice(BaseModel):
89
+ """
90
+ Holds pricing information (price per 1M tokens) for one token category.
91
+ (For example, for text tokens used in the prompt.)
92
+ """
93
+
94
+ prompt: float # Price per 1M prompt tokens.
95
+ completion: float # Price per 1M completion tokens.
96
+ cached_discount: float = 0.5 # Price discount for cached tokens.
97
+
98
+
99
+ class Pricing(BaseModel):
100
+ """
101
+ Contains all pricing information that is useful for a given model.
102
+ (For example, the grid below shows that for gpt-4o-2024-08-06 text prompt tokens
103
+ cost $2.50 per 1M tokens while completion tokens cost $10.00 per 1M tokens.)
104
+ """
105
+
106
+ text: TokenPrice
107
+ audio: Optional[TokenPrice] = None # May be None if the model does not support audio tokens.
108
+ ft_price_hike: float = 1.0 # Price hike for fine-tuned models.
109
+
110
+
111
+ # Fix the type definition - use proper Python syntax
112
+ ModelModality = Literal["text", "audio", "image"]
113
+
114
+ # Define supported endpoints
115
+ EndpointType = Literal[
116
+ "chat_completions",
117
+ "responses",
118
+ "assistants",
119
+ "batch",
120
+ "fine_tuning",
121
+ "embeddings",
122
+ "speech_generation",
123
+ "translation",
124
+ "completions_legacy",
125
+ "image_generation",
126
+ "transcription",
127
+ "moderation",
128
+ "realtime",
129
+ ]
130
+
131
+ # Define supported features
132
+ FeatureType = Literal["streaming", "function_calling", "structured_outputs", "distillation", "fine_tuning", "predicted_outputs"]
133
+
134
+
135
+ class ModelCapabilities(BaseModel):
136
+ """
137
+ Represents the capabilities of an AI model, including supported modalities,
138
+ endpoints, and features.
139
+ """
140
+
141
+ modalities: List[ModelModality]
142
+ endpoints: List[EndpointType]
143
+ features: List[FeatureType]
144
+
145
+
146
+ class ModelCard(BaseModel):
147
+ """
148
+ Model card that includes pricing and capabilities.
149
+ """
150
+
151
+ model: LLMModel | str # Can be a random string for finetuned models
152
+ pricing: Pricing
153
+ capabilities: ModelCapabilities
154
+ temperature_support: bool = True
155
+ reasoning_effort_support: bool = False
156
+
157
+
158
+ # List of model cards with pricing and capabilities
159
+ openai_model_cards = [
160
+ ########################
161
+ ########################
162
+ # ----------------------
163
+ # Reasoning models
164
+ # ----------------------
165
+ ########################
166
+ ########################
167
+ # ----------------------
168
+ # o1 family
169
+ # ----------------------
170
+ ModelCard(
171
+ model="o1",
172
+ pricing=Pricing(text=TokenPrice(prompt=15.00, cached_discount=0.5, completion=60.00), audio=None),
173
+ capabilities=ModelCapabilities(
174
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
175
+ ),
176
+ temperature_support=False,
177
+ reasoning_effort_support=True,
178
+ ),
179
+ ModelCard(
180
+ model="o1-2024-12-17",
181
+ pricing=Pricing(text=TokenPrice(prompt=15.00, cached_discount=0.5, completion=60.00), audio=None),
182
+ capabilities=ModelCapabilities(
183
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
184
+ ),
185
+ temperature_support=False,
186
+ reasoning_effort_support=True,
187
+ ),
188
+ ModelCard(
189
+ model="o1-preview-2024-09-12",
190
+ pricing=Pricing(text=TokenPrice(prompt=15.00, cached_discount=0.5, completion=60.00), audio=None),
191
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling"]),
192
+ temperature_support=False,
193
+ reasoning_effort_support=True,
194
+ ),
195
+ # ----------------------
196
+ # o1-mini family
197
+ # ----------------------
198
+ ModelCard(
199
+ model="o1-mini",
200
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.5, completion=4.40), audio=None),
201
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions", "responses", "assistants"], features=["streaming"]),
202
+ temperature_support=False,
203
+ reasoning_effort_support=True,
204
+ ),
205
+ ModelCard(
206
+ model="o1-mini-2024-09-12",
207
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.5, completion=4.40), audio=None),
208
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions", "responses", "assistants"], features=["streaming"]),
209
+ temperature_support=False,
210
+ reasoning_effort_support=True,
211
+ ),
212
+ # ----------------------
213
+ # o3 family
214
+ # ----------------------
215
+ ModelCard(
216
+ model="o3",
217
+ pricing=Pricing(text=TokenPrice(prompt=10.0, cached_discount=2.5 / 10.0, completion=40.0), audio=None, ft_price_hike=1.5),
218
+ capabilities=ModelCapabilities(
219
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
220
+ ),
221
+ temperature_support=False,
222
+ reasoning_effort_support=True,
223
+ ),
224
+ ModelCard(
225
+ model="o3-2025-04-16",
226
+ pricing=Pricing(text=TokenPrice(prompt=10.0, cached_discount=2.5 / 10.0, completion=40.0), audio=None, ft_price_hike=1.5),
227
+ capabilities=ModelCapabilities(
228
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
229
+ ),
230
+ temperature_support=False,
231
+ reasoning_effort_support=True,
232
+ ),
233
+ # ----------------------
234
+ # o3-mini family
235
+ # ----------------------
236
+ ModelCard(
237
+ model="o3-mini-2025-01-31",
238
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.5, completion=4.40), audio=None, ft_price_hike=1.5),
239
+ capabilities=ModelCapabilities(
240
+ modalities=["text"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
241
+ ),
242
+ temperature_support=False,
243
+ reasoning_effort_support=True,
244
+ ),
245
+ ModelCard(
246
+ model="o3-mini",
247
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.5, completion=4.40), audio=None, ft_price_hike=1.5),
248
+ capabilities=ModelCapabilities(
249
+ modalities=["text"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
250
+ ),
251
+ temperature_support=False,
252
+ reasoning_effort_support=True,
253
+ ),
254
+ # ----------------------
255
+ # o4-mini family
256
+ # ----------------------
257
+ ModelCard(
258
+ model="o4-mini",
259
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.275 / 1.1, completion=4.40), audio=None, ft_price_hike=1.5),
260
+ capabilities=ModelCapabilities(
261
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
262
+ ),
263
+ temperature_support=False,
264
+ reasoning_effort_support=True,
265
+ ),
266
+ ModelCard(
267
+ model="o4-mini-2025-04-16",
268
+ pricing=Pricing(text=TokenPrice(prompt=1.10, cached_discount=0.275 / 1.1, completion=4.40), audio=None, ft_price_hike=1.5),
269
+ capabilities=ModelCapabilities(
270
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
271
+ ),
272
+ temperature_support=False,
273
+ reasoning_effort_support=True,
274
+ ),
275
+ ########################
276
+ ########################
277
+ # ----------------------
278
+ # Chat models
279
+ # ----------------------
280
+ ########################
281
+ ########################
282
+ # ----------------------
283
+ # gpt-4.1 family
284
+ # ----------------------
285
+ ModelCard(
286
+ model="gpt-4.1",
287
+ pricing=Pricing(text=TokenPrice(prompt=2.00, cached_discount=0.25, completion=8.00), audio=None, ft_price_hike=1.5),
288
+ capabilities=ModelCapabilities(
289
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
290
+ ),
291
+ temperature_support=True,
292
+ reasoning_effort_support=False,
293
+ ),
294
+ ModelCard(
295
+ model="gpt-4.1-2025-04-14",
296
+ pricing=Pricing(text=TokenPrice(prompt=2.00, cached_discount=0.25, completion=8.00), audio=None, ft_price_hike=1.5),
297
+ capabilities=ModelCapabilities(
298
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
299
+ ),
300
+ temperature_support=True,
301
+ reasoning_effort_support=False,
302
+ ),
303
+ ModelCard(
304
+ model="gpt-4.1-mini",
305
+ pricing=Pricing(text=TokenPrice(prompt=0.40, cached_discount=0.25, completion=1.60), audio=None, ft_price_hike=1.5),
306
+ capabilities=ModelCapabilities(
307
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
308
+ ),
309
+ temperature_support=True,
310
+ reasoning_effort_support=False,
311
+ ),
312
+ ModelCard(
313
+ model="gpt-4.1-mini-2025-04-14",
314
+ pricing=Pricing(text=TokenPrice(prompt=0.40, cached_discount=0.25, completion=1.60), audio=None, ft_price_hike=1.5),
315
+ capabilities=ModelCapabilities(
316
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
317
+ ),
318
+ temperature_support=True,
319
+ reasoning_effort_support=False,
320
+ ),
321
+ ModelCard(
322
+ model="gpt-4.1-nano",
323
+ pricing=Pricing(text=TokenPrice(prompt=0.10, cached_discount=0.25, completion=0.40), audio=None, ft_price_hike=1.5),
324
+ capabilities=ModelCapabilities(
325
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
326
+ ),
327
+ temperature_support=True,
328
+ reasoning_effort_support=False,
329
+ ),
330
+ ModelCard(
331
+ model="gpt-4.1-nano-2025-04-14",
332
+ pricing=Pricing(text=TokenPrice(prompt=0.10, cached_discount=0.25, completion=0.40), audio=None, ft_price_hike=1.5),
333
+ capabilities=ModelCapabilities(
334
+ modalities=["text", "image"], endpoints=["chat_completions", "responses", "assistants", "batch"], features=["streaming", "function_calling", "structured_outputs"]
335
+ ),
336
+ temperature_support=True,
337
+ reasoning_effort_support=False,
338
+ ),
339
+ # ----------------------
340
+ # gpt-4.5 family
341
+ # ----------------------
342
+ # ModelCard(
343
+ # model="gpt-4.5-preview",
344
+ # pricing=Pricing(
345
+ # text=TokenPrice(prompt=75, cached_discount=0.5, completion=150.00),
346
+ # audio=None,
347
+ # ft_price_hike=1.5
348
+ # ),
349
+ # capabilities=ModelCapabilities(
350
+ # modalities=["text", "image"],
351
+ # endpoints=["chat_completions", "responses", "assistants", "batch"],
352
+ # features=["streaming", "function_calling", "structured_outputs"]
353
+ # ),
354
+ # logprobs_support=False,
355
+ # ),
356
+ # ModelCard(
357
+ # model="gpt-4.5-preview-2025-02-27",
358
+ # pricing=Pricing(
359
+ # text=TokenPrice(prompt=75, cached_discount=0.5, completion=150.00),
360
+ # audio=None,
361
+ # ft_price_hike=1.5
362
+ # ),
363
+ # capabilities=ModelCapabilities(
364
+ # modalities=["text", "image"],
365
+ # endpoints=["chat_completions", "responses", "assistants", "batch"],
366
+ # features=["streaming", "function_calling", "structured_outputs"]
367
+ # ),
368
+ # logprobs_support=False,
369
+ # ),
370
+ # ----------------------
371
+ # gpt-4o family
372
+ # ----------------------
373
+ ModelCard(
374
+ model="chatgpt-4o-latest",
375
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=None, ft_price_hike=1.5),
376
+ capabilities=ModelCapabilities(
377
+ modalities=["text", "image"],
378
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
379
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning", "distillation", "predicted_outputs"],
380
+ ),
381
+ ),
382
+ ModelCard(
383
+ model="gpt-4o",
384
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=None, ft_price_hike=1.5),
385
+ capabilities=ModelCapabilities(
386
+ modalities=["text", "image"],
387
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
388
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning", "distillation", "predicted_outputs"],
389
+ ),
390
+ ),
391
+ ModelCard(
392
+ model="gpt-4o-2024-08-06",
393
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=None, ft_price_hike=1.5),
394
+ capabilities=ModelCapabilities(
395
+ modalities=["text", "image"],
396
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
397
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning", "distillation", "predicted_outputs"],
398
+ ),
399
+ ),
400
+ ModelCard(
401
+ model="gpt-4o-2024-11-20",
402
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=None, ft_price_hike=1.5),
403
+ capabilities=ModelCapabilities(
404
+ modalities=["text", "image"],
405
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
406
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning", "distillation", "predicted_outputs"],
407
+ ),
408
+ ),
409
+ ModelCard(
410
+ model="gpt-4o-2024-05-13",
411
+ pricing=Pricing(text=TokenPrice(prompt=5.00, cached_discount=0.5, completion=15.00), audio=None, ft_price_hike=1.5),
412
+ capabilities=ModelCapabilities(
413
+ modalities=["text", "image"],
414
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
415
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning", "distillation", "predicted_outputs"],
416
+ ),
417
+ ),
418
+ # ----------------------
419
+ # gpt-4o-audio family
420
+ # ----------------------
421
+ ModelCard(
422
+ model="gpt-4o-audio-preview-2024-12-17",
423
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=TokenPrice(prompt=40.00, cached_discount=0.2, completion=80.00)),
424
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
425
+ ),
426
+ ModelCard(
427
+ model="gpt-4o-audio-preview-2024-10-01",
428
+ pricing=Pricing(text=TokenPrice(prompt=2.50, cached_discount=0.5, completion=10.00), audio=TokenPrice(prompt=100.00, cached_discount=0.2, completion=200.00)),
429
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
430
+ ),
431
+ ModelCard(
432
+ model="gpt-4o-realtime-preview-2024-12-17",
433
+ pricing=Pricing(text=TokenPrice(prompt=5.00, cached_discount=0.5, completion=20.00), audio=TokenPrice(prompt=40.00, cached_discount=0.2, completion=80.00)),
434
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
435
+ ),
436
+ ModelCard(
437
+ model="gpt-4o-realtime-preview-2024-10-01",
438
+ pricing=Pricing(text=TokenPrice(prompt=5.00, cached_discount=0.5, completion=20.00), audio=TokenPrice(prompt=100.00, cached_discount=0.2, completion=200.00)),
439
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
440
+ ),
441
+ # ----------------------
442
+ # gpt-4o-mini family
443
+ # ----------------------
444
+ ModelCard(
445
+ model="gpt-4o-mini",
446
+ pricing=Pricing(text=TokenPrice(prompt=0.15, cached_discount=0.5, completion=0.60), audio=None, ft_price_hike=2.0),
447
+ capabilities=ModelCapabilities(
448
+ modalities=["text", "image"],
449
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
450
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning"],
451
+ ),
452
+ ),
453
+ ModelCard(
454
+ model="gpt-4o-mini-2024-07-18",
455
+ pricing=Pricing(text=TokenPrice(prompt=0.15, cached_discount=0.5, completion=0.60), audio=None, ft_price_hike=2.0),
456
+ capabilities=ModelCapabilities(
457
+ modalities=["text", "image"],
458
+ endpoints=["chat_completions", "responses", "assistants", "batch", "fine_tuning"],
459
+ features=["streaming", "function_calling", "structured_outputs", "fine_tuning"],
460
+ ),
461
+ ),
462
+ # ----------------------
463
+ # gpt-4o-mini-audio family
464
+ # ----------------------
465
+ ModelCard(
466
+ model="gpt-4o-mini-audio-preview-2024-12-17",
467
+ pricing=Pricing(
468
+ text=TokenPrice(prompt=0.15, cached_discount=0.5, completion=0.60), audio=TokenPrice(prompt=10.00, cached_discount=0.2, completion=20.00), ft_price_hike=2.0
469
+ ),
470
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
471
+ ),
472
+ ModelCard(
473
+ model="gpt-4o-mini-realtime-preview-2024-12-17",
474
+ pricing=Pricing(
475
+ text=TokenPrice(prompt=0.60, cached_discount=0.5, completion=2.40), audio=TokenPrice(prompt=10.00, cached_discount=0.2, completion=20.00), ft_price_hike=2.0
476
+ ),
477
+ capabilities=ModelCapabilities(modalities=["text", "audio"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
478
+ ),
479
+ ]
480
+
481
+ # Anthropic Model Cards
482
+ anthropic_model_cards = [
483
+ ModelCard(
484
+ model="claude-3-5-sonnet-20241022",
485
+ pricing=Pricing(text=TokenPrice(prompt=3.00, cached_discount=0.5, completion=15.00), audio=None),
486
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
487
+ ),
488
+ ModelCard(
489
+ model="claude-3-5-haiku-20241022",
490
+ pricing=Pricing(text=TokenPrice(prompt=0.80, cached_discount=0.5, completion=4.00), audio=None),
491
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
492
+ ),
493
+ ModelCard(
494
+ model="claude-3-opus-20240229",
495
+ pricing=Pricing(text=TokenPrice(prompt=15.00, cached_discount=0.5, completion=75.00), audio=None),
496
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
497
+ ),
498
+ ModelCard(
499
+ model="claude-3-sonnet-20240229",
500
+ pricing=Pricing(text=TokenPrice(prompt=3.00, cached_discount=0.5, completion=15.00), audio=None),
501
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
502
+ ),
503
+ ModelCard(
504
+ model="claude-3-haiku-20240307",
505
+ pricing=Pricing(text=TokenPrice(prompt=0.25, cached_discount=0.5, completion=1.25), audio=None),
506
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
507
+ ),
508
+ ]
509
+
510
+ # xAI model cards
511
+ xai_model_cards = [
512
+ ModelCard(
513
+ model="grok-2-vision-1212",
514
+ pricing=Pricing(text=TokenPrice(prompt=2.00, cached_discount=0.5, completion=10.00), audio=None),
515
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
516
+ ),
517
+ ModelCard(
518
+ model="grok-2-1212",
519
+ pricing=Pricing(text=TokenPrice(prompt=2.00, cached_discount=0.5, completion=10.00), audio=None),
520
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
521
+ ),
522
+ ModelCard(
523
+ model="grok-3-beta",
524
+ pricing=Pricing(text=TokenPrice(prompt=3.00, cached_discount=0.5, completion=15.00), audio=None),
525
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
526
+ ),
527
+ ModelCard(
528
+ model="grok-3-mini-beta",
529
+ pricing=Pricing(text=TokenPrice(prompt=0.30, cached_discount=0.5, completion=0.50), audio=None),
530
+ capabilities=ModelCapabilities(modalities=["text"], endpoints=["chat_completions"], features=["streaming", "function_calling"]),
531
+ ),
532
+ ]
533
+
534
+ # Add Gemini model cards
535
+ gemini_model_cards = [
536
+ # ----------------------
537
+ # gemini-2.5-pro-exp-03-25 family
538
+ # ----------------------
539
+ ModelCard(
540
+ model="gemini-2.5-pro-exp-03-25",
541
+ pricing=Pricing(text=TokenPrice(prompt=1.25, cached_discount=0.25, completion=10.00), audio=None),
542
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
543
+ temperature_support=True,
544
+ ),
545
+ ModelCard(
546
+ model="gemini-2.5-pro-preview-05-06",
547
+ pricing=Pricing(text=TokenPrice(prompt=1.25, cached_discount=0.25, completion=10.00), audio=None),
548
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
549
+ ),
550
+ ModelCard(
551
+ model="gemini-2.5-pro-preview-03-25",
552
+ pricing=Pricing(text=TokenPrice(prompt=1.25, cached_discount=0.25, completion=10.00), audio=None),
553
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
554
+ temperature_support=True,
555
+ ),
556
+ ModelCard(
557
+ model="gemini-2.5-flash-preview-04-17",
558
+ pricing=Pricing(text=TokenPrice(prompt=0.15, cached_discount=0.25, completion=0.60), audio=None),
559
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
560
+ temperature_support=True,
561
+ ),
562
+ ModelCard(
563
+ model="gemini-2.5-flash-preview-05-20",
564
+ pricing=Pricing(text=TokenPrice(prompt=0.15, cached_discount=0.25, completion=0.60), audio=None),
565
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
566
+ temperature_support=True,
567
+ ),
568
+ # ----------------------
569
+ # gemini-2.0-flash family
570
+ # ----------------------
571
+ ModelCard(
572
+ model="gemini-2.0-flash",
573
+ pricing=Pricing(text=TokenPrice(prompt=0.1, cached_discount=0.025 / 0.1, completion=0.40), audio=TokenPrice(prompt=0.7, cached_discount=0.175 / 0.7, completion=1000)),
574
+ capabilities=ModelCapabilities(modalities=["text", "image"], endpoints=["chat_completions"], features=["streaming", "function_calling", "structured_outputs"]),
575
+ temperature_support=True,
576
+ ),
577
+ ModelCard(
578
+ model="gemini-2.0-flash-lite",
579
+ pricing=Pricing(text=TokenPrice(prompt=0.075, cached_discount=1.0, completion=0.30), audio=TokenPrice(prompt=0.075, cached_discount=1.0, completion=1000)),
580
+ capabilities=ModelCapabilities(
581
+ modalities=["text", "image", "audio"],
582
+ endpoints=["chat_completions"],
583
+ features=["streaming", "structured_outputs"],
584
+ ),
585
+ temperature_support=True,
586
+ ),
587
+ ]
588
+
589
+
590
+ model_cards = openai_model_cards + gemini_model_cards + xai_model_cards
591
+ xAI_model_cards = [
592
+ # ----------------------
593
+ # grok3-family
594
+ # ----------------------
595
+ ModelCard(
596
+ model="grok-3-beta",
597
+ pricing=Pricing(text=TokenPrice(prompt=3, cached_discount=1.0, completion=15), audio=None),
598
+ capabilities=ModelCapabilities(
599
+ modalities=["text"],
600
+ endpoints=["chat_completions"],
601
+ features=["streaming", "structured_outputs"],
602
+ ),
603
+ temperature_support=True,
604
+ ),
605
+ ModelCard(
606
+ model="grok-3-mini-beta",
607
+ pricing=Pricing(text=TokenPrice(prompt=0.3, cached_discount=1.0, completion=0.5), audio=None),
608
+ capabilities=ModelCapabilities(
609
+ modalities=["text"],
610
+ endpoints=["chat_completions"],
611
+ features=["streaming", "structured_outputs"],
612
+ ),
613
+ temperature_support=True,
614
+ ),
615
+ ]
616
+
617
+
618
+ model_cards = openai_model_cards + gemini_model_cards + xAI_model_cards
619
+
620
+
621
+ def get_model_card(model: str) -> ModelCard:
622
+ """
623
+ Get the model card for a specific model.
624
+
625
+ Args:
626
+ model: The model name to look up
627
+
628
+ Returns:
629
+ The ModelCard for the specified model
630
+
631
+ Raises:
632
+ ValueError: If no model card is found for the specified model
633
+ """
634
+ # Extract base model name for fine-tuned models like "ft:gpt-4o:uiform:4389573"
635
+ if model.startswith("ft:"):
636
+ # Split by colon and take the second part (index 1) which contains the base model
637
+ parts = model.split(":")
638
+ if len(parts) > 1:
639
+ model = parts[1]
640
+
641
+ for card in model_cards:
642
+ if card.model == model:
643
+ return card
644
+
645
+ raise ValueError(f"No model card found for model: {model}")
File without changes