Skip to content

Commit

Permalink
Add basic deepseek R1 support.
Browse files Browse the repository at this point in the history
I say basic because I should add:
 - <thinking> tags get moved into our intermediate result
 - The output shouldn't have thinking tags
 - The two above items should make structured output work, but should eval how well and tweak calling params if needed
  • Loading branch information
scosman committed Jan 26, 2025
1 parent c83a286 commit 00251df
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions libs/core/kiln_ai/adapters/ml_model_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class ModelName(str, Enum):
qwen_2p5_7b = "qwen_2p5_7b"
qwen_2p5_72b = "qwen_2p5_72b"
deepseek_3 = "deepseek_3"
deepseek_r1 = "deepseek_r1"


class KilnModelProvider(BaseModel):
Expand Down Expand Up @@ -191,6 +192,37 @@ class KilnModel(BaseModel):
),
],
),
# DeepSeek R1
KilnModel(
family=ModelFamily.deepseek,
name=ModelName.deepseek_r1,
friendly_name="DeepSeek R1",
# TODO: Add support for structured output by removing <thinking> tags. Openrouter works as it's already stripping them.
providers=[
KilnModelProvider(
name=ModelProviderName.openrouter,
provider_options={"model": "deepseek/deepseek-r1"},
adapter_options={
"langchain": {
"with_structured_output_options": {"method": "json_mode"}
}
},
),
KilnModelProvider(
name=ModelProviderName.fireworks_ai,
provider_options={"model": "accounts/fireworks/models/deepseek-r1"},
supports_structured_output=False,
supports_data_gen=False,
),
KilnModelProvider(
# I want your RAM
name=ModelProviderName.ollama,
provider_options={"model": "deepseek-r1:671b"},
supports_structured_output=False,
supports_data_gen=False,
),
],
),
# Gemini 1.5 Pro
KilnModel(
family=ModelFamily.gemini,
Expand Down

0 comments on commit 00251df

Please sign in to comment.