diff --git a/dist/litellm-0.1.630-py3-none-any.whl b/dist/litellm-0.1.630-py3-none-any.whl new file mode 100644 index 000000000..9ab14d56f Binary files /dev/null and b/dist/litellm-0.1.630-py3-none-any.whl differ diff --git a/dist/litellm-0.1.630.tar.gz b/dist/litellm-0.1.630.tar.gz new file mode 100644 index 000000000..849c2e2b7 Binary files /dev/null and b/dist/litellm-0.1.630.tar.gz differ diff --git a/dist/litellm-0.1.631-py3-none-any.whl b/dist/litellm-0.1.631-py3-none-any.whl new file mode 100644 index 000000000..9bf6667fe Binary files /dev/null and b/dist/litellm-0.1.631-py3-none-any.whl differ diff --git a/dist/litellm-0.1.631.tar.gz b/dist/litellm-0.1.631.tar.gz new file mode 100644 index 000000000..45ab10c9d Binary files /dev/null and b/dist/litellm-0.1.631.tar.gz differ diff --git a/litellm/__pycache__/__init__.cpython-311.pyc b/litellm/__pycache__/__init__.cpython-311.pyc index 8b54c3254..58688f27f 100644 Binary files a/litellm/__pycache__/__init__.cpython-311.pyc and b/litellm/__pycache__/__init__.cpython-311.pyc differ diff --git a/litellm/__pycache__/utils.cpython-311.pyc b/litellm/__pycache__/utils.cpython-311.pyc index 11ad024d4..ac9c4d897 100644 Binary files a/litellm/__pycache__/utils.cpython-311.pyc and b/litellm/__pycache__/utils.cpython-311.pyc differ diff --git a/litellm/utils.py b/litellm/utils.py index 7df4330c4..e3547dc1c 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -180,10 +180,6 @@ class Logging: # Log the exact input to the LLM API print_verbose(f"Logging Details Pre-API Call for call id {self.litellm_call_id}") try: - if start_time is None: - start_time = self.start_time - if end_time is None: - end_time = datetime.datetime.now() # print_verbose(f"logging pre call for model: {self.model} with call type: {self.call_type}") self.model_call_details["input"] = input self.model_call_details["api_key"] = api_key @@ -207,6 +203,8 @@ class Logging: ) if litellm.max_budget and self.stream: + start_time = self.start_time + end_time = self.start_time # no time has passed as the call hasn't been made yet time_diff = (end_time - start_time).total_seconds() float_diff = float(time_diff) litellm._current_cost += litellm.completion_cost(model=self.model, prompt="".join(message["content"] for message in self.messages), completion="", total_time=float_diff) diff --git a/pyproject.toml b/pyproject.toml index 120ca1df3..dd424cb15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "litellm" -version = "0.1.630" +version = "0.1.632" description = "Library to easily interface with LLM API providers" authors = ["BerriAI"] license = "MIT License"