MCPcopy Create free account

hub / github.com/BerriAI/litellm / functions

Functions71,069 in github.com/BerriAI/litellm

↓ 14 callersMethodui_friendly_name
()
tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py:486
↓ 14 callersMethodunshift
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callersMethodupdate
(_self, where, data)
tests/test_litellm/proxy/common_utils/test_reset_budget_job.py:112
↓ 14 callersFunctionupdate_db_model
(db_model: Deployment, updated_patch: updateDeployment)
litellm/proxy/management_endpoints/model_management_endpoints.py:99
↓ 14 callersFunctionupdate_spend
Batch write updates to db. Triggered every minute. NOTE: This job now skips tag spend updates, which are handled by a separate sche
litellm/proxy/utils.py:5257
↓ 13 callersFunction_batch_dict
A minimal-but-valid dict for ``LiteLLMBatch(**response.model_dump())``.
tests/test_litellm/llms/azure/batches/test_handler.py:57
↓ 13 callersMethod_build
(self, chunks: List[str])
tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py:993
↓ 13 callersMethod_build_mcp_server_table
(self, server: MCPServer)
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:4524
↓ 13 callersFunction_canonical_path
Normalise a passthrough route to a bare /v1/... path for map lookup. Examples: /openai_passthrough/v1/files -> /v1/files /open
litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:240
↓ 13 callersMethod_check_content
Evaluate content against Purview DLP policies. Args: user_id: Entra object ID. text: Content to evaluate.
litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/purview_dlp.py:108
↓ 13 callersFunction_check_team_key_limits
Check if the team key is allocating guaranteed throughput limits. If so, raise an error if we're overallocating. Only runs check if tpm_limi
litellm/proxy/management_endpoints/key_management_endpoints.py:1226
↓ 13 callersFunction_clear_names_from_globals
Clear all names from litellm globals.
tests/test_litellm/test_lazy_imports.py:43
↓ 13 callersMethod_common_checks_available_deployment
Common checks for 'get_available_deployment' across sync + async call. If 'healthy_deployments' returned is None, this means the use
litellm/router.py:9959
↓ 13 callersFunction_container
(container_id: str)
tests/test_litellm/containers/test_container_proxy_ownership.py:32
↓ 13 callersMethod_convert_mcp_hook_response_to_kwargs
Helper function to convert pre_call_hook response back to kwargs for MCP usage. Supports: - modified_arguments: Override too
litellm/proxy/utils.py:875
↓ 13 callersFunction_dest
(**overrides)
tests/test_litellm/integrations/focus/test_mavvrik_destination.py:27
↓ 13 callersMethod_emit_once
Return True the first time this handler is asked to emit a span for the given (handler, scope) on this kwargs; False on repeats. Used
litellm/integrations/opentelemetry.py:1027
↓ 13 callersFunction_expand_model_aliases
Expand ``aliases`` lists in model cost entries into top-level entries. Each alias gets a reference to the **same** dict object as the canoni
litellm/litellm_core_utils/get_model_cost_map.py:196
↓ 13 callersFunction_fake_user_api_key_auth
Build a minimal stand-in for ``UserAPIKeyAuth`` with just the fields consulted by ``_check_summary_model_access`` and ``_check_summary_model_b
tests/test_litellm/llms/anthropic/experimental_pass_through/context_management/test_compact.py:1197
↓ 13 callersMethod_get_attr
Extract the value set for a specific attribute name, or None.
tests/test_litellm/integrations/test_opentelemetry.py:3794
↓ 13 callersFunction_get_masked_values
Internal debugging helper function Masks the headers of the request sent from LiteLLM Args: masked_length: Optional length for
litellm/litellm_core_utils/litellm_logging.py:3330
↓ 13 callersFunction_get_metadata_variable_name
Helper to return what the "metadata" field should be called in the request data For all /thread or /assistant endpoints we need to call this
litellm/proxy/litellm_pre_call_utils.py:357
↓ 13 callersMethod_get_openai_client
( self, is_async: bool, api_key: Optional[str] = None, api_base: Optional[str]
litellm/llms/openai/openai.py:350
↓ 13 callersMethod_get_openai_compatible_provider_info
( self, api_base: Optional[str], api_key: Optional[str], litellm_params: Optio
litellm/llms/bedrock_mantle/chat/transformation.py:47
↓ 13 callersFunction_get_openai_response_types
()
litellm/responses/streaming_iterator.py:36
↓ 13 callersFunction_guardrail_kwargs
()
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_ovalix.py:69
↓ 13 callersFunction_hash_token_if_needed
Hash the token if it's a string and starts with "sk-" Else return the token as is
litellm/proxy/utils.py:5108
↓ 13 callersMethod_is_idempotent_error
Check if the error message indicates an idempotent operation error. Idempotent errors (like "column already exists") mean the migrat
litellm-proxy-extras/litellm_proxy_extras/utils.py:238
↓ 13 callersFunction_is_streaming_request
Returns True if the call type is a streaming request. Returns True if: - if "stream=True" in kwargs (litellm chat completion, litell
litellm/utils.py:1924
↓ 13 callersFunction_make_mock_session_iterator
Create a mock _get_session_iterator that yields a session returning json_response.
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py:27
↓ 13 callersFunction_make_openai_jsonl_bytes
(n_rows: int, padding: int = 400)
tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_streaming.py:61
↓ 13 callersFunction_make_prisma
(invite: MagicMock, user: MagicMock | None = None)
tests/test_litellm/proxy/auth/test_onboarding.py:58
↓ 13 callersFunction_make_router
()
tests/test_litellm/router_strategy/adaptive_router/test_async_pre_routing.py:22
↓ 13 callersFunction_make_user_api_key_cache
(get_value=None, get_side_effect=None)
tests/test_litellm/proxy/proxy_server/test_spend_counters.py:70
↓ 13 callersFunction_make_wrapper
(engine_pid: int = 111, iam: bool = False)
tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.py:42
↓ 13 callersFunction_make_wrappers
()
tests/test_litellm/proxy/db/test_routing_prisma_wrapper.py:21
↓ 13 callersFunction_prepare_mcp_server_headers
Build auth and extra headers for a server.
litellm/proxy/_experimental/mcp_server/server.py:1534
↓ 13 callersMethod_prepare_metadata_from_request
Extract and prepare metadata from request data for PANW API call. Supported metadata fields (from request.metadata): - profi
litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py:746
↓ 13 callersFunction_prisma_with_list
Return a prisma_client whose find_many honors the provider scope pushed into the ``where`` clause, mirroring how Postgres would filter rows.
tests/pass_through_unit_tests/test_passthrough_managed_ids.py:1591
↓ 13 callersFunction_recorder
(client=None)
tests/llm_translation/test_openai_record_replay_proxy.py:39
↓ 13 callersFunction_req
(body, uri="https://api.openai.com/v1/chat/completions")
tests/test_litellm/test_vcr_safe_body_matcher.py:31
↓ 13 callersFunction_sdk_response
An object that mimics the OpenAI SDK Batch: only ``.model_dump()`` is used.
tests/test_litellm/llms/azure/batches/test_handler.py:71
↓ 13 callersFunction_setup_team_keys_mocks
Set up mocks for bulk_update_team_keys; returns mock_prisma.
tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py:11756
↓ 13 callersFunction_slg_entry
Build a StandardLoggingGuardrailInformation entry the way ``add_standard_logging_guardrail_information_to_request_data`` does.
tests/test_litellm/integrations/test_otel_guardrail_violation_spans.py:92
↓ 13 callersMethod_transform_request
Transform OpenAI-style input to Nova format. Only handles OpenAI params (dimensions). All other Nova-specific params should
litellm/llms/bedrock/embed/amazon_nova_transformation.py:86
↓ 13 callersMethod_update_daily_spend
( n_retry_times: int, prisma_client: PrismaClient, proxy_logging_obj: ProxyLogging,
litellm/proxy/db/db_spend_update_writer.py:1373
↓ 13 callersFunction_user_auth
()
tests/test_litellm/proxy/proxy_server/test_streaming_helpers.py:44
↓ 13 callersFunction_user_is_org_admin
Helper function to check if user is an org admin for all of the passed organizations. Checks both: - `organization_id` (singular string)
litellm/proxy/auth/auth_checks_organization.py:135
↓ 13 callersFunction_verify_only_requested_name_imported
Verify that only the requested name is in globals, not the others.
tests/test_litellm/test_lazy_imports.py:61
↓ 13 callersFunction_violation_response
(url: str = CHAT_URL)
tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py:94
↓ 13 callersFunctiona
(t)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 13 callersMethodadd_litellm_failure_callback
Add a failure callback to `litellm.failure_callback`. Auto-routes async callbacks to litellm._async_failure_callback.
litellm/litellm_core_utils/logging_callback_manager.py:80
↓ 13 callersMethodadd_server
(self, mcp_server: LiteLLM_MCPServerTable)
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1274
↓ 13 callersMethodasync_increment_cache
Key - the key in cache Value - float - the value you want to increment by Refresh_ttl - bool - if True, resets the Redis TT
litellm/caching/dual_cache.py:359
↓ 13 callersMethodasync_log_success_event
(self, kwargs, response_obj, start_time, end_time)
tests/test_litellm/proxy/test_litellm_pre_call_utils.py:2289
↓ 13 callersMethodasync_moderation_hook
(self, data, user_api_key_dict, call_type)
tests/proxy_unit_tests/test_proxy_utils.py:2524
↓ 13 callersMethodasync_moderation_hook
(self, data: dict, **kwargs)
tests/test_litellm/integrations/test_custom_guardrail.py:1038
↓ 13 callersMethodasync_post_mcp_tool_call_hook
( self, kwargs, response_obj: MCPPostCallResponseObject, start_time, end_time )
tests/mcp_tests/test_mcp_logging.py:346
↓ 13 callersMethodasync_routing_strategy_pre_call_checks
For usage-based-routing-v2, enables running rpm checks before the call is made, inside the semaphore. -> makes the calls concurrency
litellm/router.py:7129
↓ 13 callersFunctionauthenticate_user
Authenticate a user and generate an API key for UI access. This function handles two login scenarios: 1. Admin login using UI_USERNAME a
litellm/proxy/auth/login_utils.py:106
↓ 13 callersMethodbearer
(self, key: str)
tests/e2e/transport.py:74
↓ 13 callersMethodcall_tool
Call a tool with the given name and arguments Args: server_name: Server name name: Tool name arg
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:3815
↓ 13 callersFunctioncan_access_resource
Return True iff the caller may read/modify a managed resource. The resource's ``created_by`` and ``team_id`` fields must be non-None to match
litellm/llms/base_llm/managed_resources/isolation.py:72
↓ 13 callersFunctioncheck_vector_store_permission
Check if a specific permission is allowed for a given vector store index. Args: index_name: The name of the vector store index
litellm/proxy/vector_store_endpoints/utils.py:291
↓ 13 callersMethodchunk_processor
( response: httpx.Response, request_body: Optional[dict], litellm_logging_obj: LiteLLM
litellm/proxy/pass_through_endpoints/streaming_handler.py:29
↓ 13 callersFunctioncleanup_redis
Cleanup Redis cache before each test
tests/local_testing/test_router_budget_limiter.py:28
↓ 13 callersMethodconnect
(self)
litellm/proxy/utils.py:4044
↓ 13 callersMethodconvert_chat_completion_messages_to_responses_api
( self, messages: List["AllMessageValues"] )
litellm/completion_extras/litellm_responses_transformation/transformation.py:212
↓ 13 callersFunctionconvert_to_gemini_tool_call_result
OpenAI message with a tool result looks like: { "tool_call_id": "tool_1", "role": "tool", "content": "function result
litellm/litellm_core_utils/prompt_templates/factory.py:1377
↓ 13 callersFunctioncreate_model_call_details
Create model_call_details dict with standard_logging_object.
tests/logging_callback_tests/test_standard_logging_payload_excluded_fields.py:77
↓ 13 callersFunctioncreate_model_info_response
Create a standardized OpenAI-compatible model object. When include_metadata is true, attaches the model's configured fallbacks (resolved
litellm/proxy/utils.py:6084
↓ 13 callersMethoddecode
(self, blob: str)
litellm/proxy/_experimental/mcp_server/outbound_credentials/token_cache_codec.py:30
↓ 13 callersFunctiondelete_nested_value
Delete a field from nested data using JSONPath notation. Custom implementation - no external dependencies. Supports: - "field" - to
litellm/litellm_core_utils/dot_notation_indexing.py:180
↓ 13 callersMethoddeserialize
Decode a cache entry to ``model_type``. - ``None`` → ``None`` - Already an instance of ``model_type`` (including subclasses)
litellm/proxy/common_utils/cache_pydantic_utils.py:66
↓ 13 callersMethoddict
(self)
tests/test_litellm/caching/test_redis_semantic_cache.py:661
↓ 13 callersFunctioneO
()
litellm/proxy/_experimental/out/_next/static/chunks/0lb0p7rh5znu_.js:8
↓ 13 callersFunctionendpoint_func
( # type: ignore request: Request, fastapi_response: Response, user_api_k
litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:1608
↓ 13 callersFunctioneq
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 13 callersMethodexchange
( self, subject_token: str, server: ServerSpec, config: TokenExchangeConfig, *, tenant_id: str = ""
litellm/proxy/_experimental/mcp_server/outbound_credentials/token_exchanger.py:188
↓ 13 callersMethodexpand_tool_permissions
Rewrite an ``mcp_tool_permissions`` dict keyed by id/name/alias so every key is a concrete server_id where possible. Tool lists from
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:4232
↓ 13 callersMethodextract_response_content
( self, completion_response: dict )
litellm/llms/anthropic/chat/transformation.py:1972
↓ 13 callersMethodfactory_function
Creates appropriate wrapper functions for different API call types. Returns: - A synchronous function for synchronous ca
litellm/router.py:5344
↓ 13 callersMethodfailure_handler
Log failed db read/writes Currently only logs exceptions to sentry
litellm/proxy/utils.py:1932
↓ 13 callersFunctionfilter_team_based_models
If a model has a team_id Only use if request is from that team
litellm/router_utils/common_utils.py:47
↓ 13 callersFunctiongetModelDisplayName
(model: string)
ui/litellm-dashboard/src/components/key_team_helpers/fetch_available_models_team_key.tsx:38
↓ 13 callersMethodget_api_base
(api_base: Optional[str] = None)
litellm/llms/anthropic/common_utils.py:712
↓ 13 callersMethodget_arize_phoenix_config
Retrieves the Arize Phoenix configuration based on environment variables. Returns:
litellm/integrations/arize/arize_phoenix.py:391
↓ 13 callersMethodget_cache
( self, key: Any, parent_otel_span: Any = None, local_only: bool = False,
litellm/proxy/common_utils/user_api_key_cache.py:41
↓ 13 callersMethodget_complete_url
( self, api_base: str | None, api_key: str | None, model: str, optiona
litellm/llms/gdc/chat/transformation.py:65
↓ 13 callersMethodget_credentials
( self, custom_llm_provider: str, region_name: Optional[str], )
litellm/proxy/pass_through_endpoints/passthrough_endpoint_router.py:45
↓ 13 callersFunctionget_custom_labels_from_metadata
Get custom labels from metadata
litellm/integrations/prometheus.py:3913
↓ 13 callersMethodget_guardrail_dynamic_request_body_params
Returns `extra_body` to be added to the request body for the Guardrail API call Use this to pass dynamic params to the guardrail API
litellm/integrations/custom_guardrail.py:650
↓ 13 callersFunctionget_mime_type
Determine MIME type from file path extension. Falls back to mimetypes.guess_type, then to 'application/octet-stream'.
litellm/ocr/main.py:453
↓ 13 callersMethodget_provider_vector_stores_config
v2 vector store config, use this for new vector store integrations
litellm/utils.py:8451
↓ 13 callersFunctionget_redis_async_client
( connection_pool: Optional[async_redis.BlockingConnectionPool] = None, **env_overrides, )
litellm/_redis.py:550
↓ 13 callersMethodget_request_headers
( self, credentials: Credentials, aws_region_name: str, extra_headers: Optiona
litellm/llms/bedrock/base_aws_llm.py:1360
↓ 13 callersMethodget_standard_logging_metadata
Clean and filter the metadata dictionary to include only the specified keys in StandardLoggingMetadata. Args: metadata (
litellm/litellm_core_utils/litellm_logging.py:4552
↓ 13 callersMethodget_user_id
(self, token: dict, default_value: Optional[str])
litellm/proxy/auth/handle_jwt.py:428
↓ 13 callersFunctionisKeyed
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 13 callersMethodisLight
()
litellm/proxy/_experimental/out/_next/static/chunks/0e9hs7onyj28m.js:1
← previousnext →1,201–1,300 of 71,069, ranked by callers