mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
(litellm SDK perf improvements) - handle cases when unable to lookup model in model cost map (#7750)
* use lru cache wrapper * use lru_cache_wrapper for _cached_get_model_info_helper * fix _get_traceback_str_for_error * huggingface/mistralai/Mistral-7B-Instruct-v0.3
This commit is contained in:
parent
c8ac61f117
commit
d88f01d518
3 changed files with 42 additions and 2 deletions
|
@ -57,6 +57,7 @@ import litellm._service_logger # for storing API inputs, outputs, and metadata
|
|||
import litellm.litellm_core_utils
|
||||
import litellm.litellm_core_utils.audio_utils.utils
|
||||
import litellm.litellm_core_utils.json_validation_rule
|
||||
from litellm.caching._internal_lru_cache import lru_cache_wrapper
|
||||
from litellm.caching.caching import DualCache
|
||||
from litellm.caching.caching_handler import CachingHandlerResponse, LLMCachingHandler
|
||||
from litellm.integrations.custom_logger import CustomLogger
|
||||
|
@ -4013,7 +4014,7 @@ def _get_max_position_embeddings(model_name: str) -> Optional[int]:
|
|||
return None
|
||||
|
||||
|
||||
@lru_cache(maxsize=16)
|
||||
@lru_cache_wrapper(maxsize=16)
|
||||
def _cached_get_model_info_helper(
|
||||
model: str, custom_llm_provider: Optional[str]
|
||||
) -> ModelInfoBase:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue