kiln-ai 0.12.0__py3-none-any.whl → 0.13.2__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.

Potentially problematic release.


This version of kiln-ai might be problematic. Click here for more details.

Files changed (49) hide show
  1. kiln_ai/adapters/__init__.py +4 -0
  2. kiln_ai/adapters/adapter_registry.py +157 -28
  3. kiln_ai/adapters/eval/__init__.py +28 -0
  4. kiln_ai/adapters/eval/eval_runner.py +4 -1
  5. kiln_ai/adapters/eval/g_eval.py +19 -3
  6. kiln_ai/adapters/eval/test_base_eval.py +1 -0
  7. kiln_ai/adapters/eval/test_eval_runner.py +1 -0
  8. kiln_ai/adapters/eval/test_g_eval.py +13 -7
  9. kiln_ai/adapters/fine_tune/base_finetune.py +16 -2
  10. kiln_ai/adapters/fine_tune/finetune_registry.py +2 -0
  11. kiln_ai/adapters/fine_tune/fireworks_finetune.py +8 -1
  12. kiln_ai/adapters/fine_tune/test_fireworks_tinetune.py +19 -0
  13. kiln_ai/adapters/fine_tune/test_together_finetune.py +533 -0
  14. kiln_ai/adapters/fine_tune/together_finetune.py +327 -0
  15. kiln_ai/adapters/ml_model_list.py +638 -155
  16. kiln_ai/adapters/model_adapters/__init__.py +2 -4
  17. kiln_ai/adapters/model_adapters/base_adapter.py +14 -11
  18. kiln_ai/adapters/model_adapters/litellm_adapter.py +391 -0
  19. kiln_ai/adapters/model_adapters/litellm_config.py +13 -0
  20. kiln_ai/adapters/model_adapters/test_litellm_adapter.py +407 -0
  21. kiln_ai/adapters/model_adapters/test_structured_output.py +23 -5
  22. kiln_ai/adapters/ollama_tools.py +3 -2
  23. kiln_ai/adapters/parsers/r1_parser.py +19 -14
  24. kiln_ai/adapters/parsers/test_r1_parser.py +17 -5
  25. kiln_ai/adapters/provider_tools.py +52 -60
  26. kiln_ai/adapters/repair/test_repair_task.py +3 -3
  27. kiln_ai/adapters/run_output.py +1 -1
  28. kiln_ai/adapters/test_adapter_registry.py +17 -20
  29. kiln_ai/adapters/test_generate_docs.py +2 -2
  30. kiln_ai/adapters/test_prompt_adaptors.py +30 -19
  31. kiln_ai/adapters/test_provider_tools.py +27 -82
  32. kiln_ai/datamodel/basemodel.py +2 -0
  33. kiln_ai/datamodel/datamodel_enums.py +2 -0
  34. kiln_ai/datamodel/json_schema.py +1 -1
  35. kiln_ai/datamodel/task_output.py +13 -6
  36. kiln_ai/datamodel/test_basemodel.py +9 -0
  37. kiln_ai/datamodel/test_datasource.py +19 -0
  38. kiln_ai/utils/config.py +46 -0
  39. kiln_ai/utils/dataset_import.py +232 -0
  40. kiln_ai/utils/test_dataset_import.py +596 -0
  41. {kiln_ai-0.12.0.dist-info → kiln_ai-0.13.2.dist-info}/METADATA +51 -7
  42. {kiln_ai-0.12.0.dist-info → kiln_ai-0.13.2.dist-info}/RECORD +44 -41
  43. kiln_ai/adapters/model_adapters/langchain_adapters.py +0 -309
  44. kiln_ai/adapters/model_adapters/openai_compatible_config.py +0 -10
  45. kiln_ai/adapters/model_adapters/openai_model_adapter.py +0 -289
  46. kiln_ai/adapters/model_adapters/test_langchain_adapter.py +0 -343
  47. kiln_ai/adapters/model_adapters/test_openai_model_adapter.py +0 -216
  48. {kiln_ai-0.12.0.dist-info → kiln_ai-0.13.2.dist-info}/WHEEL +0 -0
  49. {kiln_ai-0.12.0.dist-info → kiln_ai-0.13.2.dist-info}/licenses/LICENSE.txt +0 -0
@@ -1,5 +1,5 @@
1
1
  from enum import Enum
2
- from typing import Dict, List
2
+ from typing import Dict, List, Literal
3
3
 
4
4
  from pydantic import BaseModel
5
5
 
@@ -26,6 +26,12 @@ class ModelProviderName(str, Enum):
26
26
  kiln_fine_tune = "kiln_fine_tune"
27
27
  kiln_custom_registry = "kiln_custom_registry"
28
28
  openai_compatible = "openai_compatible"
29
+ anthropic = "anthropic"
30
+ gemini_api = "gemini_api"
31
+ azure_openai = "azure_openai"
32
+ huggingface = "huggingface"
33
+ vertex = "vertex"
34
+ together_ai = "together_ai"
29
35
 
30
36
 
31
37
  class ModelFamily(str, Enum):
@@ -64,13 +70,25 @@ class ModelName(str, Enum):
64
70
  llama_3_3_70b = "llama_3_3_70b"
65
71
  gpt_4o_mini = "gpt_4o_mini"
66
72
  gpt_4o = "gpt_4o"
73
+ gpt_o1_low = "gpt_o1_low"
74
+ gpt_o1_medium = "gpt_o1_medium"
75
+ gpt_o1_high = "gpt_o1_high"
76
+ gpt_o3_mini_low = "gpt_o3_mini_low"
77
+ gpt_o3_mini_medium = "gpt_o3_mini_medium"
78
+ gpt_o3_mini_high = "gpt_o3_mini_high"
67
79
  phi_3_5 = "phi_3_5"
68
80
  phi_4 = "phi_4"
81
+ phi_4_5p6b = "phi_4_5p6b"
82
+ phi_4_mini = "phi_4_mini"
69
83
  mistral_large = "mistral_large"
70
84
  mistral_nemo = "mistral_nemo"
71
85
  gemma_2_2b = "gemma_2_2b"
72
86
  gemma_2_9b = "gemma_2_9b"
73
87
  gemma_2_27b = "gemma_2_27b"
88
+ gemma_3_1b = "gemma_3_1b"
89
+ gemma_3_4b = "gemma_3_4b"
90
+ gemma_3_12b = "gemma_3_12b"
91
+ gemma_3_27b = "gemma_3_27b"
74
92
  claude_3_5_haiku = "claude_3_5_haiku"
75
93
  claude_3_5_sonnet = "claude_3_5_sonnet"
76
94
  claude_3_7_sonnet = "claude_3_7_sonnet"
@@ -82,7 +100,9 @@ class ModelName(str, Enum):
82
100
  nemotron_70b = "nemotron_70b"
83
101
  mixtral_8x7b = "mixtral_8x7b"
84
102
  qwen_2p5_7b = "qwen_2p5_7b"
103
+ qwen_2p5_14b = "qwen_2p5_14b"
85
104
  qwen_2p5_72b = "qwen_2p5_72b"
105
+ qwq_32b = "qwq_32b"
86
106
  deepseek_3 = "deepseek_3"
87
107
  deepseek_r1 = "deepseek_r1"
88
108
  mistral_small_3 = "mistral_small_3"
@@ -114,18 +134,17 @@ class KilnModelProvider(BaseModel):
114
134
  supports_data_gen: Whether the provider supports data generation
115
135
  untested_model: Whether the model is untested (typically user added). The supports_ fields are not applicable.
116
136
  provider_finetune_id: The finetune ID for the provider, if applicable
117
- provider_options: Additional provider-specific configuration options
118
137
  structured_output_mode: The mode we should use to call the model for structured output, if it was trained with structured output.
119
138
  parser: A parser to use for the model, if applicable
120
139
  reasoning_capable: Whether the model is designed to output thinking in a structured format (eg <think></think>). If so we don't use COT across 2 calls, and ask for thinking and final response in the same call.
