mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
ci: replace type-check baselines with per-file count budgets
The mypy and basedpyright baselines were position-sensitive (and the
basedpyright one was a 27MB file), so ordinary line shifts churned them.
Replace both with a per-file count gate: scripts/type_check_gate.py reduces
each tool's output to errors-per-file and checks it against a committed
{file: max} budget, ignoring line and column numbers. A file fails only
when it gains more errors than its ceiling; debt can't be shuffled between
files because each file has its own cap and new files default to zero.
Budgets (mypy-file-budget.json 48K, basedpyright-file-budget.json 96K) are
generated in the python 3.12 frozen lint env so they match CI. Drops the
mypy-baseline dependency; basedpyright runs without its native baseline.
ratchet via make lint-mypy-budget-update / lint-basedpyright-budget-update.
This commit is contained in:
parent
3497dffa49
commit
d533ed9e26
10 changed files with 2622 additions and 944796 deletions
939528
.basedpyright/baseline.json
939528
.basedpyright/baseline.json
File diff suppressed because it is too large
Load diff
4
.github/workflows/test-linting.yml
vendored
4
.github/workflows/test-linting.yml
vendored
|
|
@ -80,11 +80,11 @@ jobs:
|
|||
- name: Run MyPy type checking
|
||||
run: |
|
||||
cd litellm
|
||||
(uv run --no-sync mypy . || true) | uv run --no-sync mypy-baseline filter --baseline-path .mypy-baseline.txt
|
||||
(uv run --no-sync mypy . || true) | uv run --no-sync python ../scripts/type_check_gate.py --tool mypy
|
||||
|
||||
- name: Run basedpyright type checking
|
||||
run: |
|
||||
uv run --no-sync basedpyright
|
||||
(uv run --no-sync basedpyright || true) | uv run --no-sync python scripts/type_check_gate.py --tool basedpyright
|
||||
|
||||
- name: Check for circular imports
|
||||
run: |
|
||||
|
|
|
|||
22
Makefile
22
Makefile
|
|
@ -5,7 +5,7 @@
|
|||
test-unit-integrations test-unit-core-utils test-unit-other test-unit-root \
|
||||
test-proxy-unit-a test-proxy-unit-b test-integration test-unit-helm \
|
||||
info lint lint-dev format \
|
||||
lint-mypy lint-mypy-baseline-update lint-basedpyright lint-basedpyright-baseline-update \
|
||||
lint-mypy lint-mypy-budget-update lint-basedpyright lint-basedpyright-budget-update \
|
||||
lint-strict-budget lint-strict-budget-update \
|
||||
install-dev install-proxy-dev install-test-deps install-hooks \
|
||||
install-helm-unittest check-circular-imports check-import-safety
|
||||
|
|
@ -24,10 +24,10 @@ help:
|
|||
@echo " make format-check - Check Black code formatting (matches CI)"
|
||||
@echo " make lint - Run all linting (Ruff, MyPy, Black check, circular imports, import safety)"
|
||||
@echo " make lint-ruff - Run Ruff linting only"
|
||||
@echo " make lint-mypy - Run MyPy (disallow_untyped_defs) filtered through its baseline"
|
||||
@echo " make lint-mypy-baseline-update - Re-capture the MyPy baseline (ratchet)"
|
||||
@echo " make lint-basedpyright - Run basedpyright strict, gated by its baseline"
|
||||
@echo " make lint-basedpyright-baseline-update - Re-capture the basedpyright baseline (ratchet)"
|
||||
@echo " make lint-mypy - Run MyPy (disallow_untyped_defs), gated by per-file error counts"
|
||||
@echo " make lint-mypy-budget-update - Re-capture the MyPy per-file budget (ratchet)"
|
||||
@echo " make lint-basedpyright - Run basedpyright strict, gated by per-file error counts"
|
||||
@echo " make lint-basedpyright-budget-update - Re-capture the basedpyright per-file budget (ratchet)"
|
||||
@echo " make lint-black - Check Black formatting (matches CI)"
|
||||
@echo " make lint-strict-budget - Gate the codebase total of each strict ruff rule against its ceiling"
|
||||
@echo " make lint-strict-budget-update - Re-capture per-rule baselines in ruff-strict-budget.json (ratchet)"
|
||||
|
|
@ -125,16 +125,16 @@ lint-ruff-FULL-dev: install-dev
|
|||
else echo "No changed .py files to check."; fi
|
||||
|
||||
lint-mypy: install-dev
|
||||
cd litellm && ($(UV_RUN) mypy . || true) | $(UV_RUN) mypy-baseline filter --baseline-path .mypy-baseline.txt
|
||||
cd litellm && ($(UV_RUN) mypy . || true) | $(UV_RUN) python ../scripts/type_check_gate.py --tool mypy
|
||||
|
||||
lint-mypy-baseline-update: install-dev
|
||||
cd litellm && ($(UV_RUN) mypy . || true) | $(UV_RUN) mypy-baseline sync --baseline-path .mypy-baseline.txt
|
||||
lint-mypy-budget-update: install-dev
|
||||
cd litellm && ($(UV_RUN) mypy . || true) | $(UV_RUN) python ../scripts/type_check_gate.py --tool mypy --update
|
||||
|
||||
lint-basedpyright: install-dev
|
||||
$(UV_RUN) basedpyright
|
||||
($(UV_RUN) basedpyright || true) | $(UV_RUN) python scripts/type_check_gate.py --tool basedpyright
|
||||
|
||||
lint-basedpyright-baseline-update: install-dev
|
||||
$(UV_RUN) basedpyright --writebaseline
|
||||
lint-basedpyright-budget-update: install-dev
|
||||
($(UV_RUN) basedpyright || true) | $(UV_RUN) python scripts/type_check_gate.py --tool basedpyright --update
|
||||
|
||||
lint-black: format-check
|
||||
|
||||
|
|
|
|||
1611
basedpyright-file-budget.json
Normal file
1611
basedpyright-file-budget.json
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
841
mypy-file-budget.json
Normal file
841
mypy-file-budget.json
Normal file
|
|
@ -0,0 +1,841 @@
|
|||
{
|
||||
"enterprise/enterprise_hooks/__init__.py": 1,
|
||||
"enterprise/enterprise_hooks/aporia_ai.py": 5,
|
||||
"enterprise/enterprise_hooks/banned_keywords.py": 8,
|
||||
"enterprise/enterprise_hooks/blocked_user_list.py": 3,
|
||||
"enterprise/enterprise_hooks/google_text_moderation.py": 3,
|
||||
"enterprise/enterprise_hooks/openai_moderation.py": 2,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/callback_controls.py": 1,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/example_logging_api.py": 1,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/llama_guard.py": 3,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/llm_guard.py": 4,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/pagerduty/pagerduty.py": 5,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/secret_detection.py": 3,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/send_emails/base_email.py": 12,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/send_emails/endpoints.py": 6,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/send_emails/resend_email.py": 2,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/send_emails/sendgrid_email.py": 2,
|
||||
"enterprise/litellm_enterprise/enterprise_callbacks/send_emails/smtp_email.py": 2,
|
||||
"enterprise/litellm_enterprise/proxy/audit_logging_endpoints.py": 2,
|
||||
"enterprise/litellm_enterprise/proxy/auth/route_checks.py": 1,
|
||||
"enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py": 2,
|
||||
"enterprise/litellm_enterprise/proxy/common_utils/check_responses_cost.py": 1,
|
||||
"enterprise/litellm_enterprise/proxy/enterprise_routes.py": 1,
|
||||
"enterprise/litellm_enterprise/proxy/hooks/managed_files.py": 2,
|
||||
"enterprise/litellm_enterprise/proxy/management_endpoints/internal_user_endpoints.py": 1,
|
||||
"enterprise/litellm_enterprise/proxy/management_endpoints/project_endpoints.py": 6,
|
||||
"enterprise/litellm_enterprise/proxy/utils.py": 1,
|
||||
"enterprise/litellm_enterprise/proxy/vector_stores/endpoints.py": 5,
|
||||
"litellm/__init__.py": 3,
|
||||
"litellm/_logging.py": 15,
|
||||
"litellm/_redis.py": 16,
|
||||
"litellm/_service_logger.py": 9,
|
||||
"litellm/_uuid.py": 1,
|
||||
"litellm/a2a_protocol/providers/base.py": 2,
|
||||
"litellm/a2a_protocol/providers/bedrock_agentcore/config.py": 2,
|
||||
"litellm/a2a_protocol/providers/langflow/config.py": 2,
|
||||
"litellm/a2a_protocol/providers/pydantic_ai_agents/config.py": 1,
|
||||
"litellm/a2a_protocol/streaming_iterator.py": 1,
|
||||
"litellm/anthropic_interface/messages/__init__.py": 2,
|
||||
"litellm/assistants/main.py": 18,
|
||||
"litellm/assistants/utils.py": 6,
|
||||
"litellm/batch_completion/main.py": 5,
|
||||
"litellm/batches/main.py": 14,
|
||||
"litellm/budget_manager.py": 14,
|
||||
"litellm/caching/_internal_lru_cache.py": 2,
|
||||
"litellm/caching/azure_blob_cache.py": 6,
|
||||
"litellm/caching/base_cache.py": 8,
|
||||
"litellm/caching/caching.py": 28,
|
||||
"litellm/caching/caching_handler.py": 6,
|
||||
"litellm/caching/disk_cache.py": 14,
|
||||
"litellm/caching/dual_cache.py": 25,
|
||||
"litellm/caching/gcs_cache.py": 7,
|
||||
"litellm/caching/in_memory_cache.py": 19,
|
||||
"litellm/caching/llm_caching_handler.py": 5,
|
||||
"litellm/caching/qdrant_semantic_cache.py": 9,
|
||||
"litellm/caching/redis_cache.py": 29,
|
||||
"litellm/caching/redis_cluster_cache.py": 2,
|
||||
"litellm/caching/redis_semantic_cache.py": 9,
|
||||
"litellm/caching/s3_cache.py": 8,
|
||||
"litellm/completion_extras/litellm_responses_transformation/handler.py": 3,
|
||||
"litellm/completion_extras/litellm_responses_transformation/transformation.py": 3,
|
||||
"litellm/containers/endpoint_factory.py": 4,
|
||||
"litellm/containers/main.py": 24,
|
||||
"litellm/cost_calculator.py": 5,
|
||||
"litellm/endpoints/speech/speech_to_completion_bridge/handler.py": 1,
|
||||
"litellm/evals/main.py": 22,
|
||||
"litellm/exceptions.py": 58,
|
||||
"litellm/experimental_mcp_client/client.py": 10,
|
||||
"litellm/files/main.py": 12,
|
||||
"litellm/fine_tuning/main.py": 11,
|
||||
"litellm/google_genai/adapters/handler.py": 2,
|
||||
"litellm/google_genai/adapters/transformation.py": 3,
|
||||
"litellm/google_genai/main.py": 5,
|
||||
"litellm/google_genai/streaming_iterator.py": 11,
|
||||
"litellm/images/main.py": 8,
|
||||
"litellm/integrations/SlackAlerting/batching_handler.py": 4,
|
||||
"litellm/integrations/SlackAlerting/hanging_request_check.py": 4,
|
||||
"litellm/integrations/SlackAlerting/slack_alerting.py": 29,
|
||||
"litellm/integrations/additional_logging_utils.py": 1,
|
||||
"litellm/integrations/agentops/agentops.py": 1,
|
||||
"litellm/integrations/argilla.py": 9,
|
||||
"litellm/integrations/arize/_utils.py": 36,
|
||||
"litellm/integrations/arize/arize.py": 9,
|
||||
"litellm/integrations/arize/arize_phoenix.py": 15,
|
||||
"litellm/integrations/arize/arize_phoenix_client.py": 1,
|
||||
"litellm/integrations/arize/arize_phoenix_prompt_manager.py": 3,
|
||||
"litellm/integrations/athina.py": 2,
|
||||
"litellm/integrations/azure_sentinel/azure_sentinel.py": 6,
|
||||
"litellm/integrations/azure_storage/azure_storage.py": 13,
|
||||
"litellm/integrations/bitbucket/bitbucket_client.py": 1,
|
||||
"litellm/integrations/bitbucket/bitbucket_prompt_manager.py": 3,
|
||||
"litellm/integrations/braintrust_logging.py": 7,
|
||||
"litellm/integrations/braintrust_mock_client.py": 2,
|
||||
"litellm/integrations/cloudzero/cloudzero.py": 7,
|
||||
"litellm/integrations/cloudzero/cz_resource_names.py": 1,
|
||||
"litellm/integrations/cloudzero/database.py": 1,
|
||||
"litellm/integrations/cloudzero/transform.py": 2,
|
||||
"litellm/integrations/custom_batch_logger.py": 4,
|
||||
"litellm/integrations/custom_guardrail.py": 8,
|
||||
"litellm/integrations/custom_logger.py": 22,
|
||||
"litellm/integrations/custom_prompt_management.py": 1,
|
||||
"litellm/integrations/custom_secret_manager.py": 1,
|
||||
"litellm/integrations/datadog/datadog.py": 9,
|
||||
"litellm/integrations/datadog/datadog_cost_management.py": 4,
|
||||
"litellm/integrations/datadog/datadog_llm_obs.py": 6,
|
||||
"litellm/integrations/datadog/datadog_metrics.py": 6,
|
||||
"litellm/integrations/deepeval/api.py": 8,
|
||||
"litellm/integrations/deepeval/deepeval.py": 10,
|
||||
"litellm/integrations/deepeval/utils.py": 1,
|
||||
"litellm/integrations/dotprompt/prompt_manager.py": 1,
|
||||
"litellm/integrations/dynamodb.py": 3,
|
||||
"litellm/integrations/focus/database.py": 1,
|
||||
"litellm/integrations/focus/transformer.py": 2,
|
||||
"litellm/integrations/galileo.py": 5,
|
||||
"litellm/integrations/gcs_bucket/gcs_bucket.py": 5,
|
||||
"litellm/integrations/gcs_bucket/gcs_bucket_base.py": 6,
|
||||
"litellm/integrations/gcs_bucket/gcs_bucket_mock_client.py": 7,
|
||||
"litellm/integrations/gcs_pubsub/pub_sub.py": 3,
|
||||
"litellm/integrations/generic_api/generic_api_callback.py": 7,
|
||||
"litellm/integrations/generic_prompt_management/generic_prompt_manager.py": 1,
|
||||
"litellm/integrations/gitlab/gitlab_client.py": 1,
|
||||
"litellm/integrations/gitlab/gitlab_prompt_manager.py": 3,
|
||||
"litellm/integrations/greenscale.py": 2,
|
||||
"litellm/integrations/helicone.py": 3,
|
||||
"litellm/integrations/humanloop.py": 1,
|
||||
"litellm/integrations/lago.py": 5,
|
||||
"litellm/integrations/langfuse/langfuse.py": 19,
|
||||
"litellm/integrations/langfuse/langfuse_mock_client.py": 1,
|
||||
"litellm/integrations/langfuse/langfuse_otel.py": 10,
|
||||
"litellm/integrations/langfuse/langfuse_otel_attributes.py": 3,
|
||||
"litellm/integrations/langfuse/langfuse_prompt_management.py": 7,
|
||||
"litellm/integrations/langsmith.py": 15,
|
||||
"litellm/integrations/langtrace.py": 10,
|
||||
"litellm/integrations/levo/levo.py": 1,
|
||||
"litellm/integrations/literal_ai.py": 13,
|
||||
"litellm/integrations/logfire_logger.py": 6,
|
||||
"litellm/integrations/lunary.py": 7,
|
||||
"litellm/integrations/mlflow.py": 14,
|
||||
"litellm/integrations/mock_client_factory.py": 9,
|
||||
"litellm/integrations/newrelic/newrelic.py": 13,
|
||||
"litellm/integrations/openmeter.py": 6,
|
||||
"litellm/integrations/opentelemetry.py": 57,
|
||||
"litellm/integrations/opentelemetry_utils/base_otel_llm_obs_attributes.py": 5,
|
||||
"litellm/integrations/opentelemetry_utils/gen_ai_semconv.py": 2,
|
||||
"litellm/integrations/opik/utils.py": 2,
|
||||
"litellm/integrations/otel/logger.py": 3,
|
||||
"litellm/integrations/otel/presets/arize.py": 1,
|
||||
"litellm/integrations/posthog.py": 10,
|
||||
"litellm/integrations/prometheus.py": 59,
|
||||
"litellm/integrations/prometheus_helpers/__init__.py": 1,
|
||||
"litellm/integrations/prometheus_helpers/prometheus_api.py": 3,
|
||||
"litellm/integrations/prometheus_services.py": 16,
|
||||
"litellm/integrations/prompt_layer.py": 2,
|
||||
"litellm/integrations/prompt_management_base.py": 1,
|
||||
"litellm/integrations/rubrik.py": 8,
|
||||
"litellm/integrations/s3.py": 3,
|
||||
"litellm/integrations/s3_v2.py": 9,
|
||||
"litellm/integrations/sqs.py": 4,
|
||||
"litellm/integrations/supabase.py": 3,
|
||||
"litellm/integrations/traceloop.py": 2,
|
||||
"litellm/integrations/vector_store_integrations/vector_store_pre_call_hook.py": 1,
|
||||
"litellm/integrations/weave/weave_otel.py": 7,
|
||||
"litellm/integrations/weights_biases.py": 2,
|
||||
"litellm/interactions/agents/main.py": 11,
|
||||
"litellm/interactions/litellm_responses_transformation/handler.py": 2,
|
||||
"litellm/interactions/litellm_responses_transformation/transformation.py": 1,
|
||||
"litellm/interactions/main.py": 8,
|
||||
"litellm/interactions/streaming_iterator.py": 5,
|
||||
"litellm/litellm_core_utils/asyncify.py": 2,
|
||||
"litellm/litellm_core_utils/core_helpers.py": 4,
|
||||
"litellm/litellm_core_utils/coroutine_checker.py": 1,
|
||||
"litellm/litellm_core_utils/credential_accessor.py": 1,
|
||||
"litellm/litellm_core_utils/dd_tracing.py": 9,
|
||||
"litellm/litellm_core_utils/duration_parser.py": 1,
|
||||
"litellm/litellm_core_utils/exception_mapping_utils.py": 3,
|
||||
"litellm/litellm_core_utils/fallback_utils.py": 2,
|
||||
"litellm/litellm_core_utils/get_litellm_params.py": 1,
|
||||
"litellm/litellm_core_utils/get_llm_provider_logic.py": 1,
|
||||
"litellm/litellm_core_utils/health_check_helpers.py": 1,
|
||||
"litellm/litellm_core_utils/json_validation_rule.py": 1,
|
||||
"litellm/litellm_core_utils/litellm_logging.py": 37,
|
||||
"litellm/litellm_core_utils/llm_request_utils.py": 2,
|
||||
"litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py": 6,
|
||||
"litellm/litellm_core_utils/logging_callback_manager.py": 16,
|
||||
"litellm/litellm_core_utils/logging_utils.py": 7,
|
||||
"litellm/litellm_core_utils/logging_worker.py": 4,
|
||||
"litellm/litellm_core_utils/mock_functions.py": 2,
|
||||
"litellm/litellm_core_utils/prompt_templates/factory.py": 43,
|
||||
"litellm/litellm_core_utils/realtime_streaming.py": 7,
|
||||
"litellm/litellm_core_utils/redact_messages.py": 12,
|
||||
"litellm/litellm_core_utils/rules.py": 1,
|
||||
"litellm/litellm_core_utils/streaming_handler.py": 36,
|
||||
"litellm/litellm_core_utils/token_counter.py": 7,
|
||||
"litellm/llms/__init__.py": 1,
|
||||
"litellm/llms/a2a/chat/streaming_iterator.py": 1,
|
||||
"litellm/llms/ai21/chat/transformation.py": 1,
|
||||
"litellm/llms/amazon_nova/chat/transformation.py": 1,
|
||||
"litellm/llms/anthropic/batches/handler.py": 1,
|
||||
"litellm/llms/anthropic/batches/transformation.py": 1,
|
||||
"litellm/llms/anthropic/chat/guardrail_translation/handler.py": 1,
|
||||
"litellm/llms/anthropic/chat/handler.py": 13,
|
||||
"litellm/llms/anthropic/chat/transformation.py": 3,
|
||||
"litellm/llms/anthropic/common_utils.py": 1,
|
||||
"litellm/llms/anthropic/completion/transformation.py": 3,
|
||||
"litellm/llms/anthropic/experimental_pass_through/adapters/handler.py": 2,
|
||||
"litellm/llms/anthropic/experimental_pass_through/adapters/streaming_iterator.py": 3,
|
||||
"litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py": 3,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/agentic_streaming_iterator.py": 1,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/fake_stream_iterator.py": 4,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/handler.py": 3,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/interceptors/advisor.py": 2,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/interceptors/base.py": 1,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/streaming_iterator.py": 2,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/transformation.py": 1,
|
||||
"litellm/llms/anthropic/experimental_pass_through/messages/utils.py": 1,
|
||||
"litellm/llms/anthropic/experimental_pass_through/responses_adapters/handler.py": 2,
|
||||
"litellm/llms/anthropic/files/handler.py": 1,
|
||||
"litellm/llms/anthropic/files/transformation.py": 1,
|
||||
"litellm/llms/apiserpent/search/transformation.py": 4,
|
||||
"litellm/llms/aws_polly/text_to_speech/transformation.py": 1,
|
||||
"litellm/llms/azure/assistants.py": 17,
|
||||
"litellm/llms/azure/audio_transcriptions.py": 2,
|
||||
"litellm/llms/azure/azure.py": 17,
|
||||
"litellm/llms/azure/batches/handler.py": 4,
|
||||
"litellm/llms/azure/chat/gpt_transformation.py": 2,
|
||||
"litellm/llms/azure/chat/o_series_handler.py": 2,
|
||||
"litellm/llms/azure/common_utils.py": 2,
|
||||
"litellm/llms/azure/completion/handler.py": 9,
|
||||
"litellm/llms/azure/files/handler.py": 4,
|
||||
"litellm/llms/azure/realtime/handler.py": 2,
|
||||
"litellm/llms/azure/realtime/http_transformation.py": 2,
|
||||
"litellm/llms/azure/videos/transformation.py": 1,
|
||||
"litellm/llms/azure_ai/agents/handler.py": 2,
|
||||
"litellm/llms/azure_ai/agents/transformation.py": 1,
|
||||
"litellm/llms/azure_ai/anthropic/handler.py": 2,
|
||||
"litellm/llms/azure_ai/common_utils.py": 1,
|
||||
"litellm/llms/azure_ai/embed/handler.py": 6,
|
||||
"litellm/llms/azure_ai/ocr/document_intelligence/transformation.py": 5,
|
||||
"litellm/llms/azure_ai/ocr/transformation.py": 4,
|
||||
"litellm/llms/azure_ai/vector_stores/transformation.py": 1,
|
||||
"litellm/llms/base.py": 9,
|
||||
"litellm/llms/base_llm/base_model_iterator.py": 14,
|
||||
"litellm/llms/base_llm/base_utils.py": 1,
|
||||
"litellm/llms/base_llm/batches/transformation.py": 2,
|
||||
"litellm/llms/base_llm/chat/transformation.py": 3,
|
||||
"litellm/llms/base_llm/containers/transformation.py": 2,
|
||||
"litellm/llms/base_llm/evals/transformation.py": 1,
|
||||
"litellm/llms/base_llm/files/azure_blob_storage_backend.py": 6,
|
||||
"litellm/llms/base_llm/files/transformation.py": 1,
|
||||
"litellm/llms/base_llm/google_genai/transformation.py": 2,
|
||||
"litellm/llms/base_llm/image_edit/transformation.py": 2,
|
||||
"litellm/llms/base_llm/interactions/transformation.py": 2,
|
||||
"litellm/llms/base_llm/ocr/transformation.py": 6,
|
||||
"litellm/llms/base_llm/realtime/http_transformation.py": 3,
|
||||
"litellm/llms/base_llm/responses/transformation.py": 2,
|
||||
"litellm/llms/base_llm/search/transformation.py": 4,
|
||||
"litellm/llms/base_llm/skills/transformation.py": 1,
|
||||
"litellm/llms/base_llm/text_to_speech/transformation.py": 2,
|
||||
"litellm/llms/base_llm/videos/transformation.py": 2,
|
||||
"litellm/llms/baseten/chat.py": 1,
|
||||
"litellm/llms/bedrock/base_aws_llm.py": 4,
|
||||
"litellm/llms/bedrock/batches/handler.py": 4,
|
||||
"litellm/llms/bedrock/batches/transformation.py": 5,
|
||||
"litellm/llms/bedrock/chat/__init__.py": 1,
|
||||
"litellm/llms/bedrock/chat/agentcore/transformation.py": 3,
|
||||
"litellm/llms/bedrock/chat/converse_handler.py": 5,
|
||||
"litellm/llms/bedrock/chat/converse_transformation.py": 4,
|
||||
"litellm/llms/bedrock/chat/invoke_agent/transformation.py": 4,
|
||||
"litellm/llms/bedrock/chat/invoke_handler.py": 16,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_ai21_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_cohere_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_llama_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_mistral_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_moonshot_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_nova_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_openai_transformation.py": 1,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/amazon_titan_transformation.py": 2,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/anthropic_claude2_transformation.py": 4,
|
||||
"litellm/llms/bedrock/chat/invoke_transformations/base_invoke_transformation.py": 2,
|
||||
"litellm/llms/bedrock/common_utils.py": 18,
|
||||
"litellm/llms/bedrock/embed/amazon_titan_g1_transformation.py": 1,
|
||||
"litellm/llms/bedrock/embed/amazon_titan_v2_transformation.py": 1,
|
||||
"litellm/llms/bedrock/embed/embedding.py": 5,
|
||||
"litellm/llms/bedrock/files/handler.py": 1,
|
||||
"litellm/llms/bedrock/files/transformation.py": 3,
|
||||
"litellm/llms/bedrock/image_edit/handler.py": 2,
|
||||
"litellm/llms/bedrock/image_generation/amazon_nova_canvas_transformation.py": 1,
|
||||
"litellm/llms/bedrock/image_generation/amazon_stability1_transformation.py": 2,
|
||||
"litellm/llms/bedrock/image_generation/amazon_stability3_transformation.py": 1,
|
||||
"litellm/llms/bedrock/image_generation/amazon_titan_transformation.py": 2,
|
||||
"litellm/llms/bedrock/image_generation/image_handler.py": 1,
|
||||
"litellm/llms/bedrock/messages/invoke_transformations/anthropic_claude3_transformation.py": 2,
|
||||
"litellm/llms/bedrock/realtime/handler.py": 5,
|
||||
"litellm/llms/bedrock/realtime/transformation.py": 1,
|
||||
"litellm/llms/bedrock/rerank/handler.py": 1,
|
||||
"litellm/llms/bedrock/vector_stores/transformation.py": 2,
|
||||
"litellm/llms/bedrock_mantle/chat/transformation.py": 1,
|
||||
"litellm/llms/black_forest_labs/image_edit/handler.py": 1,
|
||||
"litellm/llms/black_forest_labs/image_generation/handler.py": 1,
|
||||
"litellm/llms/brave/search/transformation.py": 4,
|
||||
"litellm/llms/bytez/chat/transformation.py": 4,
|
||||
"litellm/llms/cerebras/chat.py": 1,
|
||||
"litellm/llms/chatgpt/chat/streaming_utils.py": 4,
|
||||
"litellm/llms/chatgpt/common_utils.py": 1,
|
||||
"litellm/llms/chatgpt/responses/transformation.py": 1,
|
||||
"litellm/llms/clarifai/chat/transformation.py": 1,
|
||||
"litellm/llms/cloudflare/chat/transformation.py": 3,
|
||||
"litellm/llms/codestral/completion/handler.py": 9,
|
||||
"litellm/llms/codestral/completion/transformation.py": 2,
|
||||
"litellm/llms/cohere/chat/transformation.py": 3,
|
||||
"litellm/llms/cohere/chat/v2_transformation.py": 1,
|
||||
"litellm/llms/cohere/common_utils.py": 11,
|
||||
"litellm/llms/cohere/embed/handler.py": 5,
|
||||
"litellm/llms/custom_httpx/aiohttp_handler.py": 8,
|
||||
"litellm/llms/custom_httpx/aiohttp_transport.py": 1,
|
||||
"litellm/llms/custom_httpx/async_client_cleanup.py": 3,
|
||||
"litellm/llms/custom_httpx/container_handler.py": 3,
|
||||
"litellm/llms/custom_httpx/http_handler.py": 19,
|
||||
"litellm/llms/custom_httpx/httpx_handler.py": 4,
|
||||
"litellm/llms/custom_httpx/llm_http_handler.py": 45,
|
||||
"litellm/llms/custom_llm.py": 8,
|
||||
"litellm/llms/databricks/chat/transformation.py": 2,
|
||||
"litellm/llms/databricks/embed/handler.py": 1,
|
||||
"litellm/llms/databricks/embed/transformation.py": 3,
|
||||
"litellm/llms/databricks/streaming_utils.py": 5,
|
||||
"litellm/llms/dataforseo/search/transformation.py": 4,
|
||||
"litellm/llms/deepgram/audio_transcription/transformation.py": 1,
|
||||
"litellm/llms/deepinfra/chat/transformation.py": 3,
|
||||
"litellm/llms/deprecated_providers/aleph_alpha.py": 6,
|
||||
"litellm/llms/deprecated_providers/palm.py": 5,
|
||||
"litellm/llms/duckduckgo/search/transformation.py": 4,
|
||||
"litellm/llms/exa_ai/search/transformation.py": 4,
|
||||
"litellm/llms/featherless_ai/chat/transformation.py": 2,
|
||||
"litellm/llms/firecrawl/search/transformation.py": 4,
|
||||
"litellm/llms/fireworks_ai/chat/transformation.py": 3,
|
||||
"litellm/llms/fireworks_ai/embed/fireworks_ai_transformation.py": 3,
|
||||
"litellm/llms/gemini/chat/transformation.py": 1,
|
||||
"litellm/llms/gemini/count_tokens/handler.py": 1,
|
||||
"litellm/llms/gemini/files/transformation.py": 2,
|
||||
"litellm/llms/gemini/google_genai/transformation.py": 1,
|
||||
"litellm/llms/gemini/image_generation/transformation.py": 1,
|
||||
"litellm/llms/gemini/realtime/transformation.py": 2,
|
||||
"litellm/llms/gemini/videos/transformation.py": 10,
|
||||
"litellm/llms/gigachat/chat/streaming.py": 2,
|
||||
"litellm/llms/gigachat/chat/transformation.py": 1,
|
||||
"litellm/llms/gigachat/embedding/transformation.py": 1,
|
||||
"litellm/llms/github_copilot/chat/transformation.py": 2,
|
||||
"litellm/llms/github_copilot/common_utils.py": 1,
|
||||
"litellm/llms/google_pse/search/transformation.py": 4,
|
||||
"litellm/llms/gradient_ai/chat/transformation.py": 2,
|
||||
"litellm/llms/groq/chat/handler.py": 3,
|
||||
"litellm/llms/groq/chat/transformation.py": 2,
|
||||
"litellm/llms/groq/stt/transformation.py": 2,
|
||||
"litellm/llms/huggingface/common_utils.py": 2,
|
||||
"litellm/llms/huggingface/embedding/handler.py": 2,
|
||||
"litellm/llms/huggingface/embedding/transformation.py": 5,
|
||||
"litellm/llms/jina_ai/common_utils.py": 1,
|
||||
"litellm/llms/jina_ai/embedding/transformation.py": 1,
|
||||
"litellm/llms/langflow/chat/transformation.py": 1,
|
||||
"litellm/llms/langgraph/chat/sse_iterator.py": 5,
|
||||
"litellm/llms/langgraph/chat/transformation.py": 1,
|
||||
"litellm/llms/lemonade/chat/transformation.py": 2,
|
||||
"litellm/llms/linkup/search/transformation.py": 4,
|
||||
"litellm/llms/litellm_proxy/chat/transformation.py": 1,
|
||||
"litellm/llms/litellm_proxy/image_generation/transformation.py": 1,
|
||||
"litellm/llms/litellm_proxy/skills/code_execution.py": 1,
|
||||
"litellm/llms/litellm_proxy/skills/handler.py": 2,
|
||||
"litellm/llms/litellm_proxy/skills/transformation.py": 4,
|
||||
"litellm/llms/lm_studio/embed/transformation.py": 1,
|
||||
"litellm/llms/manus/files/transformation.py": 1,
|
||||
"litellm/llms/maritalk.py": 1,
|
||||
"litellm/llms/milvus/vector_stores/transformation.py": 1,
|
||||
"litellm/llms/mistral/chat/transformation.py": 2,
|
||||
"litellm/llms/mistral/ocr/transformation.py": 4,
|
||||
"litellm/llms/nlp_cloud/chat/handler.py": 4,
|
||||
"litellm/llms/nlp_cloud/chat/transformation.py": 1,
|
||||
"litellm/llms/nvidia_nim/embed.py": 3,
|
||||
"litellm/llms/nvidia_nim/rerank/common_utils.py": 1,
|
||||
"litellm/llms/nvidia_riva/audio_transcription/handler.py": 5,
|
||||
"litellm/llms/ollama/chat/transformation.py": 3,
|
||||
"litellm/llms/ollama/common_utils.py": 4,
|
||||
"litellm/llms/ollama/completion/handler.py": 2,
|
||||
"litellm/llms/ollama/completion/transformation.py": 4,
|
||||
"litellm/llms/oobabooga/chat/oobabooga.py": 4,
|
||||
"litellm/llms/openai/chat/gpt_audio_transformation.py": 1,
|
||||
"litellm/llms/openai/chat/gpt_transformation.py": 2,
|
||||
"litellm/llms/openai/chat/o_series_transformation.py": 2,
|
||||
"litellm/llms/openai/common_utils.py": 1,
|
||||
"litellm/llms/openai/completion/handler.py": 9,
|
||||
"litellm/llms/openai/completion/transformation.py": 2,
|
||||
"litellm/llms/openai/completion/utils.py": 1,
|
||||
"litellm/llms/openai/containers/transformation.py": 1,
|
||||
"litellm/llms/openai/fine_tuning/handler.py": 2,
|
||||
"litellm/llms/openai/image_variations/handler.py": 2,
|
||||
"litellm/llms/openai/openai.py": 47,
|
||||
"litellm/llms/openai/realtime/handler.py": 1,
|
||||
"litellm/llms/openai/realtime/http_transformation.py": 2,
|
||||
"litellm/llms/openai/transcriptions/handler.py": 5,
|
||||
"litellm/llms/openai/videos/transformation.py": 1,
|
||||
"litellm/llms/openai_like/chat/handler.py": 9,
|
||||
"litellm/llms/openai_like/chat/transformation.py": 1,
|
||||
"litellm/llms/openai_like/common_utils.py": 2,
|
||||
"litellm/llms/openai_like/dynamic_config.py": 3,
|
||||
"litellm/llms/openai_like/embedding/handler.py": 3,
|
||||
"litellm/llms/openai_like/json_loader.py": 1,
|
||||
"litellm/llms/ovhcloud/embedding/transformation.py": 2,
|
||||
"litellm/llms/parallel_ai/search/transformation.py": 4,
|
||||
"litellm/llms/pass_through/guardrail_translation/handler.py": 1,
|
||||
"litellm/llms/perplexity/search/transformation.py": 4,
|
||||
"litellm/llms/petals/completion/handler.py": 3,
|
||||
"litellm/llms/petals/completion/transformation.py": 1,
|
||||
"litellm/llms/predibase/chat/handler.py": 6,
|
||||
"litellm/llms/predibase/chat/transformation.py": 2,
|
||||
"litellm/llms/reducto/ocr/transformation.py": 7,
|
||||
"litellm/llms/replicate/chat/handler.py": 6,
|
||||
"litellm/llms/replicate/chat/transformation.py": 1,
|
||||
"litellm/llms/runwayml/videos/transformation.py": 9,
|
||||
"litellm/llms/s3_vectors/vector_stores/transformation.py": 2,
|
||||
"litellm/llms/sagemaker/chat/handler.py": 5,
|
||||
"litellm/llms/sagemaker/chat/transformation.py": 1,
|
||||
"litellm/llms/sagemaker/common_utils.py": 3,
|
||||
"litellm/llms/sagemaker/completion/handler.py": 13,
|
||||
"litellm/llms/sagemaker/completion/transformation.py": 1,
|
||||
"litellm/llms/sambanova/chat.py": 2,
|
||||
"litellm/llms/sambanova/common_utils.py": 1,
|
||||
"litellm/llms/sambanova/embedding/transformation.py": 2,
|
||||
"litellm/llms/sap/chat/handler.py": 4,
|
||||
"litellm/llms/sap/chat/models.py": 4,
|
||||
"litellm/llms/sap/chat/transformation.py": 5,
|
||||
"litellm/llms/sap/credentials.py": 4,
|
||||
"litellm/llms/sap/embed/transformation.py": 4,
|
||||
"litellm/llms/searchapi/search/transformation.py": 4,
|
||||
"litellm/llms/searxng/search/transformation.py": 5,
|
||||
"litellm/llms/serper/search/transformation.py": 4,
|
||||
"litellm/llms/snowflake/chat/transformation.py": 1,
|
||||
"litellm/llms/snowflake/utils.py": 1,
|
||||
"litellm/llms/tavily/search/transformation.py": 4,
|
||||
"litellm/llms/together_ai/cost_calculator.py": 2,
|
||||
"litellm/llms/vertex_ai/agent_engine/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/aws_credentials_supplier.py": 2,
|
||||
"litellm/llms/vertex_ai/batches/handler.py": 3,
|
||||
"litellm/llms/vertex_ai/common_utils.py": 10,
|
||||
"litellm/llms/vertex_ai/context_caching/vertex_ai_context_caching.py": 2,
|
||||
"litellm/llms/vertex_ai/files/handler.py": 1,
|
||||
"litellm/llms/vertex_ai/files/transformation.py": 2,
|
||||
"litellm/llms/vertex_ai/fine_tuning/handler.py": 3,
|
||||
"litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py": 18,
|
||||
"litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_handler.py": 2,
|
||||
"litellm/llms/vertex_ai/google_genai/transformation.py": 2,
|
||||
"litellm/llms/vertex_ai/image_generation/image_generation_handler.py": 2,
|
||||
"litellm/llms/vertex_ai/multimodal_embeddings/embedding_handler.py": 2,
|
||||
"litellm/llms/vertex_ai/ocr/deepseek_transformation.py": 6,
|
||||
"litellm/llms/vertex_ai/ocr/transformation.py": 4,
|
||||
"litellm/llms/vertex_ai/rag_engine/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/text_to_speech/text_to_speech_handler.py": 2,
|
||||
"litellm/llms/vertex_ai/vector_stores/rag_api/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/vector_stores/search_api/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/vertex_ai_aws_wif.py": 2,
|
||||
"litellm/llms/vertex_ai/vertex_ai_non_gemini.py": 15,
|
||||
"litellm/llms/vertex_ai/vertex_ai_partner_models/ai21/transformation.py": 2,
|
||||
"litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/vertex_ai_partner_models/gpt_oss/transformation.py": 1,
|
||||
"litellm/llms/vertex_ai/vertex_ai_partner_models/llama3/transformation.py": 6,
|
||||
"litellm/llms/vertex_ai/vertex_ai_partner_models/main.py": 7,
|
||||
"litellm/llms/vertex_ai/vertex_embeddings/embedding_handler.py": 2,
|
||||
"litellm/llms/vertex_ai/vertex_embeddings/transformation.py": 4,
|
||||
"litellm/llms/vertex_ai/vertex_gemma_models/main.py": 2,
|
||||
"litellm/llms/vertex_ai/vertex_gemma_models/transformation.py": 4,
|
||||
"litellm/llms/vertex_ai/vertex_llm_base.py": 6,
|
||||
"litellm/llms/vertex_ai/vertex_model_garden/main.py": 2,
|
||||
"litellm/llms/vertex_ai/videos/transformation.py": 8,
|
||||
"litellm/llms/vllm/completion/handler.py": 7,
|
||||
"litellm/llms/volcengine/chat/transformation.py": 1,
|
||||
"litellm/llms/volcengine/embedding/transformation.py": 1,
|
||||
"litellm/llms/voyage/rerank/transformation.py": 1,
|
||||
"litellm/llms/watsonx/chat/handler.py": 3,
|
||||
"litellm/llms/watsonx/chat/transformation.py": 1,
|
||||
"litellm/llms/watsonx/common_utils.py": 4,
|
||||
"litellm/llms/watsonx/completion/transformation.py": 5,
|
||||
"litellm/llms/xai/chat/transformation.py": 1,
|
||||
"litellm/llms/you_com/search/transformation.py": 4,
|
||||
"litellm/main.py": 41,
|
||||
"litellm/models/credentials.py": 1,
|
||||
"litellm/models/end_user.py": 1,
|
||||
"litellm/models/model.py": 1,
|
||||
"litellm/models/tag.py": 1,
|
||||
"litellm/models/team.py": 2,
|
||||
"litellm/models/user.py": 1,
|
||||
"litellm/ocr/main.py": 2,
|
||||
"litellm/passthrough/main.py": 4,
|
||||
"litellm/passthrough/utils.py": 1,
|
||||
"litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py": 9,
|
||||
"litellm/proxy/_experimental/mcp_server/db.py": 5,
|
||||
"litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py": 14,
|
||||
"litellm/proxy/_experimental/mcp_server/mcp_server_manager.py": 19,
|
||||
"litellm/proxy/_experimental/mcp_server/oauth_utils.py": 2,
|
||||
"litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py": 2,
|
||||
"litellm/proxy/_experimental/mcp_server/rest_endpoints.py": 13,
|
||||
"litellm/proxy/_experimental/mcp_server/semantic_tool_filter.py": 2,
|
||||
"litellm/proxy/_experimental/mcp_server/server.py": 9,
|
||||
"litellm/proxy/_experimental/mcp_server/sse_transport.py": 2,
|
||||
"litellm/proxy/_experimental/mcp_server/tool_registry.py": 1,
|
||||
"litellm/proxy/_experimental/mcp_server/toolset_db.py": 1,
|
||||
"litellm/proxy/_experimental/post_call_rules.py": 1,
|
||||
"litellm/proxy/_lazy_features.py": 2,
|
||||
"litellm/proxy/_lazy_openapi_snapshot.py": 1,
|
||||
"litellm/proxy/_logging.py": 2,
|
||||
"litellm/proxy/_types.py": 28,
|
||||
"litellm/proxy/agent_endpoints/a2a_endpoints.py": 5,
|
||||
"litellm/proxy/agent_endpoints/agent_registry.py": 7,
|
||||
"litellm/proxy/agent_endpoints/auth/agent_permission_handler.py": 1,
|
||||
"litellm/proxy/agent_endpoints/endpoints.py": 9,
|
||||
"litellm/proxy/analytics_endpoints/analytics_endpoints.py": 1,
|
||||
"litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py": 8,
|
||||
"litellm/proxy/anthropic_endpoints/endpoints.py": 4,
|
||||
"litellm/proxy/anthropic_endpoints/skills_endpoints.py": 4,
|
||||
"litellm/proxy/auth/auth_checks.py": 24,
|
||||
"litellm/proxy/auth/auth_checks_organization.py": 1,
|
||||
"litellm/proxy/auth/auth_utils.py": 5,
|
||||
"litellm/proxy/auth/handle_jwt.py": 2,
|
||||
"litellm/proxy/auth/litellm_license.py": 2,
|
||||
"litellm/proxy/auth/model_checks.py": 1,
|
||||
"litellm/proxy/auth/rds_iam_token.py": 2,
|
||||
"litellm/proxy/auth/route_checks.py": 3,
|
||||
"litellm/proxy/auth/user_api_key_auth.py": 8,
|
||||
"litellm/proxy/batches_endpoints/endpoints.py": 4,
|
||||
"litellm/proxy/caching_routes.py": 5,
|
||||
"litellm/proxy/client/cli/commands/auth.py": 5,
|
||||
"litellm/proxy/client/cli/commands/chat.py": 4,
|
||||
"litellm/proxy/client/cli/commands/credentials.py": 5,
|
||||
"litellm/proxy/client/cli/commands/http.py": 2,
|
||||
"litellm/proxy/client/cli/commands/keys.py": 5,
|
||||
"litellm/proxy/client/cli/commands/models.py": 4,
|
||||
"litellm/proxy/client/cli/commands/teams.py": 4,
|
||||
"litellm/proxy/client/cli/commands/users.py": 7,
|
||||
"litellm/proxy/client/cli/interface.py": 5,
|
||||
"litellm/proxy/client/cli/main.py": 2,
|
||||
"litellm/proxy/common_request_processing.py": 5,
|
||||
"litellm/proxy/common_utils/admin_ui_utils.py": 3,
|
||||
"litellm/proxy/common_utils/banner.py": 1,
|
||||
"litellm/proxy/common_utils/callback_utils.py": 5,
|
||||
"litellm/proxy/common_utils/custom_openapi_spec.py": 1,
|
||||
"litellm/proxy/common_utils/debug_utils.py": 9,
|
||||
"litellm/proxy/common_utils/encrypt_decrypt_utils.py": 4,
|
||||
"litellm/proxy/common_utils/expired_ui_session_key_cleanup_manager.py": 1,
|
||||
"litellm/proxy/common_utils/key_rotation_manager.py": 3,
|
||||
"litellm/proxy/common_utils/load_config_utils.py": 2,
|
||||
"litellm/proxy/common_utils/openapi_schema_compat.py": 2,
|
||||
"litellm/proxy/common_utils/performance_utils.py": 5,
|
||||
"litellm/proxy/common_utils/reset_budget_job.py": 11,
|
||||
"litellm/proxy/common_utils/swagger_utils.py": 1,
|
||||
"litellm/proxy/common_utils/timezone_utils.py": 2,
|
||||
"litellm/proxy/common_utils/user_api_key_cache.py": 7,
|
||||
"litellm/proxy/config_management_endpoints/pass_through_endpoints.py": 1,
|
||||
"litellm/proxy/container_endpoints/endpoints.py": 4,
|
||||
"litellm/proxy/container_endpoints/handler_factory.py": 10,
|
||||
"litellm/proxy/container_endpoints/ownership.py": 1,
|
||||
"litellm/proxy/credential_endpoints/endpoints.py": 6,
|
||||
"litellm/proxy/db/base_client.py": 6,
|
||||
"litellm/proxy/db/create_views.py": 1,
|
||||
"litellm/proxy/db/db_spend_update_writer.py": 22,
|
||||
"litellm/proxy/db/db_transaction_queue/base_update_queue.py": 4,
|
||||
"litellm/proxy/db/db_transaction_queue/daily_spend_update_queue.py": 4,
|
||||
"litellm/proxy/db/db_transaction_queue/pod_lock_manager.py": 3,
|
||||
"litellm/proxy/db/db_transaction_queue/redis_update_buffer.py": 2,
|
||||
"litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py": 1,
|
||||
"litellm/proxy/db/db_transaction_queue/spend_logs_partition_manager.py": 4,
|
||||
"litellm/proxy/db/db_transaction_queue/spend_update_queue.py": 4,
|
||||
"litellm/proxy/db/dynamo_db.py": 1,
|
||||
"litellm/proxy/db/exception_handler.py": 1,
|
||||
"litellm/proxy/db/log_db_metrics.py": 2,
|
||||
"litellm/proxy/db/prisma_client.py": 2,
|
||||
"litellm/proxy/discovery_endpoints/ui_discovery_endpoints.py": 1,
|
||||
"litellm/proxy/example_config_yaml/custom_auth.py": 1,
|
||||
"litellm/proxy/example_config_yaml/custom_callbacks.py": 8,
|
||||
"litellm/proxy/example_config_yaml/custom_callbacks1.py": 7,
|
||||
"litellm/proxy/example_config_yaml/custom_guardrail.py": 4,
|
||||
"litellm/proxy/example_config_yaml/custom_handler.py": 2,
|
||||
"litellm/proxy/fine_tuning_endpoints/endpoints.py": 6,
|
||||
"litellm/proxy/google_endpoints/agents_endpoints.py": 6,
|
||||
"litellm/proxy/google_endpoints/endpoints.py": 7,
|
||||
"litellm/proxy/guardrails/guardrail_endpoints.py": 20,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/aim/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/aim/aim.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/akto/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/akto/akto.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/aporia_ai/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/aporia_ai/aporia_ai.py": 5,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/azure/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/azure/prompt_shield.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/azure/text_moderation.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py": 8,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/cato_networks/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/cato_networks/cato_networks.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/cisco_ai_defense/__init__.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/cisco_ai_defense/cisco_ai_defense.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/crowdstrike_aidr/crowdstrike_aidr.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/custom_guardrail.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/dynamoai/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/dynamoai/dynamoai.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/enkryptai/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/enkryptai/enkryptai.py": 5,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/generic_guardrail_api/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/generic_guardrail_api/generic_guardrail_api.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/grayswan/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/guardrails_ai/guardrails_ai.py": 3,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/hiddenlayer/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/hiddenlayer/hiddenlayer.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/ibm_guardrails/ibm_detector.py": 5,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/javelin/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/javelin/javelin.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/lakera_ai.py": 3,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/lakera_ai_v2.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/lasso/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/lasso/lasso.py": 5,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/content_filter.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py": 48,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/mcp_end_user_permission/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/mcp_end_user_permission/mcp_end_user_permission.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/mcp_security/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/mcp_security/mcp_security_guardrail.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/model_armor/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/noma/__init__.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/noma/noma.py": 5,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/onyx/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/onyx/onyx.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/openai/__init__.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/openai/moderations.py": 3,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/ovalix/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/pangea/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/pangea/pangea.py": 6,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/pillar/__init__.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/pillar/pillar.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/presidio.py": 8,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/prompt_security/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/prompt_security/prompt_security.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/promptguard/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/qohash/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/qohash/qohash.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/qualifire/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/qualifire/qualifire.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/semantic_guard/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/semantic_guard/semantic_guard.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/tool_permission.py": 4,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/tool_policy/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/unified_guardrail/unified_guardrail.py": 2,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/vigil_guard/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/xecguard/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/__init__.py": 1,
|
||||
"litellm/proxy/guardrails/guardrail_hooks/zscaler_ai_guard/zscaler_ai_guard.py": 7,
|
||||
"litellm/proxy/guardrails/guardrail_initializers.py": 9,
|
||||
"litellm/proxy/guardrails/guardrail_registry.py": 7,
|
||||
"litellm/proxy/guardrails/init_guardrails.py": 1,
|
||||
"litellm/proxy/guardrails/usage_endpoints.py": 4,
|
||||
"litellm/proxy/health_check.py": 6,
|
||||
"litellm/proxy/health_endpoints/_health_endpoints.py": 29,
|
||||
"litellm/proxy/hooks/__init__.py": 1,
|
||||
"litellm/proxy/hooks/azure_content_safety.py": 7,
|
||||
"litellm/proxy/hooks/batch_redis_get.py": 5,
|
||||
"litellm/proxy/hooks/cache_control_check.py": 2,
|
||||
"litellm/proxy/hooks/dynamic_rate_limiter.py": 4,
|
||||
"litellm/proxy/hooks/dynamic_rate_limiter_v3.py": 4,
|
||||
"litellm/proxy/hooks/key_management_event_hooks.py": 9,
|
||||
"litellm/proxy/hooks/litellm_skills/main.py": 1,
|
||||
"litellm/proxy/hooks/max_budget_limiter.py": 2,
|
||||
"litellm/proxy/hooks/max_budget_per_session_limiter.py": 1,
|
||||
"litellm/proxy/hooks/model_max_budget_limiter.py": 1,
|
||||
"litellm/proxy/hooks/parallel_request_limiter.py": 6,
|
||||
"litellm/proxy/hooks/parallel_request_limiter_v3.py": 5,
|
||||
"litellm/proxy/hooks/prompt_injection_detection.py": 4,
|
||||
"litellm/proxy/hooks/proxy_track_cost_callback.py": 5,
|
||||
"litellm/proxy/hooks/responses_id_security.py": 1,
|
||||
"litellm/proxy/hooks/user_management_event_hooks.py": 4,
|
||||
"litellm/proxy/image_endpoints/endpoints.py": 2,
|
||||
"litellm/proxy/litellm_pre_call_utils.py": 11,
|
||||
"litellm/proxy/management_endpoints/access_group_endpoints.py": 11,
|
||||
"litellm/proxy/management_endpoints/budget_management_endpoints.py": 6,
|
||||
"litellm/proxy/management_endpoints/cache_settings_endpoints.py": 5,
|
||||
"litellm/proxy/management_endpoints/callback_management_endpoints.py": 2,
|
||||
"litellm/proxy/management_endpoints/common_utils.py": 3,
|
||||
"litellm/proxy/management_endpoints/config_override_endpoints.py": 4,
|
||||
"litellm/proxy/management_endpoints/cost_tracking_settings.py": 5,
|
||||
"litellm/proxy/management_endpoints/customer_endpoints.py": 9,
|
||||
"litellm/proxy/management_endpoints/fallback_management_endpoints.py": 3,
|
||||
"litellm/proxy/management_endpoints/internal_user_endpoints.py": 19,
|
||||
"litellm/proxy/management_endpoints/jwt_key_mapping_endpoints.py": 6,
|
||||
"litellm/proxy/management_endpoints/key_management_endpoints.py": 21,
|
||||
"litellm/proxy/management_endpoints/mcp_management_endpoints.py": 34,
|
||||
"litellm/proxy/management_endpoints/model_access_group_management_endpoints.py": 6,
|
||||
"litellm/proxy/management_endpoints/model_management_endpoints.py": 8,
|
||||
"litellm/proxy/management_endpoints/organization_endpoints.py": 9,
|
||||
"litellm/proxy/management_endpoints/policy_endpoints/endpoints.py": 2,
|
||||
"litellm/proxy/management_endpoints/router_settings_endpoints.py": 2,
|
||||
"litellm/proxy/management_endpoints/scim/scim_v2.py": 27,
|
||||
"litellm/proxy/management_endpoints/tag_management_endpoints.py": 11,
|
||||
"litellm/proxy/management_endpoints/team_callback_endpoints.py": 3,
|
||||
"litellm/proxy/management_endpoints/team_endpoints.py": 28,
|
||||
"litellm/proxy/management_endpoints/tool_management_endpoints.py": 7,
|
||||
"litellm/proxy/management_endpoints/types.py": 1,
|
||||
"litellm/proxy/management_endpoints/ui_sso.py": 21,
|
||||
"litellm/proxy/management_endpoints/usage_endpoints/endpoints.py": 1,
|
||||
"litellm/proxy/management_endpoints/user_agent_analytics_endpoints.py": 6,
|
||||
"litellm/proxy/management_endpoints/workflow_management_endpoints.py": 8,
|
||||
"litellm/proxy/management_helpers/audit_logs.py": 2,
|
||||
"litellm/proxy/management_helpers/object_permission_utils.py": 1,
|
||||
"litellm/proxy/management_helpers/team_member_permission_checks.py": 1,
|
||||
"litellm/proxy/management_helpers/user_invitation.py": 1,
|
||||
"litellm/proxy/management_helpers/utils.py": 8,
|
||||
"litellm/proxy/memory/memory_endpoints.py": 6,
|
||||
"litellm/proxy/ocr_endpoints/endpoints.py": 1,
|
||||
"litellm/proxy/openai_evals_endpoints/endpoints.py": 11,
|
||||
"litellm/proxy/openai_files_endpoints/common_utils.py": 13,
|
||||
"litellm/proxy/openai_files_endpoints/file_content_streaming_handler.py": 1,
|
||||
"litellm/proxy/openai_files_endpoints/files_endpoints.py": 7,
|
||||
"litellm/proxy/pass_through_endpoints/llm_passthrough_endpoints.py": 23,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/anthropic_passthrough_logging_handler.py": 4,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/assembly_passthrough_logging_handler.py": 5,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/base_passthrough_logging_handler.py": 1,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/cohere_passthrough_logging_handler.py": 1,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/cursor_passthrough_logging_handler.py": 1,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/gemini_passthrough_logging_handler.py": 2,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/openai_passthrough_logging_handler.py": 1,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_ai_live_passthrough_logging_handler.py": 3,
|
||||
"litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_passthrough_logging_handler.py": 3,
|
||||
"litellm/proxy/pass_through_endpoints/pass_through_endpoints.py": 21,
|
||||
"litellm/proxy/pass_through_endpoints/passthrough_endpoint_router.py": 4,
|
||||
"litellm/proxy/pass_through_endpoints/streaming_handler.py": 2,
|
||||
"litellm/proxy/pass_through_endpoints/success_handler.py": 17,
|
||||
"litellm/proxy/policy_engine/attachment_registry.py": 1,
|
||||
"litellm/proxy/policy_engine/policy_endpoints.py": 16,
|
||||
"litellm/proxy/policy_engine/policy_registry.py": 1,
|
||||
"litellm/proxy/policy_engine/policy_resolve_endpoints.py": 2,
|
||||
"litellm/proxy/post_call_rules.py": 1,
|
||||
"litellm/proxy/prompts/init_prompts.py": 1,
|
||||
"litellm/proxy/prompts/prompt_endpoints.py": 10,
|
||||
"litellm/proxy/prompts/prompt_registry.py": 2,
|
||||
"litellm/proxy/proxy_cli.py": 14,
|
||||
"litellm/proxy/proxy_server.py": 176,
|
||||
"litellm/proxy/public_endpoints/public_endpoints.py": 7,
|
||||
"litellm/proxy/rag_endpoints/endpoints.py": 3,
|
||||
"litellm/proxy/rerank_endpoints/endpoints.py": 1,
|
||||
"litellm/proxy/response_api_endpoints/endpoints.py": 11,
|
||||
"litellm/proxy/response_polling/background_streaming.py": 2,
|
||||
"litellm/proxy/response_polling/polling_handler.py": 1,
|
||||
"litellm/proxy/route_llm_request.py": 2,
|
||||
"litellm/proxy/search_endpoints/endpoints.py": 2,
|
||||
"litellm/proxy/search_endpoints/search_tool_management.py": 7,
|
||||
"litellm/proxy/search_endpoints/search_tool_registry.py": 5,
|
||||
"litellm/proxy/spend_tracking/cloudzero_endpoints.py": 8,
|
||||
"litellm/proxy/spend_tracking/spend_management_endpoints.py": 38,
|
||||
"litellm/proxy/spend_tracking/spend_tracking_utils.py": 2,
|
||||
"litellm/proxy/spend_tracking/vantage_endpoints.py": 9,
|
||||
"litellm/proxy/ui_crud_endpoints/proxy_setting_endpoints.py": 19,
|
||||
"litellm/proxy/utils.py": 66,
|
||||
"litellm/proxy/vector_store_endpoints/endpoints.py": 7,
|
||||
"litellm/proxy/vector_store_endpoints/management_endpoints.py": 9,
|
||||
"litellm/proxy/vector_store_files_endpoints/endpoints.py": 8,
|
||||
"litellm/proxy/vertex_ai_endpoints/langfuse_endpoints.py": 4,
|
||||
"litellm/proxy/video_endpoints/endpoints.py": 9,
|
||||
"litellm/rag/__init__.py": 2,
|
||||
"litellm/rag/ingestion/bedrock_ingestion.py": 5,
|
||||
"litellm/rag/ingestion/s3_vectors_ingestion.py": 4,
|
||||
"litellm/rag/main.py": 5,
|
||||
"litellm/rag/utils.py": 1,
|
||||
"litellm/realtime_api/main.py": 9,
|
||||
"litellm/rerank_api/main.py": 2,
|
||||
"litellm/responses/file_search/emulated_handler.py": 1,
|
||||
"litellm/responses/litellm_completion_transformation/handler.py": 2,
|
||||
"litellm/responses/litellm_completion_transformation/session_handler.py": 1,
|
||||
"litellm/responses/litellm_completion_transformation/streaming_iterator.py": 2,
|
||||
"litellm/responses/litellm_completion_transformation/transformation.py": 1,
|
||||
"litellm/responses/main.py": 17,
|
||||
"litellm/responses/mcp/chat_completions_handler.py": 13,
|
||||
"litellm/responses/mcp/litellm_proxy_mcp_handler.py": 3,
|
||||
"litellm/responses/mcp/mcp_streaming_iterator.py": 2,
|
||||
"litellm/responses/streaming_iterator.py": 18,
|
||||
"litellm/responses/utils.py": 1,
|
||||
"litellm/router.py": 196,
|
||||
"litellm/router_strategy/adaptive_router/hooks.py": 2,
|
||||
"litellm/router_strategy/auto_router/litellm_encoder.py": 7,
|
||||
"litellm/router_strategy/base_routing_strategy.py": 8,
|
||||
"litellm/router_strategy/budget_limiter.py": 16,
|
||||
"litellm/router_strategy/complexity_router/evals/eval_complexity_router.py": 1,
|
||||
"litellm/router_strategy/least_busy.py": 8,
|
||||
"litellm/router_strategy/lowest_cost.py": 3,
|
||||
"litellm/router_strategy/lowest_latency.py": 6,
|
||||
"litellm/router_strategy/lowest_tpm_rpm.py": 3,
|
||||
"litellm/router_strategy/lowest_tpm_rpm_v2.py": 5,
|
||||
"litellm/router_strategy/tag_based_routing.py": 1,
|
||||
"litellm/router_utils/client_initalization_utils.py": 1,
|
||||
"litellm/router_utils/cooldown_cache.py": 2,
|
||||
"litellm/router_utils/cooldown_callbacks.py": 1,
|
||||
"litellm/router_utils/fallback_event_handlers.py": 4,
|
||||
"litellm/router_utils/get_retry_from_policy.py": 1,
|
||||
"litellm/router_utils/handle_error.py": 3,
|
||||
"litellm/router_utils/pattern_match_deployments.py": 2,
|
||||
"litellm/router_utils/pre_call_checks/model_rate_limit_check.py": 2,
|
||||
"litellm/router_utils/pre_call_checks/prompt_caching_deployment_check.py": 1,
|
||||
"litellm/router_utils/router_callbacks/track_deployment_metrics.py": 1,
|
||||
"litellm/router_utils/search_api_router.py": 5,
|
||||
"litellm/scheduler.py": 2,
|
||||
"litellm/search/main.py": 2,
|
||||
"litellm/secret_managers/aws_secret_manager.py": 4,
|
||||
"litellm/secret_managers/aws_secret_manager_v2.py": 3,
|
||||
"litellm/secret_managers/cyberark_secret_manager.py": 1,
|
||||
"litellm/secret_managers/google_kms.py": 2,
|
||||
"litellm/secret_managers/hashicorp_secret_manager.py": 1,
|
||||
"litellm/secret_managers/main.py": 1,
|
||||
"litellm/secret_managers/secret_manager_handler.py": 1,
|
||||
"litellm/skills/main.py": 9,
|
||||
"litellm/timeout.py": 8,
|
||||
"litellm/types/containers/main.py": 18,
|
||||
"litellm/types/files.py": 4,
|
||||
"litellm/types/guardrails.py": 7,
|
||||
"litellm/types/integrations/prometheus.py": 5,
|
||||
"litellm/types/llms/base.py": 9,
|
||||
"litellm/types/llms/openai.py": 9,
|
||||
"litellm/types/prompts/init_prompts.py": 1,
|
||||
"litellm/types/proxy/guardrails/guardrail_hooks/tool_permission.py": 4,
|
||||
"litellm/types/proxy/management_endpoints/internal_user_endpoints.py": 1,
|
||||
"litellm/types/proxy/management_endpoints/scim_v2.py": 4,
|
||||
"litellm/types/rerank.py": 3,
|
||||
"litellm/types/router.py": 23,
|
||||
"litellm/types/services.py": 1,
|
||||
"litellm/types/utils.py": 112,
|
||||
"litellm/types/videos/main.py": 9,
|
||||
"litellm/utils.py": 105,
|
||||
"litellm/vector_store_files/main.py": 12,
|
||||
"litellm/vector_stores/main.py": 18,
|
||||
"litellm/vector_stores/vector_store_registry.py": 6,
|
||||
"litellm/videos/main.py": 18
|
||||
}
|
||||
|
|
@ -149,7 +149,6 @@ dev = [
|
|||
"flake8==7.3.0",
|
||||
"black==26.3.1",
|
||||
"mypy==1.19.0",
|
||||
"mypy-baseline==0.7.4",
|
||||
"basedpyright==1.39.7",
|
||||
"pytest==9.0.3",
|
||||
"pytest-mock==3.15.1",
|
||||
|
|
|
|||
102
scripts/type_check_gate.py
Normal file
102
scripts/type_check_gate.py
Normal file
|
|
@ -0,0 +1,102 @@
|
|||
#!/usr/bin/env python3
|
||||
"""Per-file count gate for mypy and basedpyright.
|
||||
|
||||
Each tool's output is reduced to a count of errors per file and checked against
|
||||
a committed budget, the max errors allowed per file. Counts ignore line and
|
||||
column numbers, so they survive code moving within a file; a file fails only
|
||||
when it gains more errors than its ceiling. Run with --update to re-capture the
|
||||
budget from the current tree (ratchet). The tool output is read from stdin, so
|
||||
the caller decides how to invoke mypy or basedpyright.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import json
|
||||
import re
|
||||
import sys
|
||||
from collections import Counter
|
||||
from pathlib import Path
|
||||
from typing import Iterable, Mapping, NamedTuple
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parent.parent
|
||||
|
||||
PATTERNS: Mapping[str, re.Pattern[str]] = {
|
||||
"mypy": re.compile(r"^(?P<file>.+?):\d+: error:"),
|
||||
"basedpyright": re.compile(r"^\s*(?P<file>.+?):\d+:\d+ - error:"),
|
||||
}
|
||||
|
||||
|
||||
class Breach(NamedTuple):
|
||||
file: str
|
||||
count: int
|
||||
cap: int
|
||||
|
||||
|
||||
def _to_repo_relative(raw: str) -> str | None:
|
||||
path = Path(raw)
|
||||
absolute = path if path.is_absolute() else Path.cwd() / path
|
||||
try:
|
||||
return absolute.resolve().relative_to(REPO_ROOT).as_posix()
|
||||
except ValueError:
|
||||
return None
|
||||
|
||||
|
||||
def count_errors(lines: Iterable[str], pattern: re.Pattern[str]) -> dict[str, int]:
|
||||
counts: Counter[str] = Counter()
|
||||
for line in lines:
|
||||
match = pattern.match(line)
|
||||
if match is None:
|
||||
continue
|
||||
rel = _to_repo_relative(match.group("file"))
|
||||
if rel is not None:
|
||||
counts[rel] += 1
|
||||
return dict(counts)
|
||||
|
||||
|
||||
def evaluate(counts: Mapping[str, int], budget: Mapping[str, int]) -> list[Breach]:
|
||||
return sorted(
|
||||
Breach(file, count, budget.get(file, 0))
|
||||
for file, count in counts.items()
|
||||
if count > budget.get(file, 0)
|
||||
)
|
||||
|
||||
|
||||
def budget_path(tool: str) -> Path:
|
||||
return REPO_ROOT / f"{tool}-file-budget.json"
|
||||
|
||||
|
||||
def cmd_update(tool: str, counts: Mapping[str, int]) -> None:
|
||||
path = budget_path(tool)
|
||||
path.write_text(json.dumps(dict(sorted(counts.items())), indent=2) + "\n")
|
||||
print(
|
||||
f"Re-captured {tool} per-file budget: {len(counts)} files, {sum(counts.values())} errors"
|
||||
)
|
||||
|
||||
|
||||
def cmd_check(tool: str, counts: Mapping[str, int]) -> None:
|
||||
budget = json.loads(budget_path(tool).read_text())
|
||||
breaches = evaluate(counts, budget)
|
||||
if not breaches:
|
||||
print(
|
||||
f"OK: every file is within its {tool} ceiling ({sum(counts.values())} errors total)"
|
||||
)
|
||||
return
|
||||
print(f"FAIL: {tool} errors exceed the per-file ceiling:")
|
||||
for breach in breaches:
|
||||
print(f" {breach.file}: {breach.count} errors over cap {breach.cap}")
|
||||
print(
|
||||
f"Resolve the new errors, or run 'make lint-{tool}-budget-update' if the ceiling should move."
|
||||
)
|
||||
raise SystemExit(1)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument("--tool", choices=tuple(PATTERNS), required=True)
|
||||
parser.add_argument("--update", action="store_true")
|
||||
args = parser.parse_args()
|
||||
counts = count_errors(sys.stdin, PATTERNS[args.tool])
|
||||
cmd_update(args.tool, counts) if args.update else cmd_check(args.tool, counts)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
54
tests/test_litellm/test_type_check_gate.py
Normal file
54
tests/test_litellm/test_type_check_gate.py
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
_MODULE_PATH = Path(__file__).resolve().parents[2] / "scripts" / "type_check_gate.py"
|
||||
_spec = importlib.util.spec_from_file_location("type_check_gate", _MODULE_PATH)
|
||||
gate = importlib.util.module_from_spec(_spec)
|
||||
_spec.loader.exec_module(gate)
|
||||
|
||||
ROOT = gate.REPO_ROOT
|
||||
|
||||
|
||||
def test_mypy_counts_errors_per_file_ignoring_line_numbers_notes_and_summary():
|
||||
lines = [
|
||||
f"{ROOT}/litellm/utils.py:10: error: missing annotation [no-untyped-def]",
|
||||
f"{ROOT}/litellm/utils.py:9999: error: missing annotation [no-untyped-def]",
|
||||
f"{ROOT}/litellm/main.py:5: error: missing annotation [no-untyped-def]",
|
||||
f"{ROOT}/litellm/main.py:5: note: see here",
|
||||
"Found 3 errors in 2 files (checked 100 source files)",
|
||||
]
|
||||
assert gate.count_errors(lines, gate.PATTERNS["mypy"]) == {
|
||||
"litellm/utils.py": 2,
|
||||
"litellm/main.py": 1,
|
||||
}
|
||||
|
||||
|
||||
def test_basedpyright_counts_only_errors_not_warnings_or_summary():
|
||||
lines = [
|
||||
f" {ROOT}/litellm/utils.py:6389:40 - error: Type is unknown (reportUnknownVariableType)",
|
||||
f" {ROOT}/litellm/utils.py:6395:5 - error: Type is unknown (reportUnknownVariableType)",
|
||||
f" {ROOT}/litellm/main.py:1:1 - warning: something (reportFoo)",
|
||||
"117033 errors, 5 warnings, 0 notes",
|
||||
]
|
||||
assert gate.count_errors(lines, gate.PATTERNS["basedpyright"]) == {
|
||||
"litellm/utils.py": 2
|
||||
}
|
||||
|
||||
|
||||
def test_paths_outside_repo_are_skipped():
|
||||
lines = ["/tmp/elsewhere.py:1: error: missing annotation [no-untyped-def]"]
|
||||
assert gate.count_errors(lines, gate.PATTERNS["mypy"]) == {}
|
||||
|
||||
|
||||
def test_at_or_under_ceiling_passes():
|
||||
assert gate.evaluate({"a.py": 5, "b.py": 3}, {"a.py": 5, "b.py": 10}) == []
|
||||
|
||||
|
||||
def test_one_more_error_than_ceiling_fails():
|
||||
breaches = gate.evaluate({"a.py": 6}, {"a.py": 5})
|
||||
assert breaches == [gate.Breach("a.py", 6, 5)]
|
||||
|
||||
|
||||
def test_file_absent_from_budget_has_zero_ceiling():
|
||||
breaches = gate.evaluate({"new.py": 1}, {})
|
||||
assert breaches == [gate.Breach("new.py", 1, 0)]
|
||||
13
uv.lock
generated
13
uv.lock
generated
|
|
@ -9,7 +9,7 @@ resolution-markers = [
|
|||
]
|
||||
|
||||
[options]
|
||||
exclude-newer = "2026-06-10T16:05:23.16302654Z"
|
||||
exclude-newer = "2026-06-11T06:56:06.940919973Z"
|
||||
exclude-newer-span = "P3D"
|
||||
|
||||
[manifest]
|
||||
|
|
@ -3443,7 +3443,6 @@ dev = [
|
|||
{ name = "flake8" },
|
||||
{ name = "langfuse" },
|
||||
{ name = "mypy" },
|
||||
{ name = "mypy-baseline" },
|
||||
{ name = "openapi-core" },
|
||||
{ name = "opentelemetry-api" },
|
||||
{ name = "opentelemetry-exporter-otlp" },
|
||||
|
|
@ -3613,7 +3612,6 @@ dev = [
|
|||
{ name = "flake8", specifier = "==7.3.0" },
|
||||
{ name = "langfuse", specifier = "==2.59.7" },
|
||||
{ name = "mypy", specifier = "==1.19.0" },
|
||||
{ name = "mypy-baseline", specifier = "==0.7.4" },
|
||||
{ name = "openapi-core", marker = "python_full_version < '3.14'", specifier = "==0.22.0" },
|
||||
{ name = "opentelemetry-api", specifier = "==1.28.0" },
|
||||
{ name = "opentelemetry-exporter-otlp", specifier = "==1.28.0" },
|
||||
|
|
@ -4268,15 +4266,6 @@ wheels = [
|
|||
{ url = "https://files.pythonhosted.org/packages/09/0e/fe228ed5aeab470c6f4eb82481837fadb642a5aa95cc8215fd2214822c10/mypy-1.19.0-py3-none-any.whl", hash = "sha256:0c01c99d626380752e527d5ce8e69ffbba2046eb8a060db0329690849cf9b6f9", size = 2469714, upload-time = "2025-11-28T15:45:33.22Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-baseline"
|
||||
version = "0.7.4"
|
||||
source = { registry = "https://pypi.org/simple" }
|
||||
sdist = { url = "https://files.pythonhosted.org/packages/08/7e/484e07e1b27f9999f5f3f5097f0dfbb1ba756b0a2ed14acca764abad6cc8/mypy_baseline-0.7.4.tar.gz", hash = "sha256:c69d9964ebb2922f53245336bc506d9d277c8a35349a60ce50cff0c48a8702cc", size = 319098, upload-time = "2026-04-13T08:01:54.239Z" }
|
||||
wheels = [
|
||||
{ url = "https://files.pythonhosted.org/packages/9e/77/3dee0c8f219cc5e68e7d84abc1ecc315856104c459658890bd9ecce17815/mypy_baseline-0.7.4-py3-none-any.whl", hash = "sha256:012c5f2f2bf9770b0e846d22580a72b9d43bdfe04148fee10a8af47b5bdd35c7", size = 17853, upload-time = "2026-04-13T08:01:52.444Z" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "mypy-extensions"
|
||||
version = "1.1.0"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue