Skip to content

Commit 0871015

Browse files
committed
remove unnecessary litellm reference
1 parent 8e3513c commit 0871015

File tree

7 files changed

+36
-36
lines changed

7 files changed

+36
-36
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""DeepEval LLM Manager - DeepEval-specific LLM wrapper that takes LiteLLM parameters."""
1+
"""DeepEval LLM Manager - DeepEval-specific LLM wrapper."""
22

33
from typing import Any
44

@@ -11,32 +11,32 @@ class DeepEvalLLMManager:
1111
This manager focuses solely on DeepEval-specific LLM integration.
1212
"""
1313

14-
def __init__(self, model_name: str, litellm_params: dict[str, Any]):
14+
def __init__(self, model_name: str, llm_params: dict[str, Any]):
1515
"""Initialize with LLM parameters from LLMManager."""
1616
self.model_name = model_name
17-
self.litellm_params = litellm_params
17+
self.llm_params = llm_params
1818

19-
# Create DeepEval's LiteLLMModel with provided parameters
19+
# Create DeepEval's LLM model with provided parameters
2020
self.llm_model = LiteLLMModel(
2121
model=self.model_name,
22-
temperature=litellm_params.get("temperature", 0.0),
23-
max_tokens=litellm_params.get("max_tokens"),
24-
timeout=litellm_params.get("timeout"),
25-
num_retries=litellm_params.get("num_retries", 3),
22+
temperature=llm_params.get("temperature", 0.0),
23+
max_tokens=llm_params.get("max_tokens"),
24+
timeout=llm_params.get("timeout"),
25+
num_retries=llm_params.get("num_retries", 3),
2626
)
2727

2828
print(f"✅ DeepEval LLM Manager: {self.model_name}")
2929

3030
def get_llm(self) -> LiteLLMModel:
31-
"""Get the configured DeepEval LiteLLM model."""
31+
"""Get the configured DeepEval LLM model."""
3232
return self.llm_model
3333

3434
def get_model_info(self) -> dict[str, Any]:
3535
"""Get information about the configured model."""
3636
return {
3737
"model_name": self.model_name,
38-
"temperature": self.litellm_params.get("temperature", 0.0),
39-
"max_tokens": self.litellm_params.get("max_tokens"),
40-
"timeout": self.litellm_params.get("timeout"),
41-
"num_retries": self.litellm_params.get("num_retries", 3),
38+
"temperature": self.llm_params.get("temperature", 0.0),
39+
"max_tokens": self.llm_params.get("max_tokens"),
40+
"timeout": self.llm_params.get("timeout"),
41+
"num_retries": self.llm_params.get("num_retries", 3),
4242
}

src/lightspeed_evaluation/core/llm/manager.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class LLMManager:
1313
Responsibilities:
1414
- Environment validation for multiple providers
1515
- Model name construction
16-
- Provides LiteLLM parameters for consumption by framework-specific managers
16+
- Provides LLM parameters for consumption by framework-specific managers
1717
"""
1818

1919
def __init__(self, config: LLMConfig):
@@ -25,7 +25,7 @@ def __init__(self, config: LLMConfig):
2525
)
2626

2727
def _construct_model_name_and_validate(self) -> str:
28-
"""Construct model name for LiteLLM and validate required environment variables."""
28+
"""Construct model name and validate required environment variables."""
2929
provider = self.config.provider.lower()
3030

3131
# Provider-specific validation and model name construction
@@ -89,11 +89,11 @@ def _handle_ollama_provider(self) -> str:
8989
return f"ollama/{self.config.model}"
9090

9191
def get_model_name(self) -> str:
92-
"""Get the constructed LiteLLM model name."""
92+
"""Get the constructed model name."""
9393
return self.model_name
9494

95-
def get_litellm_params(self) -> dict[str, Any]:
96-
"""Get parameters for LiteLLM completion calls."""
95+
def get_llm_params(self) -> dict[str, Any]:
96+
"""Get parameters for LLM completion calls."""
9797
return {
9898
"model": self.model_name,
9999
"temperature": self.config.temperature,

src/lightspeed_evaluation/core/llm/ragas.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Ragas LLM Manager - Ragas-specific LLM wrapper that takes LiteLLM parameters."""
1+
"""Ragas LLM Manager - Ragas-specific LLM wrapper."""
22

33
from typing import Any, Optional
44

@@ -10,12 +10,12 @@
1010

1111

1212
class RagasCustomLLM(BaseRagasLLM, BaseCustomLLM):
13-
"""Custom LLM for Ragas using LiteLLM parameters."""
13+
"""Custom LLM for Ragas."""
1414