121
140
  """
122
141
 
123
142
  name: ModelProviderName
143
+ model_id: str | None = None
124
144
  supports_structured_output: bool = True
125
145
  supports_data_gen: bool = True
126
146
  untested_model: bool = False
127
147
  provider_finetune_id: str | None = None
128
- provider_options: Dict = {}
129
148
  structured_output_mode: StructuredOutputMode = StructuredOutputMode.default
130
149
  parser: ModelParserID | None = None
131
150
  reasoning_capable: bool = False
@@ -138,6 +157,9 @@ class KilnModelProvider(BaseModel):
138
157
  require_openrouter_reasoning: bool = False
139
158
  logprobs_openrouter_options: bool = False
140
159
  openrouter_skip_required_parameters: bool = False
160
+ thinking_level: Literal["low", "medium", "high"] | None = None
161
+ ollama_model_aliases: List[str] | None = None
162
+ anthropic_extended_thinking: bool = False
141
163
 
142
164
 
143
165
  class KilnModel(BaseModel):
@@ -167,18 +189,22 @@ built_in_models: List[KilnModel] = [
167
189
  providers=[
168
190
  KilnModelProvider(
169
191
  name=ModelProviderName.openai,
170
- provider_options={"model": "gpt-4o-mini"},
192
+ model_id="gpt-4o-mini",
171
193
  provider_finetune_id="gpt-4o-mini-2024-07-18",
172
194
  structured_output_mode=StructuredOutputMode.json_schema,
173
195
  supports_logprobs=True,
174
196
  ),
175
197
  KilnModelProvider(
176
198
  name=ModelProviderName.openrouter,
177
- provider_options={"model": "openai/gpt-4o-mini"},
199
+ model_id="openai/gpt-4o-mini",
178
200
  structured_output_mode=StructuredOutputMode.json_schema,
179
201
  supports_logprobs=True,
180
202
  logprobs_openrouter_options=True,
181
203
  ),
204
+ KilnModelProvider(
205
+ name=ModelProviderName.azure_openai,
206
+ model_id="gpt-4o-mini",
207
+ ),
182
208
  ],
183
209
  ),
184
210
  # GPT 4o
@@ -189,18 +215,142 @@ built_in_models: List[KilnModel] = [
189
215
  providers=[
190
216
  KilnModelProvider(
191
217
  name=ModelProviderName.openai,
192
- provider_options={"model": "gpt-4o"},
218
+ model_id="gpt-4o",
193
219
  provider_finetune_id="gpt-4o-2024-08-06",
194
220
  structured_output_mode=StructuredOutputMode.json_schema,
195
221
  supports_logprobs=True,
196
222
  ),
197
223
  KilnModelProvider(
198
224
  name=ModelProviderName.openrouter,
199
- provider_options={"model": "openai/gpt-4o"},
225
+ model_id="openai/gpt-4o",
200
226
  structured_output_mode=StructuredOutputMode.json_schema,
201
227
  supports_logprobs=True,
202
228
  logprobs_openrouter_options=True,
203
229
  ),
230
+ KilnModelProvider(
231
+ name=ModelProviderName.azure_openai,
232
+ model_id="gpt-4o",
233
+ ),
234
+ ],
235
+ ),
236
+ # GPT o3 Mini Low
237
+ KilnModel(
238
+ family=ModelFamily.gpt,
239
+ name=ModelName.gpt_o3_mini_low,
240
+ friendly_name="GPT o3 Mini - Low",
241
+ providers=[
242
+ KilnModelProvider(
243
+ name=ModelProviderName.openai,
244
+ model_id="o3-mini",
245
+ thinking_level="low",
246
+ structured_output_mode=StructuredOutputMode.json_schema,
247
+ ),
248
+ KilnModelProvider(
249
+ name=ModelProviderName.azure_openai,
250
+ model_id="o3-mini",
251
+ structured_output_mode=StructuredOutputMode.json_schema,
252
+ thinking_level="low",
253
+ ),
254
+ ],
255
+ ),
256
+ # GPT o3 Mini Medium
257
+ KilnModel(
258
+ family=ModelFamily.gpt,
259
+ name=ModelName.gpt_o3_mini_medium,
260
+ friendly_name="GPT o3 Mini - Medium",
261
+ providers=[
262
+ KilnModelProvider(
263
+ name=ModelProviderName.openai,
264
+ model_id="o3-mini",
265
+ thinking_level="medium",
266
+ structured_output_mode=StructuredOutputMode.json_schema,
267
+ ),
268
+ KilnModelProvider(
269
+ name=ModelProviderName.azure_openai,
270
+ model_id="o3-mini",
271
+ structured_output_mode=StructuredOutputMode.json_schema,
272
+ thinking_level="medium",
273
+ ),
274
+ ],
275
+ ),
276
+ # GPT o3 Mini High
277
+ KilnModel(
278
+ family=ModelFamily.gpt,
279
+ name=ModelName.gpt_o3_mini_high,
280
+ friendly_name="GPT o3 Mini - High",
281
+ providers=[
282
+ KilnModelProvider(
283
+ name=ModelProviderName.openai,
284
+ model_id="o3-mini",
285
+ thinking_level="high",
286
+ structured_output_mode=StructuredOutputMode.json_schema,
287
+ ),
288
+ KilnModelProvider(
289
+ name=ModelProviderName.azure_openai,
290
+ model_id="o3-mini",
291
+ structured_output_mode=StructuredOutputMode.json_schema,
292
+ thinking_level="high",
293
+ ),
294
+ ],
295
+ ),
296
+ # GPT o1 Low
297
+ KilnModel(
298
+ family=ModelFamily.gpt,
299
+ name=ModelName.gpt_o1_low,
300
+ friendly_name="GPT o1 - Low",
301
+ providers=[
302
+ KilnModelProvider(
303
+ name=ModelProviderName.openai,
304
+ model_id="o1",
305
+ thinking_level="low",
306
+ structured_output_mode=StructuredOutputMode.json_schema,
307
+ ),
308
+ KilnModelProvider(
309
+ name=ModelProviderName.azure_openai,
310
+ model_id="o1",
311
+ structured_output_mode=StructuredOutputMode.json_schema,
312
+ thinking_level="low",
313
+ ),
314
+ ],
315
+ ),
316
+ # GPT o1 Medium
317
+ KilnModel(
318
+ family=ModelFamily.gpt,
319
+ name=ModelName.gpt_o1_medium,
320
+ friendly_name="GPT o1 - Medium",
321
+ providers=[
322
+ KilnModelProvider(
323
+ name=ModelProviderName.openai,
324
+ model_id="o1",
325
+ thinking_level="medium",
326
+ structured_output_mode=StructuredOutputMode.json_schema,
327
+ ),
328
+ KilnModelProvider(
329
+ name=ModelProviderName.azure_openai,
330
+ model_id="o1",
331
+ structured_output_mode=StructuredOutputMode.json_schema,
332
+ thinking_level="medium",
333
+ ),
334
+ ],
335
+ ),
336
+ # GPT o1 High
337
+ KilnModel(
338
+ family=ModelFamily.gpt,
339
+ name=ModelName.gpt_o1_high,
340
+ friendly_name="GPT o1 - High",
341
+ providers=[
342
+ KilnModelProvider(
343
+ name=ModelProviderName.openai,
344
+ model_id="o1",
345
+ thinking_level="high",
346
+ structured_output_mode=StructuredOutputMode.json_schema,
347
+ ),
348
+ KilnModelProvider(
349
+ name=ModelProviderName.azure_openai,
350
+ model_id="o1",
351
+ structured_output_mode=StructuredOutputMode.json_schema,
352
+ thinking_level="high",
353
+ ),
204
354
  ],
205
355
  ),
206
356
  # Claude 3.5 Haiku
@@ -211,8 +361,18 @@ built_in_models: List[KilnModel] = [
211
361
  providers=[
212
362
  KilnModelProvider(
213
363
  name=ModelProviderName.openrouter,
214
- structured_output_mode=StructuredOutputMode.json_instruction_and_object,
215
- provider_options={"model": "anthropic/claude-3-5-haiku"},
364
+ structured_output_mode=StructuredOutputMode.function_calling,
365
+ model_id="anthropic/claude-3-5-haiku",
366
+ ),
367
+ KilnModelProvider(
368
+ name=ModelProviderName.anthropic,
369
+ model_id="claude-3-5-haiku-20241022",
370
+ structured_output_mode=StructuredOutputMode.function_calling,
371
+ ),
372
+ KilnModelProvider(
373
+ name=ModelProviderName.vertex,
374
+ model_id="claude-3-5-haiku",
375
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
216
376
  ),
217
377
  ],
218
378
  ),
@@ -224,8 +384,18 @@ built_in_models: List[KilnModel] = [
224
384
  providers=[
225
385
  KilnModelProvider(
226
386
  name=ModelProviderName.openrouter,
227
- structured_output_mode=StructuredOutputMode.json_instruction_and_object,
228
- provider_options={"model": "anthropic/claude-3.5-sonnet"},
387
+ structured_output_mode=StructuredOutputMode.function_calling,
388
+ model_id="anthropic/claude-3.5-sonnet",
389
+ ),
390
+ KilnModelProvider(
391
+ name=ModelProviderName.anthropic,
392
+ model_id="claude-3-5-sonnet-20241022",
393
+ structured_output_mode=StructuredOutputMode.function_calling,
394
+ ),
395
+ KilnModelProvider(
396
+ name=ModelProviderName.vertex,
397
+ model_id="claude-3-5-sonnet",
398
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
229
399
  ),
230
400
  ],
231
401
  ),
@@ -238,7 +408,12 @@ built_in_models: List[KilnModel] = [
238
408
  KilnModelProvider(
239
409
  name=ModelProviderName.openrouter,
240
410
  structured_output_mode=StructuredOutputMode.function_calling,
241
- provider_options={"model": "anthropic/claude-3.7-sonnet"},
411
+ model_id="anthropic/claude-3.7-sonnet",
412
+ ),
413
+ KilnModelProvider(
414
+ name=ModelProviderName.anthropic,
415
+ model_id="claude-3-7-sonnet-20250219",
416
+ structured_output_mode=StructuredOutputMode.function_calling,
242
417
  ),
243
418
  ],
244
419
  ),
@@ -250,12 +425,19 @@ built_in_models: List[KilnModel] = [
250
425
  providers=[
251
426
  KilnModelProvider(
252
427
  name=ModelProviderName.openrouter,
253
- provider_options={"model": "anthropic/claude-3.7-sonnet:thinking"},
428
+ model_id="anthropic/claude-3.7-sonnet:thinking",
254
429
  reasoning_capable=True,
255
430
  # For reasoning models, we need to use json_instructions with OpenRouter
256
431
  structured_output_mode=StructuredOutputMode.json_instructions,
257
432
  require_openrouter_reasoning=True,
258
433
  ),
434
+ KilnModelProvider(
435
+ name=ModelProviderName.anthropic,
436
+ reasoning_capable=True,
437
+ model_id="claude-3-7-sonnet-20250219",
438
+ anthropic_extended_thinking=True,
439
+ structured_output_mode=StructuredOutputMode.json_instructions,
440
+ ),
259
441
  ],
260
442
  ),
261
443
  # Gemini 1.5 Pro
@@ -266,8 +448,18 @@ built_in_models: List[KilnModel] = [
266
448
  providers=[
267
449
  KilnModelProvider(
268
450
  name=ModelProviderName.openrouter,
269
- provider_options={"model": "google/gemini-pro-1.5"},
270
- structured_output_mode=StructuredOutputMode.json_schema,
451
+ model_id="google/gemini-pro-1.5",
452
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
453
+ ),
454
+ KilnModelProvider(
455
+ name=ModelProviderName.gemini_api,
456
+ model_id="gemini-1.5-pro",
457
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
458
+ ),
459
+ KilnModelProvider(
460
+ name=ModelProviderName.vertex,
461
+ model_id="gemini-1.5-pro",
462
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
271
463
  ),
272
464
  ],
273
465
  ),
@@ -279,8 +471,18 @@ built_in_models: List[KilnModel] = [
279
471
  providers=[
280
472
  KilnModelProvider(
281
473
  name=ModelProviderName.openrouter,
282
- provider_options={"model": "google/gemini-flash-1.5"},
283
- structured_output_mode=StructuredOutputMode.json_schema,
474
+ model_id="google/gemini-flash-1.5",
475
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
476
+ ),
477
+ KilnModelProvider(
478
+ name=ModelProviderName.gemini_api,
479
+ model_id="gemini-1.5-flash",
480
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
481
+ ),
482
+ KilnModelProvider(
483
+ name=ModelProviderName.vertex,
484
+ model_id="gemini-1.5-flash",
485
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
284
486
  ),
285
487
  ],
286
488
  ),
@@ -292,8 +494,15 @@ built_in_models: List[KilnModel] = [
292
494
  providers=[
293
495
  KilnModelProvider(
294
496
  name=ModelProviderName.openrouter,
295
- provider_options={"model": "google/gemini-flash-1.5-8b"},
296
- structured_output_mode=StructuredOutputMode.json_mode,
497
+ model_id="google/gemini-flash-1.5-8b",
498
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
499
+ supports_data_gen=False,
500
+ ),
501
+ KilnModelProvider(
502
+ name=ModelProviderName.gemini_api,
503
+ model_id="gemini-1.5-flash-8b",
504
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
505
+ supports_data_gen=False,
297
506
  ),
298
507
  ],
299
508
  ),
@@ -305,8 +514,18 @@ built_in_models: List[KilnModel] = [
305
514
  providers=[
306
515
  KilnModelProvider(
307
516
  name=ModelProviderName.openrouter,
308
- structured_output_mode=StructuredOutputMode.json_schema,
309
- provider_options={"model": "google/gemini-2.0-flash-001"},
517
+ model_id="google/gemini-2.0-flash-001",
518
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
519
+ ),
520
+ KilnModelProvider(
521
+ name=ModelProviderName.gemini_api,
522
+ model_id="gemini-2.0-flash",
523
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
524
+ ),
525
+ KilnModelProvider(
526
+ name=ModelProviderName.vertex,
527
+ model_id="gemini-2.0-flash",
528
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
310
529
  ),
311
530
  ],
312
531
  ),
@@ -320,7 +539,7 @@ built_in_models: List[KilnModel] = [
320
539
  name=ModelProviderName.openrouter,
321
540
  supports_structured_output=False,
322
541
  supports_data_gen=False,
323
- provider_options={"model": "nvidia/llama-3.1-nemotron-70b-instruct"},
542
+ model_id="nvidia/llama-3.1-nemotron-70b-instruct",
324
543
  ),
325
544
  ],
326
545
  ),
@@ -332,39 +551,40 @@ built_in_models: List[KilnModel] = [
332
551
  providers=[
333
552
  KilnModelProvider(
334
553
  name=ModelProviderName.groq,
335
- provider_options={"model": "llama-3.1-8b-instant"},
554
+ model_id="llama-3.1-8b-instant",
336
555
  ),
337
556
  KilnModelProvider(
338
557
  name=ModelProviderName.amazon_bedrock,
339
558
  structured_output_mode=StructuredOutputMode.json_schema,
340
- supports_data_gen=False,
341
- provider_options={
342
- "model": "meta.llama3-1-8b-instruct-v1:0",
343
- "region_name": "us-west-2", # Llama 3.1 only in west-2
344
- },
559
+ supports_structured_output=False,
560
+ model_id="meta.llama3-1-8b-instruct-v1:0",
345
561
  ),
346
562
  KilnModelProvider(
347
563
  name=ModelProviderName.ollama,
348
564
  structured_output_mode=StructuredOutputMode.json_schema,
349
- provider_options={
350
- "model": "llama3.1:8b",
351
- "model_aliases": ["llama3.1"], # 8b is default
352
- },
565
+ model_id="llama3.1:8b",
566
+ ollama_model_aliases=["llama3.1"], # 8b is default
353
567
  ),
354
568
  KilnModelProvider(
355
569
  name=ModelProviderName.openrouter,
356
570
  supports_data_gen=False,
357
571
  structured_output_mode=StructuredOutputMode.function_calling,
358
- provider_options={"model": "meta-llama/llama-3.1-8b-instruct"},
572
+ model_id="meta-llama/llama-3.1-8b-instruct",
359
573
  ),
360
574
  KilnModelProvider(
361
575
  name=ModelProviderName.fireworks_ai,
362
576
  # JSON mode not ideal (no schema), but tool calling doesn't work on 8b
363
- structured_output_mode=StructuredOutputMode.json_mode,
577
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
578
+ supports_data_gen=False,
364
579
  provider_finetune_id="accounts/fireworks/models/llama-v3p1-8b-instruct",
365
- provider_options={
366
- "model": "accounts/fireworks/models/llama-v3p1-8b-instruct"
367
- },
580
+ model_id="accounts/fireworks/models/llama-v3p1-8b-instruct",
581
+ ),
582
+ KilnModelProvider(
583
+ name=ModelProviderName.together_ai,
584
+ model_id="meta-llama/Meta-Llama-3.1-8B-Instruct-Turbo",
585
+ supports_data_gen=False,
586
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
587
+ provider_finetune_id="meta-llama/Meta-Llama-3.1-8B-Instruct",
368
588
  ),
369
589
  ],
370
590
  ),
@@ -378,33 +598,35 @@ built_in_models: List[KilnModel] = [
378
598
  name=ModelProviderName.amazon_bedrock,
379
599
  structured_output_mode=StructuredOutputMode.json_schema,
380
600
  supports_data_gen=False,
381
- provider_options={
382
- "model": "meta.llama3-1-70b-instruct-v1:0",
383
- "region_name": "us-west-2", # Llama 3.1 only in west-2
384
- },
601
+ model_id="meta.llama3-1-70b-instruct-v1:0",
385
602
  ),
386
603
  KilnModelProvider(
387
604
  name=ModelProviderName.openrouter,
388
605
  supports_data_gen=False,
389
606
  # Need to not pass "strict=True" to the function call to get this to work with logprobs for some reason. Openrouter issue.
390
607
  structured_output_mode=StructuredOutputMode.function_calling_weak,
391
- provider_options={"model": "meta-llama/llama-3.1-70b-instruct"},
608
+ model_id="meta-llama/llama-3.1-70b-instruct",
392
609
  supports_logprobs=True,
393
610
  logprobs_openrouter_options=True,
394
611
  ),
395
612
  KilnModelProvider(
396
613
  name=ModelProviderName.ollama,
397
614
  structured_output_mode=StructuredOutputMode.json_schema,
398
- provider_options={"model": "llama3.1:70b"},
615
+ model_id="llama3.1:70b",
399
616
  ),
400
617
  KilnModelProvider(
401
618
  name=ModelProviderName.fireworks_ai,
402
619
  # Tool calling forces schema -- fireworks doesn't support json_schema, just json_mode
403
- structured_output_mode=StructuredOutputMode.function_calling,
620
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
404
621
  provider_finetune_id="accounts/fireworks/models/llama-v3p1-70b-instruct",
405
- provider_options={
406
- "model": "accounts/fireworks/models/llama-v3p1-70b-instruct"
407
- },
622
+ model_id="accounts/fireworks/models/llama-v3p1-70b-instruct",
623
+ ),
624
+ KilnModelProvider(
625
+ name=ModelProviderName.together_ai,
626
+ model_id="meta-llama/Meta-Llama-3.1-70B-Instruct-Turbo",
627
+ supports_data_gen=False,
628
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
629
+ provider_finetune_id="meta-llama/Meta-Llama-3.1-70B-Instruct",
408
630
  ),
409
631
  ],
410
632
  ),
@@ -418,28 +640,29 @@ built_in_models: List[KilnModel] = [
418
640
  name=ModelProviderName.amazon_bedrock,
419
641
  structured_output_mode=StructuredOutputMode.json_schema,
420
642
  supports_data_gen=False,
421
- provider_options={
422
- "model": "meta.llama3-1-405b-instruct-v1:0",
423
- "region_name": "us-west-2", # Llama 3.1 only in west-2
424
- },
643
+ model_id="meta.llama3-1-405b-instruct-v1:0",
425
644
  ),
426
645
  KilnModelProvider(
427
646
  name=ModelProviderName.ollama,
428
647
  structured_output_mode=StructuredOutputMode.json_schema,
429
- provider_options={"model": "llama3.1:405b"},
648
+ model_id="llama3.1:405b",
430
649
  ),
431
650
  KilnModelProvider(
432
651
  name=ModelProviderName.openrouter,
433
652
  structured_output_mode=StructuredOutputMode.function_calling,
434
- provider_options={"model": "meta-llama/llama-3.1-405b-instruct"},
653
+ model_id="meta-llama/llama-3.1-405b-instruct",
435
654
  ),
436
655
  KilnModelProvider(
437
656
  name=ModelProviderName.fireworks_ai,
438
657
  # No finetune support. https://docs.fireworks.ai/fine-tuning/fine-tuning-models
439
- structured_output_mode=StructuredOutputMode.function_calling,
440
- provider_options={
441
- "model": "accounts/fireworks/models/llama-v3p1-405b-instruct"
442
- },
658
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
659
+ model_id="accounts/fireworks/models/llama-v3p1-405b-instruct",
660
+ ),
661
+ KilnModelProvider(
662
+ name=ModelProviderName.together_ai,
663
+ model_id="meta-llama/Meta-Llama-3.1-405B-Instruct-Turbo",
664
+ supports_data_gen=False,
665
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
443
666
  ),
444
667
  ],
445
668
  ),
@@ -451,7 +674,7 @@ built_in_models: List[KilnModel] = [
451
674
  providers=[
452
675
  KilnModelProvider(
453
676
  name=ModelProviderName.openrouter,
454
- provider_options={"model": "mistralai/mistral-nemo"},
677
+ model_id="mistralai/mistral-nemo",
455
678
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
456
679
  ),
457
680
  ],
@@ -464,21 +687,18 @@ built_in_models: List[KilnModel] = [
464
687
  providers=[
465
688
  KilnModelProvider(
466
689
  name=ModelProviderName.amazon_bedrock,
467
- structured_output_mode=StructuredOutputMode.json_schema,
468
- provider_options={
469
- "model": "mistral.mistral-large-2407-v1:0",
470
- "region_name": "us-west-2", # only in west-2
471
- },
690
+ structured_output_mode=StructuredOutputMode.json_instructions,
691
+ model_id="mistral.mistral-large-2407-v1:0",
472
692
  ),
473
693
  KilnModelProvider(
474
694
  name=ModelProviderName.openrouter,
475
695
  structured_output_mode=StructuredOutputMode.json_schema,
476
- provider_options={"model": "mistralai/mistral-large"},
696
+ model_id="mistralai/mistral-large",
477
697
  ),
478
698
  KilnModelProvider(
479
699
  name=ModelProviderName.ollama,
480
700
  structured_output_mode=StructuredOutputMode.json_schema,
481
- provider_options={"model": "mistral-large"},
701
+ model_id="mistral-large",
482
702
  ),
483
703
  ],
484
704
  ),
@@ -490,7 +710,8 @@ built_in_models: List[KilnModel] = [
490
710
  providers=[
491
711
  KilnModelProvider(
492
712
  name=ModelProviderName.groq,
493
- provider_options={"model": "llama-3.2-1b-preview"},
713
+ model_id="llama-3.2-1b-preview",
714
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
494
715
  supports_data_gen=False,
495
716
  ),
496
717
  KilnModelProvider(
@@ -498,13 +719,23 @@ built_in_models: List[KilnModel] = [
498
719
  supports_structured_output=False,
499
720
  supports_data_gen=False,
500
721
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
501
- provider_options={"model": "meta-llama/llama-3.2-1b-instruct"},
722
+ model_id="meta-llama/llama-3.2-1b-instruct",
502
723
  ),
503
724
  KilnModelProvider(
504
725
  name=ModelProviderName.ollama,
505
726
  supports_structured_output=False,
506
727
  supports_data_gen=False,
507
- provider_options={"model": "llama3.2:1b"},
728
+ model_id="llama3.2:1b",
729
+ ),
730
+ KilnModelProvider(
731
+ name=ModelProviderName.huggingface,
732
+ model_id="meta-llama/Llama-3.2-1B-Instruct",
733
+ supports_structured_output=False,
734
+ supports_data_gen=False,
735
+ ),
736
+ KilnModelProvider(
737
+ name=ModelProviderName.together_ai,
738
+ provider_finetune_id="meta-llama/Llama-3.2-1B-Instruct",
508
739
  ),
509
740
  ],
510
741
  ),
@@ -516,7 +747,7 @@ built_in_models: List[KilnModel] = [
516
747
  providers=[
517
748
  KilnModelProvider(
518
749
  name=ModelProviderName.groq,
519
- provider_options={"model": "llama-3.2-3b-preview"},
750
+ model_id="llama-3.2-3b-preview",
520
751
  supports_data_gen=False,
521
752
  ),
522
753
  KilnModelProvider(
@@ -524,20 +755,32 @@ built_in_models: List[KilnModel] = [
524
755
  supports_structured_output=False,
525
756
  supports_data_gen=False,
526
757
  structured_output_mode=StructuredOutputMode.json_schema,
527
- provider_options={"model": "meta-llama/llama-3.2-3b-instruct"},
758
+ model_id="meta-llama/llama-3.2-3b-instruct",
528
759
  ),
529
760
  KilnModelProvider(
530
761
  name=ModelProviderName.ollama,
531
762
  supports_data_gen=False,
532
- provider_options={"model": "llama3.2"},
763
+ model_id="llama3.2",
533
764
  ),
534
765
  KilnModelProvider(
535
766
  name=ModelProviderName.fireworks_ai,
536
767
  provider_finetune_id="accounts/fireworks/models/llama-v3p2-3b-instruct",
537
- structured_output_mode=StructuredOutputMode.json_mode,
538
- provider_options={
539
- "model": "accounts/fireworks/models/llama-v3p2-3b-instruct"
540
- },
768
+ supports_structured_output=False,
769
+ supports_data_gen=False,
770
+ model_id="accounts/fireworks/models/llama-v3p2-3b-instruct",
771
+ ),
772
+ KilnModelProvider(
773
+ name=ModelProviderName.huggingface,
774
+ model_id="meta-llama/Llama-3.2-3B-Instruct",
775
+ supports_structured_output=False,
776
+ supports_data_gen=False,
777
+ ),
778
+ KilnModelProvider(
779
+ name=ModelProviderName.together_ai,
780
+ model_id="meta-llama/Llama-3.2-3B-Instruct-Turbo",
781
+ supports_structured_output=False,
782
+ supports_data_gen=False,
783
+ provider_finetune_id="meta-llama/Llama-3.2-3B-Instruct",
541
784
  ),
542
785
  ],
543
786
  ),
@@ -549,25 +792,39 @@ built_in_models: List[KilnModel] = [
549
792
  providers=[
550
793
  KilnModelProvider(
551
794
  name=ModelProviderName.groq,
552
- provider_options={"model": "llama-3.2-11b-vision-preview"},
795
+ model_id="llama-3.2-11b-vision-preview",
553
796
  ),
554
797
  KilnModelProvider(
555
798
  name=ModelProviderName.openrouter,
556
- structured_output_mode=StructuredOutputMode.json_schema,
557
- provider_options={"model": "meta-llama/llama-3.2-11b-vision-instruct"},
799
+ # Best mode, but fails to often to enable without warning
800
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
801
+ supports_structured_output=False,
802
+ supports_data_gen=False,
803
+ model_id="meta-llama/llama-3.2-11b-vision-instruct",
558
804
  ),
559
805
  KilnModelProvider(
560
806
  name=ModelProviderName.ollama,
561
807
  structured_output_mode=StructuredOutputMode.json_schema,
562
- provider_options={"model": "llama3.2-vision"},
808
+ model_id="llama3.2-vision",
563
809
  ),
564
810
  KilnModelProvider(
565
811
  name=ModelProviderName.fireworks_ai,
566
812
  # No finetune support. https://docs.fireworks.ai/fine-tuning/fine-tuning-models
567
- provider_options={
568
- "model": "accounts/fireworks/models/llama-v3p2-11b-vision-instruct"
569
- },
570
- structured_output_mode=StructuredOutputMode.json_mode,
813
+ model_id="accounts/fireworks/models/llama-v3p2-11b-vision-instruct",
814
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
815
+ supports_data_gen=False,
816
+ ),
817
+ KilnModelProvider(
818
+ name=ModelProviderName.huggingface,
819
+ model_id="meta-llama/Llama-3.2-11B-Vision-Instruct",
820
+ supports_structured_output=False,
821
+ supports_data_gen=False,
822
+ ),
823
+ KilnModelProvider(
824
+ name=ModelProviderName.together_ai,
825
+ model_id="meta-llama/Llama-3.2-11B-Vision-Instruct-Turbo",
826
+ supports_structured_output=False,
827
+ supports_data_gen=False,
571
828
  ),
572
829
  ],
573
830
  ),
@@ -579,25 +836,30 @@ built_in_models: List[KilnModel] = [
579
836
  providers=[
580
837
  KilnModelProvider(
581
838
  name=ModelProviderName.groq,
582
- provider_options={"model": "llama-3.2-90b-vision-preview"},
839
+ model_id="llama-3.2-90b-vision-preview",
583
840
  ),
584
841
  KilnModelProvider(
585
842
  name=ModelProviderName.openrouter,
586
- structured_output_mode=StructuredOutputMode.json_schema,
587
- provider_options={"model": "meta-llama/llama-3.2-90b-vision-instruct"},
843
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
844
+ model_id="meta-llama/llama-3.2-90b-vision-instruct",
588
845
  ),
589
846
  KilnModelProvider(
590
847
  name=ModelProviderName.ollama,
591
848
  structured_output_mode=StructuredOutputMode.json_schema,
592
- provider_options={"model": "llama3.2-vision:90b"},
849
+ model_id="llama3.2-vision:90b",
593
850
  ),
594
851
  KilnModelProvider(
595
852
  name=ModelProviderName.fireworks_ai,
596
853
  # No finetune support. https://docs.fireworks.ai/fine-tuning/fine-tuning-models
597
- provider_options={
598
- "model": "accounts/fireworks/models/llama-v3p2-90b-vision-instruct"
599
- },
600
- structured_output_mode=StructuredOutputMode.json_mode,
854
+ model_id="accounts/fireworks/models/llama-v3p2-90b-vision-instruct",
855
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
856
+ supports_data_gen=False,
857
+ ),
858
+ KilnModelProvider(
859
+ name=ModelProviderName.together_ai,
860
+ model_id="meta-llama/Llama-3.2-90B-Vision-Instruct-Turbo",
861
+ supports_structured_output=False,
862
+ supports_data_gen=False,
601
863
  ),
602
864
  ],
603
865
  ),
@@ -609,7 +871,7 @@ built_in_models: List[KilnModel] = [
609
871
  providers=[
610
872
  KilnModelProvider(
611
873
  name=ModelProviderName.openrouter,
612
- provider_options={"model": "meta-llama/llama-3.3-70b-instruct"},
874
+ model_id="meta-llama/llama-3.3-70b-instruct",
613
875
  structured_output_mode=StructuredOutputMode.json_schema,
614
876
  # Openrouter not working with json_schema or tools. JSON_schema sometimes works so force that, but not consistently so still not recommended.
615
877
  supports_structured_output=False,
@@ -619,22 +881,32 @@ built_in_models: List[KilnModel] = [
619
881
  name=ModelProviderName.groq,
620
882
  supports_structured_output=True,
621
883
  supports_data_gen=True,
622
- provider_options={"model": "llama-3.3-70b-versatile"},
884
+ model_id="llama-3.3-70b-versatile",
623
885
  ),
624
886
  KilnModelProvider(
625
887
  name=ModelProviderName.ollama,
626
888
  structured_output_mode=StructuredOutputMode.json_schema,
627
- provider_options={"model": "llama3.3"},
889
+ model_id="llama3.3",
628
890
  ),
629
891
  KilnModelProvider(
630
892
  name=ModelProviderName.fireworks_ai,
631
893
  # Finetuning not live yet
632
894
  # provider_finetune_id="accounts/fireworks/models/llama-v3p3-70b-instruct",
633
895
  # Tool calling forces schema -- fireworks doesn't support json_schema, just json_mode
634
- structured_output_mode=StructuredOutputMode.function_calling,
635
- provider_options={
636
- "model": "accounts/fireworks/models/llama-v3p3-70b-instruct"
637
- },
896
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
897
+ model_id="accounts/fireworks/models/llama-v3p3-70b-instruct",
898
+ ),
899
+ KilnModelProvider(
900
+ name=ModelProviderName.vertex,
901
+ model_id="meta/llama-3.3-70b-instruct-maas",
902
+ # Doesn't work, TODO to debug
903
+ supports_structured_output=False,
904
+ supports_data_gen=False,
905
+ ),
906
+ KilnModelProvider(
907
+ name=ModelProviderName.together_ai,
908
+ model_id="meta-llama/Llama-3.3-70B-Instruct-Turbo",
909
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
638
910
  ),
639
911
  ],
640
912
  ),
@@ -649,23 +921,21 @@ built_in_models: List[KilnModel] = [
649
921
  structured_output_mode=StructuredOutputMode.json_schema,
650
922
  supports_structured_output=False,
651
923
  supports_data_gen=False,
652
- provider_options={"model": "phi3.5"},
924
+ model_id="phi3.5",
653
925
  ),
654
926
  KilnModelProvider(
655
927
  name=ModelProviderName.openrouter,
656
928
  supports_structured_output=False,
657
929
  supports_data_gen=False,
658
- provider_options={"model": "microsoft/phi-3.5-mini-128k-instruct"},
930
+ model_id="microsoft/phi-3.5-mini-128k-instruct",
659
931
  structured_output_mode=StructuredOutputMode.json_schema,
660
932
  ),
661
933
  KilnModelProvider(
662
934
  name=ModelProviderName.fireworks_ai,
663
935
  # No finetune support. https://docs.fireworks.ai/fine-tuning/fine-tuning-models
664
- structured_output_mode=StructuredOutputMode.json_mode,
936
+ supports_structured_output=False,
665
937
  supports_data_gen=False,
666
- provider_options={
667
- "model": "accounts/fireworks/models/phi-3-vision-128k-instruct"
668
- },
938
+ model_id="accounts/fireworks/models/phi-3-vision-128k-instruct",
669
939
  ),
670
940
  ],
671
941
  ),
@@ -673,19 +943,45 @@ built_in_models: List[KilnModel] = [
673
943
  KilnModel(
674
944
  family=ModelFamily.phi,
675
945
  name=ModelName.phi_4,
676
- friendly_name="Phi 4",
946
+ friendly_name="Phi 4 - 14B",
677
947
  providers=[
678
948
  KilnModelProvider(
679
949
  name=ModelProviderName.ollama,
680
950
  structured_output_mode=StructuredOutputMode.json_schema,
681
- provider_options={"model": "phi4"},
951
+ model_id="phi4",
682
952
  ),
683
953
  KilnModelProvider(
684
954
  name=ModelProviderName.openrouter,
685
955
  # JSON mode not consistent enough to enable in UI
686
956
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
687
957
  supports_data_gen=False,
688
- provider_options={"model": "microsoft/phi-4"},
958
+ model_id="microsoft/phi-4",
959
+ ),
960
+ ],
961
+ ),
962
+ # Phi 4 5.6B
963
+ KilnModel(
964
+ family=ModelFamily.phi,
965
+ name=ModelName.phi_4_5p6b,
966
+ friendly_name="Phi 4 - 5.6B",
967
+ providers=[
968
+ KilnModelProvider(
969
+ name=ModelProviderName.openrouter,
970
+ model_id="microsoft/phi-4-multimodal-instruct",
971
+ supports_structured_output=False,
972
+ supports_data_gen=False,
973
+ ),
974
+ ],
975
+ ),
976
+ # Phi 4 Mini
977
+ KilnModel(
978
+ family=ModelFamily.phi,
979
+ name=ModelName.phi_4_mini,
980
+ friendly_name="Phi 4 Mini - 3.8B",
981
+ providers=[
982
+ KilnModelProvider(
983
+ name=ModelProviderName.ollama,
984
+ model_id="phi4-mini",
689
985
  ),
690
986
  ],
691
987
  ),
@@ -698,9 +994,7 @@ built_in_models: List[KilnModel] = [
698
994
  KilnModelProvider(
699
995
  name=ModelProviderName.ollama,
700
996
  supports_data_gen=False,
701
- provider_options={
702
- "model": "gemma2:2b",
703
- },
997
+ model_id="gemma2:2b",
704
998
  ),
705
999
  ],
706
1000
  ),
@@ -713,15 +1007,15 @@ built_in_models: List[KilnModel] = [
713
1007
  KilnModelProvider(
714
1008
  name=ModelProviderName.ollama,
715
1009
  supports_data_gen=False,
716
- provider_options={
717
- "model": "gemma2:9b",
718
- },
1010
+ model_id="gemma2:9b",
719
1011
  ),
720
1012
  KilnModelProvider(
721
1013
  name=ModelProviderName.openrouter,
1014
+ # Best mode, but fails to often to enable without warning
722
1015
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
1016
+ supports_structured_output=False,
723
1017
  supports_data_gen=False,
724
- provider_options={"model": "google/gemma-2-9b-it"},
1018
+ model_id="google/gemma-2-9b-it",
725
1019
  ),
726
1020
  # fireworks AI errors - not allowing system role. Exclude until resolved.
727
1021
  ],
@@ -735,15 +1029,93 @@ built_in_models: List[KilnModel] = [
735
1029
  KilnModelProvider(
736
1030
  name=ModelProviderName.ollama,
737
1031
  supports_data_gen=False,
738
- provider_options={
739
- "model": "gemma2:27b",
740
- },
1032
+ model_id="gemma2:27b",
741
1033
  ),
742
1034
  KilnModelProvider(
743
1035
  name=ModelProviderName.openrouter,
744
1036
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
745
1037
  supports_data_gen=False,
746
- provider_options={"model": "google/gemma-2-27b-it"},
1038
+ model_id="google/gemma-2-27b-it",
1039
+ ),
1040
+ ],
1041
+ ),
1042
+ # Gemma 3 1B
1043
+ KilnModel(
1044
+ family=ModelFamily.gemma,
1045
+ name=ModelName.gemma_3_1b,
1046
+ friendly_name="Gemma 3 1B",
1047
+ providers=[
1048
+ KilnModelProvider(
1049
+ name=ModelProviderName.ollama,
1050
+ model_id="gemma3:1b",
1051
+ supports_structured_output=False,
1052
+ supports_data_gen=False,
1053
+ ),
1054
+ KilnModelProvider(
1055
+ name=ModelProviderName.openrouter,
1056
+ # TODO: swap to non-free model when available (more reliable)
1057
+ model_id="google/gemma-3-1b-it:free",
1058
+ supports_structured_output=False,
1059
+ supports_data_gen=False,
1060
+ ),
1061
+ ],
1062
+ ),
1063
+ # Gemma 3 4B
1064
+ KilnModel(
1065
+ family=ModelFamily.gemma,
1066
+ name=ModelName.gemma_3_4b,
1067
+ friendly_name="Gemma 3 4B",
1068
+ providers=[
1069
+ KilnModelProvider(
1070
+ name=ModelProviderName.ollama,
1071
+ model_id="gemma3:4b",
1072
+ ollama_model_aliases=["gemma3"],
1073
+ ),
1074
+ KilnModelProvider(
1075
+ name=ModelProviderName.openrouter,
1076
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
1077
+ # TODO: swap to non-free model when available (more reliable)
1078
+ model_id="google/gemma-3-4b-it:free",
1079
+ ),
1080
+ ],
1081
+ ),
1082
+ # Gemma 3 12B
1083
+ KilnModel(
1084
+ family=ModelFamily.gemma,
1085
+ name=ModelName.gemma_3_12b,
1086
+ friendly_name="Gemma 3 12B",
1087
+ providers=[
1088
+ KilnModelProvider(
1089
+ name=ModelProviderName.ollama,
1090
+ model_id="gemma3:12b",
1091
+ ),
1092
+ KilnModelProvider(
1093
+ name=ModelProviderName.openrouter,
1094
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
1095
+ # TODO: swap to non-free model when available (more reliable)
1096
+ model_id="google/gemma-3-12b-it:free",
1097
+ ),
1098
+ ],
1099
+ ),
1100
+ # Gemma 3 27B
1101
+ KilnModel(
1102
+ family=ModelFamily.gemma,
1103
+ name=ModelName.gemma_3_27b,
1104
+ friendly_name="Gemma 3 27B",
1105
+ providers=[
1106
+ KilnModelProvider(
1107
+ name=ModelProviderName.ollama,
1108
+ model_id="gemma3:27b",
1109
+ ),
1110
+ KilnModelProvider(
1111
+ name=ModelProviderName.openrouter,
1112
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
1113
+ model_id="google/gemma-3-27b-it",
1114
+ ),
1115
+ KilnModelProvider(
1116
+ name=ModelProviderName.huggingface,
1117
+ model_id="google/gemma-3-27b-it",
1118
+ structured_output_mode=StructuredOutputMode.json_instructions,
747
1119
  ),
748
1120
  ],
749
1121
  ),
@@ -755,13 +1127,58 @@ built_in_models: List[KilnModel] = [
755
1127
  providers=[
756
1128
  KilnModelProvider(
757
1129
  name=ModelProviderName.openrouter,
758
- provider_options={"model": "mistralai/mixtral-8x7b-instruct"},
1130
+ model_id="mistralai/mixtral-8x7b-instruct",
759
1131
  supports_data_gen=False,
760
1132
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
761
1133
  ),
762
1134
  KilnModelProvider(
763
1135
  name=ModelProviderName.ollama,
764
- provider_options={"model": "mixtral"},
1136
+ model_id="mixtral",
1137
+ ),
1138
+ ],
1139
+ ),
1140
+ # QwQ 32B
1141
+ KilnModel(
1142
+ family=ModelFamily.qwen,
1143
+ name=ModelName.qwq_32b,
1144
+ friendly_name="QwQ 32B (Qwen Reasoning)",
1145
+ providers=[
1146
+ KilnModelProvider(
1147
+ name=ModelProviderName.openrouter,
1148
+ model_id="qwen/qwq-32b",
1149
+ reasoning_capable=True,
1150
+ require_openrouter_reasoning=True,
1151
+ r1_openrouter_options=True,
1152
+ structured_output_mode=StructuredOutputMode.json_instructions,
1153
+ parser=ModelParserID.r1_thinking,
1154
+ ),
1155
+ KilnModelProvider(
1156
+ name=ModelProviderName.fireworks_ai,
1157
+ model_id="accounts/fireworks/models/qwq-32b",
1158
+ reasoning_capable=True,
1159
+ parser=ModelParserID.r1_thinking,
1160
+ structured_output_mode=StructuredOutputMode.json_instructions,
1161
+ ),
1162
+ KilnModelProvider(
1163
+ name=ModelProviderName.ollama,
1164
+ model_id="qwq",
1165
+ reasoning_capable=True,
1166
+ parser=ModelParserID.r1_thinking,
1167
+ structured_output_mode=StructuredOutputMode.json_instructions,
1168
+ ),
1169
+ KilnModelProvider(
1170
+ name=ModelProviderName.groq,
1171
+ model_id="qwen-qwq-32b",
1172
+ reasoning_capable=True,
1173
+ parser=ModelParserID.r1_thinking,
1174
+ structured_output_mode=StructuredOutputMode.json_instructions,
1175
+ ),
1176
+ KilnModelProvider(
1177
+ name=ModelProviderName.together_ai,
1178
+ model_id="Qwen/QwQ-32B",
1179
+ structured_output_mode=StructuredOutputMode.json_instructions,
1180
+ parser=ModelParserID.r1_thinking,
1181
+ reasoning_capable=True,
765
1182
  ),
766
1183
  ],
767
1184
  ),
@@ -773,12 +1190,29 @@ built_in_models: List[KilnModel] = [
773
1190
  providers=[
774
1191
  KilnModelProvider(
775
1192
  name=ModelProviderName.openrouter,
776
- provider_options={"model": "qwen/qwen-2.5-7b-instruct"},
1193
+ model_id="qwen/qwen-2.5-7b-instruct",
777
1194
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
778
1195
  ),
779
1196
  KilnModelProvider(
780
1197
  name=ModelProviderName.ollama,
781
- provider_options={"model": "qwen2.5"},
1198
+ model_id="qwen2.5",
1199
+ ),
1200
+ ],
1201
+ ),
1202
+ # Qwen 2.5 14B
1203
+ KilnModel(
1204
+ family=ModelFamily.qwen,
1205
+ name=ModelName.qwen_2p5_14b,
1206
+ friendly_name="Qwen 2.5 14B",
1207
+ providers=[
1208
+ KilnModelProvider(
1209
+ name=ModelProviderName.together_ai,
1210
+ provider_finetune_id="Qwen/Qwen2.5-14B-Instruct",
1211
+ ),
1212
+ KilnModelProvider(
1213
+ name=ModelProviderName.ollama,
1214
+ model_id="qwen2.5:14b",
1215
+ supports_data_gen=False,
782
1216
  ),
783
1217
  ],
784
1218
  ),
@@ -790,7 +1224,7 @@ built_in_models: List[KilnModel] = [
790
1224
  providers=[
791
1225
  KilnModelProvider(
792
1226
  name=ModelProviderName.openrouter,
793
- provider_options={"model": "qwen/qwen-2.5-72b-instruct"},
1227
+ model_id="qwen/qwen-2.5-72b-instruct",
794
1228
  # Not consistent with structure data. Works sometimes but not often
795
1229
  supports_structured_output=False,
796
1230
  supports_data_gen=False,
@@ -798,17 +1232,17 @@ built_in_models: List[KilnModel] = [
798
1232
  ),
799
1233
  KilnModelProvider(
800
1234
  name=ModelProviderName.ollama,
801
- provider_options={"model": "qwen2.5:72b"},
1235
+ model_id="qwen2.5:72b",
802
1236
  ),
803
1237
  KilnModelProvider(
804
1238
  name=ModelProviderName.fireworks_ai,
805
- provider_options={
806
- "model": "accounts/fireworks/models/qwen2p5-72b-instruct"
807
- },
808
- # Fireworks will start tuning, but it never finishes.
809
- # provider_finetune_id="accounts/fireworks/models/qwen2p5-72b-instruct",
1239
+ model_id="accounts/fireworks/models/qwen2p5-72b-instruct",
810
1240
  # Tool calling forces schema -- fireworks doesn't support json_schema, just json_mode
811
- structured_output_mode=StructuredOutputMode.function_calling,
1241
+ structured_output_mode=StructuredOutputMode.function_calling_weak,
1242
+ ),
1243
+ KilnModelProvider(
1244
+ name=ModelProviderName.together_ai,
1245
+ provider_finetune_id="Qwen/Qwen2.5-72B-Instruct",
812
1246
  ),
813
1247
  ],
814
1248
  ),
@@ -821,11 +1255,11 @@ built_in_models: List[KilnModel] = [
821
1255
  KilnModelProvider(
822
1256
  name=ModelProviderName.openrouter,
823
1257
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
824
- provider_options={"model": "mistralai/mistral-small-24b-instruct-2501"},
1258
+ model_id="mistralai/mistral-small-24b-instruct-2501",
825
1259
  ),
826
1260
  KilnModelProvider(
827
1261
  name=ModelProviderName.ollama,
828
- provider_options={"model": "mistral-small:24b"},
1262
+ model_id="mistral-small:24b",
829
1263
  ),
830
1264
  ],
831
1265
  ),
@@ -837,16 +1271,21 @@ built_in_models: List[KilnModel] = [
837
1271
  providers=[
838
1272
  KilnModelProvider(
839
1273
  name=ModelProviderName.openrouter,
840
- provider_options={"model": "deepseek/deepseek-chat"},
1274
+ model_id="deepseek/deepseek-chat",
841
1275
  structured_output_mode=StructuredOutputMode.function_calling,
842
1276
  ),
843
1277
  KilnModelProvider(
844
1278
  name=ModelProviderName.fireworks_ai,
845
- provider_options={"model": "accounts/fireworks/models/deepseek-v3"},
846
- structured_output_mode=StructuredOutputMode.json_mode,
1279
+ model_id="accounts/fireworks/models/deepseek-v3",
1280
+ structured_output_mode=StructuredOutputMode.json_instruction_and_object,
847
1281
  supports_structured_output=True,
848
1282
  supports_data_gen=False,
849
1283
  ),
1284
+ KilnModelProvider(
1285
+ name=ModelProviderName.together_ai,
1286
+ model_id="deepseek-ai/DeepSeek-V3",
1287
+ structured_output_mode=StructuredOutputMode.json_instructions,
1288
+ ),
850
1289
  ],
851
1290
  ),
852
1291
  # DeepSeek R1
@@ -857,8 +1296,8 @@ built_in_models: List[KilnModel] = [
857
1296
  providers=[
858
1297
  KilnModelProvider(
859
1298
  name=ModelProviderName.openrouter,
860
- provider_options={"model": "deepseek/deepseek-r1"},
861
- # No custom parser -- openrouter implemented it themselves
1299
+ model_id="deepseek/deepseek-r1",
1300
+ parser=ModelParserID.r1_thinking,
862
1301
  structured_output_mode=StructuredOutputMode.json_instructions,
863
1302
  reasoning_capable=True,
864
1303
  r1_openrouter_options=True,
@@ -866,7 +1305,7 @@ built_in_models: List[KilnModel] = [
866
1305
  ),
867
1306
  KilnModelProvider(
868
1307
  name=ModelProviderName.fireworks_ai,
869
- provider_options={"model": "accounts/fireworks/models/deepseek-r1"},
1308
+ model_id="accounts/fireworks/models/deepseek-r1",
870
1309
  parser=ModelParserID.r1_thinking,
871
1310
  structured_output_mode=StructuredOutputMode.json_instructions,
872
1311
  reasoning_capable=True,
@@ -874,11 +1313,18 @@ built_in_models: List[KilnModel] = [
874
1313
  KilnModelProvider(
875
1314
  # I want your RAM
876
1315
  name=ModelProviderName.ollama,
877
- provider_options={"model": "deepseek-r1:671b"},
1316
+ model_id="deepseek-r1:671b",
878
1317
  parser=ModelParserID.r1_thinking,
879
1318
  structured_output_mode=StructuredOutputMode.json_instructions,
880
1319
  reasoning_capable=True,
881
1320
  ),
1321
+ KilnModelProvider(
1322
+ name=ModelProviderName.together_ai,
1323
+ model_id="deepseek-ai/DeepSeek-R1",
1324
+ structured_output_mode=StructuredOutputMode.json_instructions,
1325
+ parser=ModelParserID.r1_thinking,
1326
+ reasoning_capable=True,
1327
+ ),
882
1328
  ],
883
1329
  ),
884
1330
  # DeepSeek R1 Distill Qwen 32B
@@ -891,8 +1337,9 @@ built_in_models: List[KilnModel] = [
891
1337
  name=ModelProviderName.openrouter,
892
1338
  reasoning_capable=True,
893
1339
  structured_output_mode=StructuredOutputMode.json_instructions,
894
- provider_options={"model": "deepseek/deepseek-r1-distill-qwen-32b"},
1340
+ model_id="deepseek/deepseek-r1-distill-qwen-32b",
895
1341
  r1_openrouter_options=True,
1342
+ parser=ModelParserID.r1_thinking,
896
1343
  require_openrouter_reasoning=True,
897
1344
  ),
898
1345
  KilnModelProvider(
@@ -900,7 +1347,14 @@ built_in_models: List[KilnModel] = [
900
1347
  parser=ModelParserID.r1_thinking,
901
1348
  reasoning_capable=True,
902
1349
  structured_output_mode=StructuredOutputMode.json_instructions,
903
- provider_options={"model": "deepseek-r1:32b"},
1350
+ model_id="deepseek-r1:32b",
1351
+ ),
1352
+ KilnModelProvider(
1353
+ name=ModelProviderName.together_ai,
1354
+ model_id="deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
1355
+ structured_output_mode=StructuredOutputMode.json_instructions,
1356
+ parser=ModelParserID.r1_thinking,
1357
+ reasoning_capable=True,
904
1358
  ),
905
1359
  ],
906
1360
  ),
@@ -914,9 +1368,10 @@ built_in_models: List[KilnModel] = [
914
1368
  name=ModelProviderName.openrouter,
915
1369
  reasoning_capable=True,
916
1370
  structured_output_mode=StructuredOutputMode.json_instructions,
917
- provider_options={"model": "deepseek/deepseek-r1-distill-llama-70b"},
1371
+ model_id="deepseek/deepseek-r1-distill-llama-70b",
918
1372
  r1_openrouter_options=True,
919
1373
  require_openrouter_reasoning=True,
1374
+ parser=ModelParserID.r1_thinking,
920
1375
  ),
921
1376
  KilnModelProvider(
922
1377
  name=ModelProviderName.ollama,
@@ -924,7 +1379,13 @@ built_in_models: List[KilnModel] = [
924
1379
  parser=ModelParserID.r1_thinking,
925
1380
  reasoning_capable=True,
926
1381
  structured_output_mode=StructuredOutputMode.json_instructions,
927
- provider_options={"model": "deepseek-r1:70b"},
1382
+ model_id="deepseek-r1:70b",
1383
+ ),
1384
+ KilnModelProvider(
1385
+ name=ModelProviderName.together_ai,
1386
+ model_id="deepseek-ai/DeepSeek-R1-Distill-Llama-70B",
1387
+ structured_output_mode=StructuredOutputMode.json_instructions,
1388
+ parser=ModelParserID.r1_thinking,
928
1389
  ),
929
1390
  ],
930
1391
  ),
@@ -939,10 +1400,11 @@ built_in_models: List[KilnModel] = [
939
1400
  supports_data_gen=False,
940
1401
  reasoning_capable=True,
941
1402
  structured_output_mode=StructuredOutputMode.json_instructions,
942
- provider_options={"model": "deepseek/deepseek-r1-distill-qwen-14b"},
1403
+ model_id="deepseek/deepseek-r1-distill-qwen-14b",
943
1404
  r1_openrouter_options=True,
944
1405
  require_openrouter_reasoning=True,
945
1406
  openrouter_skip_required_parameters=True,
1407
+ parser=ModelParserID.r1_thinking,
946
1408
  ),
947
1409
  KilnModelProvider(
948
1410
  name=ModelProviderName.ollama,
@@ -950,7 +1412,13 @@ built_in_models: List[KilnModel] = [
950
1412
  parser=ModelParserID.r1_thinking,
951
1413
  reasoning_capable=True,
952
1414
  structured_output_mode=StructuredOutputMode.json_instructions,
953
- provider_options={"model": "deepseek-r1:14b"},
1415
+ model_id="deepseek-r1:14b",
1416
+ ),
1417
+ KilnModelProvider(
1418
+ name=ModelProviderName.together_ai,
1419
+ model_id="deepseek-ai/DeepSeek-R1-Distill-Qwen-14B",
1420
+ structured_output_mode=StructuredOutputMode.json_instructions,
1421
+ parser=ModelParserID.r1_thinking,
954
1422
  ),
955
1423
  ],
956
1424
  ),
@@ -962,21 +1430,26 @@ built_in_models: List[KilnModel] = [
962
1430
  providers=[
963
1431
  KilnModelProvider(
964
1432
  name=ModelProviderName.openrouter,
1433
+ supports_structured_output=False,
965
1434
  supports_data_gen=False,
966
1435
  reasoning_capable=True,
1436
+ # Best mode, but fails to often to enable without warning
967
1437
  structured_output_mode=StructuredOutputMode.json_instructions,
968
- provider_options={"model": "deepseek/deepseek-r1-distill-llama-8b"},
1438
+ model_id="deepseek/deepseek-r1-distill-llama-8b",
969
1439
  r1_openrouter_options=True,
970
1440
  require_openrouter_reasoning=True,
971
1441
  openrouter_skip_required_parameters=True,
1442
+ parser=ModelParserID.r1_thinking,
972
1443
  ),
973
1444
  KilnModelProvider(
974
1445
  name=ModelProviderName.ollama,
1446
+ supports_structured_output=False,
975
1447
  supports_data_gen=False,
976
1448
  parser=ModelParserID.r1_thinking,
977
1449
  reasoning_capable=True,
1450
+ # Best mode, but fails to often to enable without warning
978
1451
  structured_output_mode=StructuredOutputMode.json_instructions,
979
- provider_options={"model": "deepseek-r1:8b"},
1452
+ model_id="deepseek-r1:8b",
980
1453
  ),
981
1454
  ],
982
1455
  ),
@@ -988,11 +1461,13 @@ built_in_models: List[KilnModel] = [
988
1461
  providers=[
989
1462
  KilnModelProvider(
990
1463
  name=ModelProviderName.ollama,
1464
+ # Best mode, but fails to often to enable without warning
1465
+ supports_structured_output=False,
991
1466
  supports_data_gen=False,
992
1467
  parser=ModelParserID.r1_thinking,
993
1468
  reasoning_capable=True,
994
1469
  structured_output_mode=StructuredOutputMode.json_instructions,
995
- provider_options={"model": "deepseek-r1:7b"},
1470
+ model_id="deepseek-r1:7b",
996
1471
  ),
997
1472
  ],
998
1473
  ),
@@ -1008,18 +1483,28 @@ built_in_models: List[KilnModel] = [
1008
1483
  supports_data_gen=False,
1009
1484
  reasoning_capable=True,
1010
1485
  structured_output_mode=StructuredOutputMode.json_instructions,
1011
- provider_options={"model": "deepseek/deepseek-r1-distill-qwen-1.5b"},
1486
+ model_id="deepseek/deepseek-r1-distill-qwen-1.5b",
1012
1487
  r1_openrouter_options=True,
1013
1488
  require_openrouter_reasoning=True,
1014
1489
  openrouter_skip_required_parameters=True,
1490
+ parser=ModelParserID.r1_thinking,
1015
1491
  ),
1016
1492
  KilnModelProvider(
1017
1493
  name=ModelProviderName.ollama,
1494
+ supports_structured_output=False,
1018
1495
  supports_data_gen=False,
1019
1496
  parser=ModelParserID.r1_thinking,
1020
1497
  reasoning_capable=True,
1021
1498
  structured_output_mode=StructuredOutputMode.json_instructions,
1022
- provider_options={"model": "deepseek-r1:1.5b"},
1499
+ model_id="deepseek-r1:1.5b",
1500
+ ),
1501
+ KilnModelProvider(
1502
+ name=ModelProviderName.together_ai,
1503
+ model_id="deepseek-ai/DeepSeek-R1-Distill-Qwen-1.5B",
1504
+ structured_output_mode=StructuredOutputMode.json_instructions,
1505
+ parser=ModelParserID.r1_thinking,
1506
+ supports_structured_output=False,
1507
+ supports_data_gen=False,
1023
1508
  ),
1024
1509
  ],
1025
1510
  ),
@@ -1033,15 +1518,13 @@ built_in_models: List[KilnModel] = [
1033
1518
  name=ModelProviderName.ollama,
1034
1519
  structured_output_mode=StructuredOutputMode.json_schema,
1035
1520
  supports_data_gen=True,
1036
- provider_options={"model": "dolphin-mixtral:8x22b"},
1521
+ model_id="dolphin-mixtral:8x22b",
1037
1522
  ),
1038
1523
  KilnModelProvider(
1039
1524
  name=ModelProviderName.openrouter,
1040
- provider_options={
1041
- "model": "cognitivecomputations/dolphin-mixtral-8x22b"
1042
- },
1043
1525
  supports_data_gen=True,
1044
1526
  structured_output_mode=StructuredOutputMode.json_instruction_and_object,
1527
+ model_id="cognitivecomputations/dolphin-mixtral-8x22b",
1045
1528
  ),
1046
1529
  ],
1047
1530
  ),
@@ -1053,7 +1536,7 @@ built_in_models: List[KilnModel] = [
1053
1536
  providers=[
1054
1537
  KilnModelProvider(
1055
1538
  name=ModelProviderName.openrouter,
1056
- provider_options={"model": "x-ai/grok-2-1212"},
1539
+ model_id="x-ai/grok-2-1212",
1057
1540
  supports_structured_output=True,
1058
1541
  supports_data_gen=True,
1059
1542
  structured_output_mode=StructuredOutputMode.json_schema,