litellm/tests/proxy_unit_tests
Krish Dholakia 2bd41dc034
Guardrails - Responses API, Image Gen, Text completions, Audio transcriptions, Audio Speech, Rerank, Anthropic Messages API support via the unified apply_guardrails function (#15706)
* fix(presidio.py): handle content as a list of texts

covers openai + anthropic messages api

* fix(presidio.py): safe get messages

* test: add unit testing for presidio guardrails

* fix(unified_guardrail.py): initial commit

* fix(enkryptai.py): implement apply_guardrail to enkrypt guardrail

* fix(unified_guardrail.py): support unified guardrail on input

* feat(unified_guardrail.py): add post call success hook implementation

allows us to just have 1 place to handle llm translation to guardrail api spec

* refactor: refactor initial unified guardrail component

* refactor: more refactoring

* feat(responses/): add guardrails to responses api

allows existing guardrails to work for new llm endpoints

* docs(adding_guardrail_support.md): document new guardrail endpoint support

* test: add unit tests

* feat(image_generation/): add guardrail support for image generation endpoint

* feat(openai/text_completion): support guardrails on `/v1/completions` API

* docs: document guardrails support on new endpoints

* docs: clarify when guardrails run

* feat(openai/speech): add guardrail support for input

* docs(rerank/): add guardrail support on input query

* fix: fix ruff check
2025-10-25 13:38:57 -07:00
..
example_config_yaml fix tests 2025-10-25 10:19:24 -07:00
test_configs fix tests 2025-10-25 10:19:24 -07:00
test_model_response_typing
adroit-crow-413218-bc47f303efc9.json
azure_fine_tune.jsonl
batch_job_results_furniture.jsonl
conftest copy.py
conftest.py
data_map.txt
eagle.wav
gettysburg.wav
large_text.py
messages_with_counts.py
model_cost.json
openai_batch_completions_router.jsonl
openai_batch_completions.jsonl
speech_vertex.mp3
test_aproxy_startup.py
test_audit_logs_proxy.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_auth_checks.py [Performance] RPS Improvement +500 RPS when sending the user field (#14616) 2025-09-16 16:18:23 -07:00
test_banned_keyword_list.py
test_custom_callback_input.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_custom_logger_s3_gcs.py [Feat] Allow reading custom logger python scripts from s3 (#12623) 2025-07-16 15:07:01 -07:00
test_custom_tokenizer_bug.py fix(token-counter): extract model_info from deployment for custom_tokenizer (#15657) (#15680) 2025-10-17 19:38:45 -07:00
test_db_schema_changes.py
test_db_schema_migration.py Revert "Security fix - prevent proxy_admin_viewer from modifying other user's credentials + remove hardcoded sensitive keys from test repo" (#14362) 2025-09-08 18:40:54 -07:00
test_deployed_proxy_keygen.py
test_e2e_pod_lock_manager.py fix: use fastuuid helper (#14903) 2025-09-25 15:47:01 -07:00
test_google_gemini_proxy_request.py remove not needed names (#14641) 2025-09-17 14:26:48 -07:00
test_jwt.py test_end_user_jwt_auth 2025-10-02 18:48:11 -07:00
test_key_generate_dynamodb.py
test_key_generate_prisma.py Merge branch 'main' into litellm_view_key_pagination_calls_fix 2025-10-06 18:10:57 -07:00
test_models_fallback_endpoint.py feat: extended /v1/models endpoint, now it returns with fallbacks on demand (#12811) 2025-07-22 23:16:46 -07:00
test_prisma_client_backoff_retry.py fix: prisma client state retries (#14925) 2025-09-25 21:54:00 -07:00
test_proxy_config_unit_test.py
test_proxy_custom_auth.py
test_proxy_custom_logger.py test_embedding 2025-09-27 16:57:27 -07:00
test_proxy_encrypt_decrypt.py test: fix test 2025-07-27 09:52:22 -07:00
test_proxy_exception_mapping.py Litellm fix proxy unit testing p2 (#12779) 2025-07-19 16:35:05 -07:00
test_proxy_gunicorn.py
test_proxy_pass_user_config.py fix tests 2025-10-25 10:19:24 -07:00
test_proxy_reject_logging.py [Security Bug Fix] Ensure only LLM API route fails get logged on Langfuse (and other loggers) (#12308) 2025-07-04 14:42:42 -07:00
test_proxy_routes.py
test_proxy_server_caching.py
test_proxy_server_keys.py fix tests 2025-10-25 10:19:24 -07:00
test_proxy_server_langfuse.py
test_proxy_server_spend.py
test_proxy_server.py fix tests 2025-10-25 10:19:24 -07:00
test_proxy_setting_guardrails.py
test_proxy_token_counter.py Apply code formatting and linting fixes 2025-09-18 08:28:17 +02:00
test_proxy_utils.py Guardrails - Responses API, Image Gen, Text completions, Audio transcriptions, Audio Speech, Rerank, Anthropic Messages API support via the unified apply_guardrails function (#15706) 2025-10-25 13:38:57 -07:00
test_unit_test_max_model_budget_limiter.py
test_unit_test_proxy_hooks.py
test_update_spend.py attempt to avoid/minimize deadlocks (#15281) 2025-10-24 12:22:38 -07:00
test_user_api_key_auth.py [Feat] Allow using query_params for setting API Key for generateContent routes (#13100) 2025-07-29 14:11:06 -07:00
vertex_key.json