Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BerriAI/litellm
/ functions
Functions
68,180 in github.com/BerriAI/litellm
⨍
Functions
68,180
◇
Types & classes
10,037
↳
Endpoints
1,734
↓ 14 callers
Function
mock_stream
()
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py:1443
↓ 14 callers
Function
now
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Method
parse
()
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:1
↓ 14 callers
Method
post
( self, url: str, data: Optional[Union[dict, str, bytes]] = None, json: Option
litellm/llms/custom_httpx/http_handler.py:1145
↓ 14 callers
Method
process_input_messages
( self, data: dict, guardrail_to_apply: "CustomGuardrail", litellm_logging_obj
litellm/llms/bedrock/passthrough/guardrail_translation/handler.py:384
↓ 14 callers
Method
process_input_messages
Process input messages by applying guardrails to text content.
litellm/llms/openai/chat/guardrail_translation/handler.py:64
↓ 14 callers
Method
process_input_messages
Process input text fields ('query' and 'instruction') by applying guardrails and writing the sanitized values back. Args:
litellm/llms/cohere/rerank/guardrail_translation/handler.py:41
↓ 14 callers
Function
register_persister_if_enabled
Call from ``pytest_recording_configure(config, vcr)`` in each conftest.
tests/_vcr_conftest_common.py:1182
↓ 14 callers
Method
remember_pluginmanager
(self, config)
tests/_vcr_conftest_common.py:2054
↓ 14 callers
Function
reset_vcr_diag_dir
()
tests/_vcr_conftest_common.py:78
↓ 14 callers
Function
resolve
(s,o,i)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Function
run_async_function
Helper utility to run an async function in a sync context. Handles the case where there is an existing event loop running. Args:
litellm/litellm_core_utils/asyncify.py:70
↓ 14 callers
Method
set
Store NaCl-encrypted access_token in Redis with the given TTL.
litellm/proxy/_experimental/mcp_server/oauth2_token_cache.py:229
↓ 14 callers
Method
setTimeout
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 14 callers
Method
set_arize_attributes
(span: Span, kwargs, response_obj)
litellm/integrations/arize/arize.py:71
↓ 14 callers
Function
set_auth_context
Set the UserAPIKeyAuth in the auth context variable. Args: user_api_key_auth: UserAPIKeyAuth object mcp_auth
litellm/proxy/_experimental/mcp_server/server.py:3892
↓ 14 callers
Method
set_cache
(self, key, value, local_only: bool = False, **kwargs)
litellm/caching/dual_cache.py:106
↓ 14 callers
Method
set_cache
(self, *args, **kwargs)
tests/proxy_unit_tests/test_key_generate_prisma.py:3801
↓ 14 callers
Function
stringify
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Method
subtract
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Function
tj
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:106
↓ 14 callers
Method
to_json
(self, **kwargs)
litellm/types/router.py:463
↓ 14 callers
Method
transform_file_content_request
Get URL and params for retrieving file content.
litellm/llms/manus/files/transformation.py:402
↓ 14 callers
Method
transform_search_response
Transform Brave Search API response to LiteLLM unified SearchResponse format.
litellm/llms/brave/search/transformation.py:239
↓ 14 callers
Method
translate_openai_response_to_anthropic
Translate OpenAI response to Anthropic format. Args: response: The OpenAI ModelResponse tool_name_mapping: O
litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py:1300
↓ 14 callers
Function
tt
(e,t,n,r)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 14 callers
Method
tx
(self)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_env_vars.py:961
↓ 14 callers
Method
ui_friendly_name
()
tests/test_litellm/proxy/guardrails/test_guardrail_endpoints.py:486
↓ 14 callers
Method
unshift
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Method
update
(_self, where, data)
tests/test_litellm/proxy/common_utils/test_reset_budget_job.py:112
↓ 14 callers
Function
update_db_model
(db_model: Deployment, updated_patch: updateDeployment)
litellm/proxy/management_endpoints/model_management_endpoints.py:99
↓ 14 callers
Function
update_key_fn
Update an existing API key's parameters. Parameters: - key: str - The key to update - key_alias: Optional[str] - User-friendly key a
litellm/proxy/management_endpoints/key_management_endpoints.py:2321
↓ 14 callers
Function
update_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:5246
↓ 13 callers
Method
_build
(self, chunks: List[str])
tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py:993
↓ 13 callers
Method
_build_mcp_server_table
(self, server: MCPServer)
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:4152
↓ 13 callers
Function
_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 callers
Method
_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 callers
Function
_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:1095
↓ 13 callers
Function
_clear_names_from_globals
Clear all names from litellm globals.
tests/test_litellm/test_lazy_imports.py:43
↓ 13 callers
Method
_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:9930
↓ 13 callers
Function
_container
(container_id: str)
tests/test_litellm/containers/test_container_proxy_ownership.py:32
↓ 13 callers
Method
_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:873
↓ 13 callers
Function
_dest
(**overrides)
tests/test_litellm/integrations/focus/test_mavvrik_destination.py:27
↓ 13 callers
Method
_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 callers
Function
_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:182
↓ 13 callers
Function
_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:1195
↓ 13 callers
Function
_full_upstream_card
()
tests/test_litellm/proxy/a2a/test_agent_card.py:14
↓ 13 callers
Method
_get_attr
Extract the value set for a specific attribute name, or None.
tests/test_litellm/integrations/test_opentelemetry.py:3794
↓ 13 callers
Function
_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:3290
↓ 13 callers
Function
_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:335
↓ 13 callers
Method
_get_openai_client
( self, is_async: bool, api_key: Optional[str] = None, api_base: Optional[str]
litellm/llms/openai/openai.py:350
↓ 13 callers
Method
_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 callers
Function
_get_openai_response_types
()
litellm/responses/streaming_iterator.py:36
↓ 13 callers
Function
_guardrail_kwargs
()
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_ovalix.py:69
↓ 13 callers
Function
_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:5099
↓ 13 callers
Method
_inc_labeled_counter
( self, counter: Any, metric_name: DEFINED_PROMETHEUS_METRICS, enum_values: Us
litellm/integrations/prometheus.py:1032
↓ 13 callers
Method
_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 callers
Function
_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:1921
↓ 13 callers
Function
_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 callers
Function
_make_prisma
(invite: MagicMock, user: MagicMock | None = None)
tests/test_litellm/proxy/auth/test_onboarding.py:58
↓ 13 callers
Function
_make_router
()
tests/test_litellm/router_strategy/adaptive_router/test_async_pre_routing.py:22
↓ 13 callers
Function
_make_wrapper
(engine_pid: int = 111, iam: bool = False)
tests/test_litellm/proxy/db/test_prisma_planned_engine_restart.py:42
↓ 13 callers
Method
_map_reasoning_effort
( reasoning_effort: Optional[Union[REASONING_EFFORT, str]], model: str, llm_provider:
litellm/llms/anthropic/chat/transformation.py:1159
↓ 13 callers
Function
_prepare_mcp_server_headers
Build auth and extra headers for a server.
litellm/proxy/_experimental/mcp_server/server.py:1325
↓ 13 callers
Method
_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 callers
Function
_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 callers
Function
_recorder
(client=None)
tests/llm_translation/test_openai_record_replay_proxy.py:39
↓ 13 callers
Function
_req
(body, uri="https://api.openai.com/v1/chat/completions")
tests/test_litellm/test_vcr_safe_body_matcher.py:31
↓ 13 callers
Function
_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:10948
↓ 13 callers
Function
_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 callers
Method
_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 callers
Method
_update_daily_spend
( n_retry_times: int, prisma_client: PrismaClient, proxy_logging_obj: ProxyLogging,
litellm/proxy/db/db_spend_update_writer.py:1377
↓ 13 callers
Function
_user_auth
()
tests/test_litellm/proxy/proxy_server/test_streaming_helpers.py:44
↓ 13 callers
Function
_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 callers
Function
_validate_update_key_data
Validate permissions and constraints for key update.
litellm/proxy/management_endpoints/key_management_endpoints.py:2092
↓ 13 callers
Function
_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 callers
Function
_violation_response
(url: str = CHAT_URL)
tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py:94
↓ 13 callers
Function
a
(t)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 13 callers
Method
add_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 callers
Method
add_server
(self, mcp_server: LiteLLM_MCPServerTable)
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1183
↓ 13 callers
Method
async_log_success_event
(self, kwargs, response_obj, start_time, end_time)
tests/test_litellm/proxy/test_litellm_pre_call_utils.py:2121
↓ 13 callers
Method
async_moderation_hook
(self, data, user_api_key_dict, call_type)
tests/proxy_unit_tests/test_proxy_utils.py:2524
↓ 13 callers
Method
async_post_mcp_tool_call_hook
( self, kwargs, response_obj: MCPPostCallResponseObject, start_time, end_time )
tests/mcp_tests/test_mcp_logging.py:346
↓ 13 callers
Method
async_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:7100
↓ 13 callers
Function
authenticate_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 callers
Function
build_token_endpoint_client_auth
Return the headers and body fields that authenticate the client to the token endpoint. ``client_secret_basic`` is a confidential-client method, s
litellm/proxy/_experimental/mcp_server/auth/token_endpoint_auth.py:46
↓ 13 callers
Function
can_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 callers
Function
can_key_call_model
Checks if token can call a given model 1. First checks native key-level model permissions (current implementation) 2. If not allowed nat
litellm/proxy/auth/auth_checks.py:2959
↓ 13 callers
Function
check_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 callers
Function
cleanup_redis
Cleanup Redis cache before each test
tests/local_testing/test_router_budget_limiter.py:28
↓ 13 callers
Method
connect
(self)
litellm/proxy/utils.py:4042
↓ 13 callers
Method
convert_chat_completion_messages_to_responses_api
( self, messages: List["AllMessageValues"] )
litellm/completion_extras/litellm_responses_transformation/transformation.py:212
↓ 13 callers
Function
convert_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 callers
Function
create_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 callers
Function
create_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:6014
↓ 13 callers
Method
decode
(self, blob: str)
litellm/proxy/_experimental/mcp_server/outbound_credentials/token_cache_codec.py:30
↓ 13 callers
Function
delete_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 callers
Method
deserialize
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 callers
Method
destroy
()
litellm/proxy/_experimental/out/_next/static/chunks/02813b2b-kz98.js:8
↓ 13 callers
Method
dict
(self)
tests/test_litellm/caching/test_redis_semantic_cache.py:661
← previous
next →
1,101–1,200 of 68,180, ranked by callers