15-
def __init__(self, model_name: str, litellm_params: dict[str, Any]):
16-
"""Initialize Ragas custom LLM with model name and LiteLLM parameters."""
15+
def __init__(self, model_name: str, llm_params: dict[str, Any]):
16+
"""Initialize Ragas custom LLM with model name and LLM parameters."""
1717
BaseRagasLLM.__init__(self)
18-
BaseCustomLLM.__init__(self, model_name, litellm_params)
18+
BaseCustomLLM.__init__(self, model_name, llm_params)
1919
print(f"✅ Ragas Custom LLM: {self.model_name}")
2020

2121
def generate_text( # pylint: disable=too-many-arguments,too-many-positional-arguments
@@ -26,14 +26,14 @@ def generate_text( # pylint: disable=too-many-arguments,too-many-positional-arg
2626
stop: Optional[list[str]] = None,
2727
callbacks: Optional[Any] = None,
2828
) -> LLMResult:
29-
"""Generate text using LiteLLM with provided parameters."""
29+
"""Generate text using LLM with provided parameters."""
3030
prompt_text = str(prompt)
3131

3232
# Use temperature from params unless explicitly overridden
3333
temp = (
3434
temperature
3535
if temperature != 1e-08
36-
else self.litellm_params.get("temperature", 0.0)
36+
else self.llm_params.get("temperature", 0.0)
3737
)
3838

3939
try:
@@ -84,11 +84,11 @@ class RagasLLMManager:
8484
This manager focuses solely on Ragas-specific LLM integration.
8585
"""
8686

87-
def __init__(self, model_name: str, litellm_params: dict[str, Any]):
87+
def __init__(self, model_name: str, llm_params: dict[str, Any]):
8888
"""Initialize with LLM parameters from LLMManager."""
8989
self.model_name = model_name
90-
self.litellm_params = litellm_params
91-
self.custom_llm = RagasCustomLLM(model_name, litellm_params)
90+
self.llm_params = llm_params
91+
self.custom_llm = RagasCustomLLM(model_name, llm_params)
9292

9393
# Configure Ragas metrics to use our custom LLM
9494
answer_relevancy.llm = self.custom_llm
@@ -104,5 +104,5 @@ def get_model_info(self) -> dict[str, Any]:
104104
"""Get information about the configured model."""
105105
return {
106106
"model_name": self.model_name,
107-
"temperature": self.litellm_params.get("temperature", 0.0),
107+
"temperature": self.llm_params.get("temperature", 0.0),
108108
}

src/lightspeed_evaluation/core/metrics/custom.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class EvaluationPromptParams(BaseModel):
2828

2929

3030
class CustomMetrics: # pylint: disable=too-few-public-methods
31-
"""Handles custom metrics using LLMManager for direct LiteLLM calls."""
31+
"""Handles custom metrics using LLMManager for direct LLM calls."""
3232

3333
def __init__(self, llm_manager: LLMManager):
3434
"""Initialize with LLM Manager.
@@ -37,7 +37,7 @@ def __init__(self, llm_manager: LLMManager):
3737
llm_manager: Pre-configured LLMManager with validated parameters
3838
"""
3939
self.llm = BaseCustomLLM(
40-
llm_manager.get_model_name(), llm_manager.get_litellm_params()
40+
llm_manager.get_model_name(), llm_manager.get_llm_params()
4141
)
4242

4343
self.supported_metrics = {

src/lightspeed_evaluation/core/metrics/deepeval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def __init__(self, llm_manager: LLMManager):
2626
"""
2727
# Create LLM Manager for DeepEval metrics
2828
self.llm_manager = DeepEvalLLMManager(
29-
llm_manager.get_model_name(), llm_manager.get_litellm_params()
29+
llm_manager.get_model_name(), llm_manager.get_llm_params()
3030
)
3131

3232
self.supported_metrics = {

src/lightspeed_evaluation/core/metrics/ragas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def __init__(self, llm_manager: LLMManager, embedding_manager: EmbeddingManager)
3636
# Note, it's not actually used, it modifies
3737
# global ragas.metrics settings during instance init
3838
self.llm_manager = RagasLLMManager(
39-
llm_manager.get_model_name(), llm_manager.get_litellm_params()
39+
llm_manager.get_model_name(), llm_manager.get_llm_params()
4040
)
4141
self.embedding_manager = RagasEmbeddingManager(embedding_manager)
4242

tests/unit/core/llm/test_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ def test_get_model_name(self):
6666
manager = LLMManager(config)
6767
assert manager.get_model_name() == "gpt-4"
6868

69-
def test_get_litellm_params(self):
70-
"""Test get_litellm_params method."""
69+
def test_get_llm_params(self):
70+
"""Test get_llm_params method."""
7171
config = LLMConfig(
7272
provider="openai",
7373
model="gpt-4",
@@ -79,7 +79,7 @@ def test_get_litellm_params(self):
7979

8080
with patch.dict(os.environ, {"OPENAI_API_KEY": "test-key"}):
8181
manager = LLMManager(config)
82-
params = manager.get_litellm_params()
82+
params = manager.get_llm_params()
8383

8484
expected = {
8585
"model": "gpt-4",

0 commit comments

Comments
 (0)