feat: Add option to pass custom kwargs to litellm.completion (#11423)

Co-authored-by: Ray Myers <ray.myers@gmail.com>
This commit is contained in:
Nick Ludwig
2025-10-28 01:07:31 +04:00
committed by GitHub
parent 8de13457c3
commit 92b1fca719
3 changed files with 31 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ class LLMConfig(BaseModel):
seed: The seed to use for the LLM.
safety_settings: Safety settings for models that support them (like Mistral AI and Gemini).
for_routing: Whether this LLM is used for routing. This is set to True for models used in conjunction with the main LLM in the model routing feature.
completion_kwargs: Custom kwargs to pass to litellm.completion.
"""
model: str = Field(default='claude-sonnet-4-20250514')
@@ -94,6 +95,10 @@ class LLMConfig(BaseModel):
description='Safety settings for models that support them (like Mistral AI and Gemini)',
)
for_routing: bool = Field(default=False)
completion_kwargs: dict[str, Any] | None = Field(
default=None,
description='Custom kwargs to pass to litellm.completion',
)
model_config = ConfigDict(extra='forbid')