Skip to content

Commit 945f4f8

Browse files
authored
Security: Remove Litellm (#750)
1 parent c73704e commit 945f4f8

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

backend/app/models/llm/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
],
3333
}
3434

35+
# OpenAI models that support reasoning (effort parameter)
36+
OPENAI_REASONING_MODELS: set[str] = {"o1", "o1-preview", "o1-mini"}
37+
3538
SUPPORTED_VOICES = {
3639
("google", "tts"): ["Kore", "Orus", "Leda", "Charon"],
3740
("sarvamai", "tts"): ["simran", "shubh", "roopa"],

backend/app/services/llm/mappers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import litellm
21
import logging
32

43
from app.models.llm import KaapiCompletionConfig, NativeCompletionConfig
@@ -7,6 +6,7 @@
76
BCP47_TO_ELEVENLABS_LANG,
87
ELEVENLABS_VOICE_TO_ID,
98
DEFAULT_TTS_VOICE,
9+
OPENAI_REASONING_MODELS,
1010
)
1111

1212
logger = logging.getLogger(__name__)
@@ -67,7 +67,7 @@ def map_kaapi_to_openai_params(kaapi_params: dict) -> tuple[dict, list[str]]:
6767
knowledge_base_ids = kaapi_params.get("knowledge_base_ids")
6868
max_num_results = kaapi_params.get("max_num_results")
6969

70-
support_reasoning = litellm.supports_reasoning(model=f"openai/{model}")
70+
support_reasoning = model in OPENAI_REASONING_MODELS
7171

7272
# Handle reasoning vs temperature mutual exclusivity
7373
if support_reasoning:

backend/pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ override-dependencies = [
5353
"cryptography>=46.0.5",
5454
"werkzeu>=3.1.6",
5555
"pypdf>=3.9.0",
56+
# Pinned: avoid supply chain attack in litellm 1.82.7/1.82.8 (Mar 2026)
57+
"litellm==1.82.1",
5658
]
5759
dev-dependencies = [
5860
"pytest<8.0.0,>=7.4.3",

backend/uv.lock

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)