mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-03 01:38:46 +00:00
* fix(guardrails): classify only the frames each read completes in Presidio's first-frame wait Presidio's wait for the first frame with a JSON object re-split and re-classified its whole buffer on every read, so a long run of leading non-object frames cost CPU quadratic in the number of reads. It now buffers in a bytearray, finds frame ends only in the newly read bytes, and classifies only the frames that read completed * test(guardrails): check Presidio's first-frame wait classifies each byte once instead of timing it The test guide bans checks that depend on execution speed, so the CPU-time limit on the many-leading-reads test is replaced by a test that each read is handed only the frames it completed, including frame ends split across reads * test(guardrails): drive Presidio's real first-frame wait in its per-read classification test The test copied the wait's loop, so it still passed if the wait itself dropped the offset the classifier returns. The wait now takes the classifier as a parameter, defaulting to the one it called before, and the test runs the real wait with a recording classifier. The classifier docstring now says the caller relays the preface * test(benchmarks): benchmark Presidio's first-frame wait over many leading reads and a frame split into many reads Unit tests can't check the wait's cost without timing it, so CodSpeed now times the real wait over 6000 leading non-object reads and over one 48 KB frame in 16-byte reads. Rescanning every classified frame for a JSON object, or searching the whole unclassified tail for a frame end, makes these runs many times slower * test(proxy): check the SSE frame-end search directly --------- Co-authored-by: mateo-berri <277851410+mateo-berri@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| akto | ||
| aporia_ai | ||
| azure | ||
| content_filter | ||
| dynamoai | ||
| guardrails_ai | ||
| ibm_guardrails | ||
| javelin | ||
| litellm_content_filter | ||
| noma | ||
| openai | ||
| semantic_guard | ||
| unified_guardrails | ||
| zscaler_ai_guard | ||
| __init__.py | ||
| _cisco_ai_defense_test_utils.py | ||
| code_execution_compliance_dataset.json | ||
| conftest.py | ||
| test_agent_365.py | ||
| test_aim.py | ||
| test_airia.py | ||
| test_alice.py | ||
| test_bedrock_guardrail_tool_text_scans.py | ||
| test_bedrock_guardrails.py | ||
| test_bedrock_invoke_guardrail_checks.py | ||
| test_block_code_execution.py | ||
| test_block_code_execution_compliance.py | ||
| test_cato_networks.py | ||
| test_cisco_ai_defense_chat.py | ||
| test_cisco_ai_defense_mcp.py | ||
| test_collieai.py | ||
| test_compresr.py | ||
| test_conduct.py | ||
| test_crowdstrike_aidr.py | ||
| test_custom_code_bounded_execution.py | ||
| test_decision_model.py | ||
| test_deepkeep.py | ||
| test_dynamoai.py | ||
| test_enkryptai.py | ||
| test_generic_guardrail_api.py | ||
| test_grayswan.py | ||
| test_headroom.py | ||
| test_hiddenlayer.py | ||
| test_javelin.py | ||
| test_lakera_ai.py | ||
| test_lakera_ai_v2.py | ||
| test_lasso.py | ||
| test_llm_shield_proxy.py | ||
| test_mcp_end_user_permission.py | ||
| test_mcp_security.py | ||
| test_microsoft_purview.py | ||
| test_model_armor.py | ||
| test_noma.py | ||
| test_noma_v2.py | ||
| test_onyx.py | ||
| test_ovalix.py | ||
| test_ovalix_extraction.py | ||
| test_pangea.py | ||
| test_panw_prisma_airs.py | ||
| test_presidio.py | ||
| test_presidio_union_fix.py | ||
| test_promptguard.py | ||
| test_qualifire.py | ||
| test_reco.py | ||
| test_repelloai.py | ||
| test_response_rejection_guardrail_code.py | ||
| test_singulr.py | ||
| test_straiker.py | ||
| test_structured_messages_writeback.py | ||
| test_tool_permission.py | ||
| test_tool_policy_guardrail.py | ||
| test_typesafe.py | ||
| test_vigil_guard.py | ||
| test_wingback.py | ||
| test_xecguard.py | ||