We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 79b9810 commit 97d60a8Copy full SHA for 97d60a8
backend/onyx/llm/utils.py
@@ -3,6 +3,7 @@
3
import json
4
from collections.abc import Callable
5
from collections.abc import Iterator
6
+from functools import lru_cache
7
from typing import Any
8
from typing import cast
9
from typing import TYPE_CHECKING
@@ -384,6 +385,7 @@ def test_llm(llm: LLM) -> str | None:
384
385
return error_msg
386
387
388
+@lru_cache(maxsize=1) # the copy.deepcopy is expensive, so we cache the result
389
def get_model_map() -> dict:
390
starting_map = copy.deepcopy(cast(dict, litellm.model_cost))
391
0 commit comments