Avatar for the BerriAI user
BerriAI
litellm
BlogDocsChangelog

fix(proxy): defer async logging until post-call guardrails complete

#23929Closed
Comparing
michelligabriele:fix/deferred-logging-post-call-guardrails
(
a564c1b
) with
main
(
e5baa22
)
CodSpeed Performance Gauge
+1%
Untouched
16

Benchmarks

16 total
test_get_model_cost_key_exact_match
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+2%
87.2 µs85.5 µs
test_get_model_info_openai
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+2%
88.6 µs87 µs
test_get_model_cost_key_case_insensitive
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+2%
89.4 µs87.8 µs
test_token_counter_multi_turn
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+2%
574.2 µs565.7 µs
test_get_model_info_anthropic
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+1%
85.3 µs84.1 µs
test_get_model_info_with_provider
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+1%
87.1 µs85.9 µs
test_token_counter_long_content
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
+1%
1.7 ms1.7 ms
test_get_llm_provider_openai
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
142.9 µs143.6 µs
test_cost_per_token_openai
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
546.8 µs544.5 µs
test_token_counter_with_tools
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
418.4 µs416.9 µs
test_token_counter_raw_text
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
187.3 µs186.7 µs
test_cost_per_token_anthropic
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
546.4 µs544.8 µs
test_token_counter_simple_message
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
239.9 µs239.5 µs
test_get_llm_provider_azure
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
149.1 µs149.2 µs
test_get_llm_provider_anthropic
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
146.8 µs146.9 µs
test_get_llm_provider_with_prefix
tests/benchmarks/test_benchmarks.py
CodSpeed Performance Gauge
0%
142.1 µs142.1 µs

Commits

Click on a commit to change the comparison range
Base
main
e5baa22
+0.48%
fix(proxy): defer async logging until post-call guardrails complete
5242986
6 months ago
by michelligabriele
+0.04%
address Greptile review: module-level imports, document streaming scope and sync callback deferral
f746e4c
6 months ago
by michelligabriele
-0.36%
keep sync callbacks immediate, only defer create_task
313355b
6 months ago
by michelligabriele
+0.39%
wrap deferred logging in try/except to prevent exception masking
6a4e742
6 months ago
by michelligabriele
-0.15%
skip deferral flag on streaming requests, deduplicate sync callbacks, simplify guardrail detection, add list event_hook tests
ffde40c
6 months ago
by michelligabriele
+0.39%
extend deferred logging to streaming via closure on logging_obj
b4122c6
6 months ago
by michelligabriele
-0.2%
skip inline post_call_success_hook when streaming closure is set to prevent double invocation
4a867b6
6 months ago
by michelligabriele
+0.06%
clear streaming closure on fallthrough to preserve inline hook and prevent double invocation
10e3829
6 months ago
by michelligabriele
+0.15%
document streaming post-call guardrails as audit-only in code and docs
aa2e358
6 months ago
by michelligabriele
-0.08%
capture proxy_logging_obj explicitly, add integration test for production closure
a564c1b
6 months ago
by michelligabriele
© 2026 CodSpeed Technology
Home Terms Privacy Docs