Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BerriAI/litellm
/ functions
Functions
71,069 in github.com/BerriAI/litellm
⨍
Functions
71,069
◇
Types & classes
10,227
↳
Endpoints
1,754
↓ 14 callers
Function
_build_model_response
()
tests/test_litellm/llms/test_predibase_transformation.py:12
↓ 14 callers
Function
_confusion_matrix
Run all cases, print confusion matrix, save results JSON.
litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py:152
↓ 14 callers
Function
_create_test_router
()
tests/test_litellm/router_strategy/test_lar1_routing.py:52
↓ 14 callers
Method
_extract_assistant_text_from_response
(response: Any)
litellm/proxy/guardrails/guardrail_hooks/xecguard/xecguard.py:447
↓ 14 callers
Method
_get_async_openai_model_client
Helper to get AsyncOpenAI or AsyncAzureOpenAI client that was created for the deployment The same OpenAI client is re-used to optimi
litellm/router.py:2986
↓ 14 callers
Function
_get_cors_config
Compute CORS allowed origins and credentials flag from environment variables. Extracted into a function so it can be unit-tested without rel
litellm/proxy/proxy_server.py:1411
↓ 14 callers
Method
_get_prompt_from_kwargs
Extract a semantic-cache prompt from chat or Responses API request kwargs.
litellm/caching/redis_semantic_cache.py:238
↓ 14 callers
Method
_get_ssl_verify
Get SSL verification setting for boto3 clients. This ensures that custom CA certificates are properly used for all AWS API calls,
litellm/llms/bedrock/base_aws_llm.py:100
↓ 14 callers
Method
_inc_labeled_counter
( self, counter: Any, metric_name: DEFINED_PROMETHEUS_METRICS, enum_values: Us
litellm/integrations/prometheus.py:1149
↓ 14 callers
Function
_is_blocked_ip
Return True for any IP not safe to reach from a user-supplied URL. Policy: default-deny via ``ip.is_global`` (RFC 6890), plus an explicit exc
litellm/litellm_core_utils/url_utils.py:89
↓ 14 callers
Function
_load_jsonl
Load eval cases from a JSONL file. One JSON object per line.
litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py:36
↓ 14 callers
Function
_make_cache
(sync_client=None, async_client=None, similarity_threshold=0.8)
tests/test_litellm/caching/test_valkey_semantic_cache.py:19
↓ 14 callers
Function
_make_counter_invalidation_job
Stub spend_counter_cache (and user_api_key_cache) so we can observe invalidation calls. Both caches are looked up via ``from litellm.proxy.pr
tests/test_litellm/proxy/common_utils/test_reset_budget_job.py:1328
↓ 14 callers
Function
_make_deployment_dict
Helper to build a minimal deployment dict as returned by router.get_model_list.
tests/test_litellm/proxy/auth/test_auth_utils.py:1109
↓ 14 callers
Function
_make_hook
(claim: bool = True)
tests/test_litellm/router_strategy/adaptive_router/test_hooks.py:19
↓ 14 callers
Function
_make_httpx_status_error
Create a real httpx.HTTPStatusError for testing.
tests/test_litellm/llms/custom_httpx/test_credential_leak_prevention.py:31
↓ 14 callers
Function
_make_mock_request
Create a mock FastAPI Request object.
tests/test_litellm/proxy/management_endpoints/scim/test_scim_v2_discovery.py:30
↓ 14 callers
Function
_make_row
( policy_id="pid-1", policy_name="test-policy", version_number=1, version_status="production",
tests/test_litellm/proxy/policy_engine/test_policy_versioning.py:22
↓ 14 callers
Function
_make_user
(role: str, user_id: str = "user-1")
tests/litellm/proxy/common_utils/test_rbac_utils.py:20
↓ 14 callers
Method
_map_reasoning_effort
Capability probes read the cost map under ``custom_llm_provider``; ``llm_provider`` only tags raised exceptions.
litellm/llms/anthropic/chat/transformation.py:1166
↓ 14 callers
Function
_mcp_request
(name="lookup", args=None, jsonrpc=False, **extra)
tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py:112
↓ 14 callers
Function
_mock_env_vars_prisma
Build a MagicMock prisma_client whose env-vars table returns ``row``.
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_env_vars.py:866
↓ 14 callers
Function
_mock_http_handler
Return a mock that mirrors litellm's ``AsyncHTTPHandler`` contract. Two properties of the real handler matter for these tests and were the so
tests/test_litellm/proxy/agent_endpoints/test_databricks_oauth.py:30
↓ 14 callers
Method
_parse_json_response
Parse direct JSON response (non-streaming). Supports multiple agent response schemas: 0. {"jsonrpc": "2.0", "result": {"mess
litellm/llms/bedrock/chat/agentcore/transformation.py:376
↓ 14 callers
Function
_prefs
Build a minimal ModelPreferences-like object.
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_sampling_priority_selection.py:23
↓ 14 callers
Method
_prepare_payload
(self, model: str, api_params: WatsonXAPIParams)
litellm/llms/watsonx/common_utils.py:340
↓ 14 callers
Function
_safe_convert_created_field
Safely convert a 'created' field value to an integer. Some providers (like SambaNova) return the 'created' field as a float (Unix timest
litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py:73
↓ 14 callers
Method
_update_config_fields
Updates the config fields with the new values from the DB Args: current_config (dict): Current configuration dictionary
litellm/proxy/proxy_server.py:5543
↓ 14 callers
Function
_validation_cache
()
tests/test_litellm/proxy/auth/test_auth_checks.py:3421
↓ 14 callers
Function
_write_health_state_to_router_cache
Write deployment health states to the router's health state cache for health-check-driven routing. No-op if the feature is disabled.
litellm/proxy/proxy_server.py:3099
↓ 14 callers
Function
aP
()
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 14 callers
Method
add_litellm_async_success_callback
Add a success callback to litellm._async_success_callback
litellm/litellm_core_utils/logging_callback_manager.py:90
↓ 14 callers
Method
aembedding
( self, model: str, input: Union[str, List], is_async: Optional[bool] = True,
litellm/router.py:4593
↓ 14 callers
Method
async_get_token
(self, config: DatabricksAppOAuthConfig)
litellm/proxy/agent_endpoints/databricks_oauth.py:147
↓ 14 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
↓ 14 callers
Function
call_cancel
( harness: CancelHarness, batch_id: str, *, provider: Optional[str] = None, user: Optional
tests/test_litellm/proxy/batches_endpoints/test_endpoints.py:1720
↓ 14 callers
Function
call_list
( harness: ListHarness, *, provider: Optional[str] = None, limit: Optional[int] = None, af
tests/test_litellm/proxy/batches_endpoints/test_endpoints.py:1338
↓ 14 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:2958
↓ 14 callers
Function
classify_prompt
Classify a single user prompt. Falls back to GENERAL when no rule matches. Empty/whitespace-only also returns GENERAL.
litellm/router_strategy/adaptive_router/classifier.py:122
↓ 14 callers
Method
clear
()
litellm/proxy/_experimental/out/_next/static/chunks/0pidya1qvuvx8.js:1
↓ 14 callers
Method
close
(self)
tests/test_litellm/llms/custom_httpx/test_http_handler.py:96
↓ 14 callers
Method
close
(self)
tests/test_litellm/caching/test_llm_caching_handler.py:41
↓ 14 callers
Method
create_posthog_event_payload
Helper function to create a PostHog event payload for logging Args: kwargs (Dict[str, Any]): request kwargs containing s
litellm/integrations/posthog.py:142
↓ 14 callers
Function
create_standard_logging_payload
()
tests/logging_callback_tests/test_posthog.py:17
↓ 14 callers
Function
eG
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 14 callers
Function
em
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 14 callers
Function
en
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/15hm8gokjq2uu.js:13
↓ 14 callers
Method
exists
Check if a provider is defined via JSON
litellm/llms/openai_like/json_loader.py:64
↓ 14 callers
Function
extract_original_video_id
Extract original video ID without encoding.
litellm/types/videos/utils.py:116
↓ 14 callers
Function
filter_web_search_deployments
If the request is websearch, filter out deployments that don't support web search
litellm/router_utils/common_utils.py:100
↓ 14 callers
Method
flush_queue
Snapshot, send, and drain in one consistent step. Overrides the base implementation so the same snapshot drives both the HTTP send an
litellm/integrations/rubrik.py:455
↓ 14 callers
Function
generate_key_helper_fn
( request_type: Literal["user", "key"], # identifies if this request is from /user/new or /key/generate
litellm/proxy/management_endpoints/key_management_endpoints.py:3498
↓ 14 callers
Method
get_access_token
(self)
litellm/llms/xai/oauth.py:96
↓ 14 callers
Function
get_all_fallbacks
Get all fallbacks for a given model from the router's fallback configuration. Args: model: The model name to get fallbacks for
litellm/proxy/auth/model_checks.py:423
↓ 14 callers
Method
get_api_base
Return the API base URL for the provider
tests/llm_translation/test_evals_api.py:81
↓ 14 callers
Method
get_api_key
Resolve xAI API keys while preserving endpoint-specific legacy order. Chat uses xai_key before XAI_API_KEY without adding a generic
litellm/llms/xai/common_utils.py:48
↓ 14 callers
Function
get_base_url
Extract base URL from OpenAPI spec.
litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py:118
↓ 14 callers
Method
get_config_model
Returns the config model for the guardrail This is used to render the config model in the UI.
litellm/integrations/custom_guardrail.py:298
↓ 14 callers
Method
get_cost_for_built_in_tools
Get the cost of using built-in tools. Supported tools: - Web Search - File Search - Vector Store (Azure)
litellm/litellm_core_utils/llm_cost_calc/tool_call_cost_tracking.py:34
↓ 14 callers
Function
get_guardrail_translation_mapping
Get the guardrail translation handler for a given call type. Args: call_type: The type of call (e.g., completion, acompletion, anthr
litellm/llms/__init__.py:151
↓ 14 callers
Function
get_mock_user_token
Create a mock UserAPIKeyAuth token for testing
tests/test_litellm/proxy/test_enforce_user_param.py:29
↓ 14 callers
Method
get_model_access_groups
If model_name is provided, only return access groups for that model. Parameters: - model_name: Optional[str] - the received
litellm/router.py:9501
↓ 14 callers
Function
get_original_file_id
Extract the original provider file/batch ID from an encoded ID. Handles IDs that start with "file-" or "batch_" prefix.
litellm/proxy/openai_files_endpoints/common_utils.py:181
↓ 14 callers
Function
get_server_root_path
Get the server root path from the environment variables. - If SERVER_ROOT_PATH is set, return it. - Otherwise, default to "/".
litellm/proxy/utils.py:5900
↓ 14 callers
Method
get_supported_perplexity_optional_params
Get the set of Perplexity unified search parameters. These are the standard parameters that providers should transform from.
litellm/llms/base_llm/search/transformation.py:99
↓ 14 callers
Function
get_tags_from_request_body
Extract tags from request body metadata. Args: request_body: The request body dictionary Returns: List of tag names (st
litellm/proxy/common_utils/http_parsing_utils.py:434
↓ 14 callers
Method
handle_callback_failure
Handle callback logging failures by incrementing Prometheus metrics. Call this method in exception handlers within your callback whe
litellm/integrations/custom_logger.py:918
↓ 14 callers
Function
invalidate_config_param
Evict from both cache layers; call after every LiteLLM_Config write.
litellm/proxy/utils.py:2752
↓ 14 callers
Function
is_allowed_to_call_vector_store_endpoint
Check if the user is allowed to call the vector store endpoint. Cover: 1. Creating a vector store index 2. Reading a vector store in
litellm/proxy/vector_store_endpoints/utils.py:341
↓ 14 callers
Function
l
()
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 14 callers
Function
l
()
litellm/proxy/_experimental/out/_next/static/chunks/0e9hs7onyj28m.js:1
↓ 14 callers
Method
maybe_emit_verdict
(self, report)
tests/_vcr_conftest_common.py:2067
↓ 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
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:4156
↓ 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
Method
stream
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0piozaeodiue..js:30
↓ 14 callers
Function
stringify
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 14 callers
Function
strip_bedrock_routing_prefix
Strip LiteLLM routing prefixes from model name.
litellm/llms/bedrock/common_utils.py:605
↓ 14 callers
Function
t
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0e9hs7onyj28m.js:1
↓ 14 callers
Method
terminate
(self)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py:1569
↓ 14 callers
Method
to_json
(self, **kwargs)
litellm/types/router.py:463
↓ 14 callers
Method
transform_anthropic_messages_request
( self, model: str, messages: List[Dict], anthropic_messages_optional_request_
litellm/llms/deepseek/messages/transformation.py:113
↓ 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:1302
↓ 14 callers
Method
tx
(self)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_env_vars.py:961
↓ 14 callers
Function
u
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0e9hs7onyj28m.js:1
← previous
next →
1,101–1,200 of 71,069, ranked by callers