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
↓ 15 callers
Function
list_passthrough_ids_from_db
Query the DB for managed IDs the caller owns and return an OpenAI-style paginated list response. Returns ``None`` when ``prisma_client`` is u
litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:984
↓ 15 callers
Function
list_team_v2
Get a paginated list of teams with filtering and sorting options. Parameters: user_id: Optional[str] Only return teams w
litellm/proxy/management_endpoints/team_endpoints.py:4089
↓ 15 callers
Method
on
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:7
↓ 15 callers
Function
perform_redaction
Performs the actual redaction on the logging object and result.
litellm/litellm_core_utils/redact_messages.py:153
↓ 15 callers
Method
process_rotations
Main entry point - find and rotate keys that are due for rotation. Uses PodLockManager to ensure only one pod runs rotation in multi-
litellm/proxy/common_utils/key_rotation_manager.py:44
↓ 15 callers
Function
process_sso_jwt_access_token
Process SSO JWT access token and extract team IDs and user role if available. This function decodes the JWT access token and extracts team I
litellm/proxy/management_endpoints/ui_sso.py:725
↓ 15 callers
Method
render
Render a prompt template with the given variables. Args: prompt_id: The ID of the prompt template to render
litellm/integrations/dotprompt/prompt_manager.py:183
↓ 15 callers
Method
resolve_policy_guardrails
Resolve the final guardrails for a single policy, including inheritance. This method: 1. Resolves the inheritance chain
litellm/proxy/policy_engine/policy_resolver.py:70
↓ 15 callers
Function
rewrite_body_ids
Recursively walk a request body dict/list and resolve any passthrough managed IDs. Skips litellm internal keys (``litellm_*``). Returns
litellm/proxy/pass_through_endpoints/managed_id_rewriter.py:1126
↓ 15 callers
Method
safe_set_attribute
Safely sets an attribute on the span, ensuring the value is a primitive type.
litellm/integrations/opentelemetry.py:2463
↓ 15 callers
Function
sanitize_messages_for_tool_calling
Sanitize messages for tool calling to handle common issues when modify_params=True: Case A: Missing tool_result for tool_use (orphaned tool
litellm/litellm_core_utils/prompt_templates/factory.py:2223
↓ 15 callers
Method
send_text
Receive message from backend and store it
tests/llm_translation/realtime/base_realtime_tests.py:46
↓ 15 callers
Method
set_attribute
(self, key, value)
tests/test_litellm/integrations/otel/test_otel_v2_mount.py:59
↓ 15 callers
Function
t
(t,n,r,l,a)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 15 callers
Function
text_completion
( prompt: Union[ str, List[Union[str, List[Union[str, List[int]]]]] ], # Required: The prompt
litellm/main.py:6933
↓ 15 callers
Method
then
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 15 callers
Method
to_dict
Converts the ProxyException instance to a dictionary.
litellm/proxy/_types.py:3235
↓ 15 callers
Function
token_counter
Args: request: TokenCountRequest call_endpoint: bool - When set to "True" it will call the token counting endpoint - e.g Anthropi
litellm/proxy/proxy_server.py:10235
↓ 15 callers
Method
transform_chat_completion_response_to_responses_api_response
Transform a Chat Completion response into a Responses API response
litellm/responses/litellm_completion_transformation/transformation.py:1546
↓ 15 callers
Method
transform_image_edit_request
( self, model: str, prompt: Optional[str], image: Optional[FileTypes],
litellm/llms/bedrock/image_edit/amazon_nova_canvas_image_edit_transformation.py:298
↓ 15 callers
Method
transform_list_input_items_request
( self, response_id: str, api_base: str, litellm_params: GenericLiteLLMParams,
litellm/llms/openai/responses/transformation.py:500
↓ 15 callers
Function
transform_openai_input_gemini_content
Transform OpenAI embedding input to Gemini batchEmbedContents format. Each input element becomes a separate EmbedContentRequest, supporting
litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:209
↓ 15 callers
Function
transform_openai_input_gemini_embed_content
Transform OpenAI embedding input to Gemini embedContent format (multimodal). Args: input: GeminiEmbeddingInput with text, data URIs,
litellm/llms/vertex_ai/gemini_embeddings/batch_embed_content_transformation.py:257
↓ 15 callers
Method
transform_parsed_response
( self, completion_response: dict, raw_response: httpx.Response, model_respons
litellm/llms/anthropic/chat/transformation.py:2251
↓ 15 callers
Method
transform_response
(self, *args, **kwargs)
tests/test_litellm/test_thinking_enabled.py:31
↓ 15 callers
Method
transform_streaming_response
(self, **kwargs)
tests/llm_responses_api_testing/test_responses_hooks.py:239
↓ 15 callers
Method
transform_text_to_speech_request
Transform request to provider-specific format. Returns: TextToSpeechRequestData: A structured dict containing:
litellm/llms/base_llm/text_to_speech/transformation.py:109
↓ 15 callers
Method
transform_video_create_response
Transform the Veo video creation response. Veo returns: { "name": "operations/generate_1234567890",
litellm/llms/gemini/videos/transformation.py:291
↓ 15 callers
Function
u
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 15 callers
Method
update_state
Update the polling state in Redis Uses OpenAI Response object format with native status types: https://platform.openai.com/d
litellm/proxy/response_polling/polling_handler.py:84
↓ 14 callers
Function
Table
({ columns, dataSource, ...rest }: any)
ui/litellm-dashboard/src/components/UsagePage/components/UsagePageView.test.tsx:171
↓ 14 callers
Method
__init__
(self)
tests/test_litellm/proxy/guardrails/test_deferred_guardrail_logging.py:78
↓ 14 callers
Method
_add_proxy_hooks
Add proxy hooks to litellm.callbacks
litellm/proxy/utils.py:538
↓ 14 callers
Function
_build_model_response
()
tests/test_litellm/llms/test_predibase_transformation.py:12
↓ 14 callers
Method
_call_regular_mcp_tool
Call a regular MCP tool using the MCP client. Args: mcp_server: The MCP server configuration original_tool_n
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:3145
↓ 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:2975
↓ 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:1368
↓ 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
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
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
Method
_response_cost_calculator
Calculate response cost using result + logging object variables. used for consistent cost calculation across response headers + logg
litellm/litellm_core_utils/litellm_logging.py:1349
↓ 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:5474
↓ 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:3034
↓ 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:4582
↓ 14 callers
Method
async_get_token
(self, config: DatabricksAppOAuthConfig)
litellm/proxy/agent_endpoints/databricks_oauth.py:147
↓ 14 callers
Function
authorize
( request: Request, redirect_uri: str, client_id: Optional[str] = None, state: str = "", m
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py:754
↓ 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
clone
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.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
Method
defer
Register a teardown action for any resource the test just created.
tests/e2e/lifecycle.py:97
↓ 14 callers
Function
e3
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 14 callers
Function
ef
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 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
f
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 14 callers
Function
fetchAvailableModels
(accessToken: string)
ui/litellm-dashboard/src/components/llm_calls/fetch_models.tsx:13
↓ 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
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_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:9472
↓ 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
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:2750
↓ 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
Method
maybe_emit_verdict
(self, report)
tests/_vcr_conftest_common.py:2067
← previous
next →
1,001–1,100 of 68,180, ranked by callers