Skip to content

Commit

Permalink
Updated caching support with LiteLLM and added UT for caching
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhil authored and nikhil committed Nov 3, 2024
1 parent 13252af commit f127cba
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/tests/lm_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ def test_filter_caching(setup_models):
# Verify results are the same
assert filtered_df1.equals(filtered_df2)

assert gpt_4o_mini.api_calls == 0
assert initial_api_calls == 0
# Verify first call made API calls
assert first_call_api_count == 0, "First call should make API calls"

Expand Down
1 change: 0 additions & 1 deletion lotus/models/lm.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ def __call__(self, messages: list[dict[str, str]] | list[list[dict[str, str]]],
if kwargs.get("logprobs", False):
kwargs["top_logprobs"] = kwargs.get("top_logprobs", 10)

request=ujson.dumps(dict(model=self.model, messages=messages, **kwargs))
if cache:
messages_tuple = self._messages_to_cache_key(messages)
responses = self._cached_completion(messages_tuple, **kwargs_for_batch)
Expand Down

0 comments on commit f127cba

Please sign in to comment.