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
↓ 9 callers
Function
_make_window
()
tests/test_litellm/integrations/focus/test_mavvrik_destination.py:19
↓ 9 callers
Method
_map_tool_choice
( self, tool_choice: Optional[str], parallel_tool_use: Optional[bool], )
litellm/llms/anthropic/chat/transformation.py:575
↓ 9 callers
Function
_mock_cli_sso_start_response
( login_id: str = "cli-session-uuid-456", poll_secret: str = "poll-secret", user_code: str = "ABCD
tests/test_litellm/proxy/client/cli/test_auth_commands.py:27
↓ 9 callers
Function
_oauth_cred
(access_token="at-live", refresh_token=None, expires_in_seconds=None)
tests/test_litellm/proxy/_experimental/mcp_server/test_db_credentials.py:414
↓ 9 callers
Method
_parse_ragflow_model
Parse RAGFlow model name format: ragflow/{endpoint_type}/{id}/{model_name} Args: model: Model name in format ragflow/cha
litellm/llms/ragflow/chat/transformation.py:31
↓ 9 callers
Function
_prep_env
(monkeypatch)
tests/test_litellm/llms/sap/test_sap_fetch_creds.py:46
↓ 9 callers
Function
_prepare_request_data_and_content
Helper function to route data/content parameters correctly for httpx requests This prevents httpx DeprecationWarnings that cause memory leak
litellm/llms/custom_httpx/http_handler.py:147
↓ 9 callers
Function
_read_ws_model_from_first_frame
Read the first WS frame and return (model, raw_message), or None on error. Sends an appropriate error frame and closes the socket before returnin
litellm/proxy/response_api_endpoints/endpoints.py:922
↓ 9 callers
Function
_replay
(turns: list)
tests/test_litellm/router_strategy/adaptive_router/test_signals.py:22
↓ 9 callers
Function
_req_with_headers
(headers, body=b"")
tests/test_litellm/test_vcr_safe_body_matcher.py:37
↓ 9 callers
Method
_resolve_num_trusted_hops
(raw_num_trusted_hops: object)
litellm/proxy/auth/ip_address_utils.py:223
↓ 9 callers
Method
_resolve_user_id
Resolve the Entra user object ID from request data or auth context. Returns the strongest available identity walking down four sources, in
litellm/proxy/guardrails/guardrail_hooks/microsoft_purview/base.py:264
↓ 9 callers
Function
_resp_with_content
Build a ModelResponse-like object with a single assistant message.
tests/test_litellm/router_strategy/adaptive_router/test_hooks.py:26
↓ 9 callers
Method
_rotate_key
Rotate a single key using existing regenerate_key_fn and call the rotation hook
litellm/proxy/common_utils/key_rotation_manager.py:159
↓ 9 callers
Method
_run
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:1
↓ 9 callers
Function
_sanitize_error_information_for_spend_logs
Sanitize ``error_information`` before it lands in ``LiteLLM_SpendLogs.metadata``. Provider errors are stored verbatim via ``str(original_exc
litellm/proxy/spend_tracking/spend_tracking_utils.py:795
↓ 9 callers
Method
_scan_tool_calls_for_guardrail
Scan tool call arguments with allow/block/mask treatment (in-place modification). Each tool call is sent as a ``tool_event`` using the canoni
litellm/proxy/guardrails/guardrail_hooks/panw_prisma_airs/panw_prisma_airs.py:1381
↓ 9 callers
Method
_scanned_prompt
(guardrail, data, monkeypatch)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_repelloai.py:284
↓ 9 callers
Function
_set_object_metadata_field
Helper function to set metadata fields that require premium user checks Args: object_data: The team/key/organization/project data ob
litellm/proxy/management_endpoints/common_utils.py:373
↓ 9 callers
Function
_should_convert_tool_call_to_json_mode
Determine if tool calls should be converted to JSON mode
litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py:529
↓ 9 callers
Function
_spec_of
(baseline, slack)
tests/test_litellm/test_budget_ratchet_check.py:22
↓ 9 callers
Function
_strip_image_b64_payloads
Replace ``b64_json`` payloads in image-gen responses before save. Image-edit and image-generation responses carry the full base64 PNG/JPEG (1
tests/_vcr_conftest_common.py:289
↓ 9 callers
Function
_text
(text: str)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_sampling_tool_conversion.py:24
↓ 9 callers
Method
_text_stream
( self, texts, *, input_tokens=12, cache_creation=0, cache_rea
tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py:1088
↓ 9 callers
Function
_tool_use
(*, name: str, tool_id: str, input_data: Dict[str, Any])
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_sampling_tool_conversion.py:28
↓ 9 callers
Method
_transform_chat_completion_chunk_to_response_api_chunk
Transform a chat completion chunk to a response API chunk. This currently handles emitting the OutputTextDeltaEvent, which is used b
litellm/responses/litellm_completion_transformation/streaming_iterator.py:962
↓ 9 callers
Method
_translate_streaming_openai_chunk_to_anthropic_content_block
( self, choices: List[Union[OpenAIStreamingChoice, StreamingChoices]] )
litellm/llms/anthropic/experimental_pass_through/adapters/transformation.py:1358
↓ 9 callers
Method
_try_waitpid_watch
Watch engine PID via os.waitpid() in a dedicated thread. The thread blocks on os.waitpid(pid, 0) which is a kernel-level wait and wit
litellm/proxy/utils.py:4141
↓ 9 callers
Method
_unwrap_encrypted_content_with_model_id
Unwrap encrypted_content to extract model_id and original content. Returns: Tuple of (model_id, original_encrypted_content).
litellm/responses/utils.py:283
↓ 9 callers
Method
_update_responses_api_response_id_with_model_id
( responses_api_response: ResponsesAPIResponse, custom_llm_provider: Optional[str], li
litellm/responses/utils.py:164
↓ 9 callers
Function
_virtual_key_max_budget_alert_check
Triggers a budget alert if the token has reached EMAIL_BUDGET_ALERT_MAX_SPEND_ALERT_PERCENTAGE (default 80%) of its max budget. This is a
litellm/proxy/auth/auth_checks.py:3624
↓ 9 callers
Function
a
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 9 callers
Function
a
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 9 callers
Method
aclose
Close the dedicated HTTP clients used by this logger.
litellm/integrations/rubrik.py:151
↓ 9 callers
Method
acount_tokens
Count tokens using Google Gen AI Studio countTokens endpoint. Args: contents: The content to count tokens for (Google Ge
litellm/llms/gemini/count_tokens/handler.py:80
↓ 9 callers
Method
acreate_batch
( self, model: str, **kwargs, )
litellm/router.py:4931
↓ 9 callers
Function
adapt_messages_to_generic_oci_standard_content_message
Convert a plain-text or multipart content message to OCI format.
litellm/llms/oci/chat/generic.py:58
↓ 9 callers
Method
add
(e,t,s)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:30
↓ 9 callers
Method
add_litellm_async_failure_callback
Add a failure callback to litellm._async_failure_callback
litellm/litellm_core_utils/logging_callback_manager.py:96
↓ 9 callers
Function
add_provider_specific_params_to_optional_params
Add provider specific params to optional_params
litellm/utils.py:4313
↓ 9 callers
Method
aembedding
( self, model: str, input: list, model_response: EmbeddingResponse, pr
litellm/llms/custom_llm.py:179
↓ 9 callers
Function
aggregate_report_outcome
Fold a worker-produced VCR outcome into the controller's session stats. No-op outside the xdist controller path: * On a worker, ``_session_s
tests/_vcr_conftest_common.py:1574
↓ 9 callers
Function
apidom_evaluate
(s,o,i={})
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 9 callers
Method
apply_guardrail
( self, inputs: GenericGuardrailAPIInputs, request_data: dict, input_type: Lit
litellm/proxy/guardrails/guardrail_hooks/block_code_execution/block_code_execution.py:516
↓ 9 callers
Method
apply_key_tags_pre_auth
Merge key metadata tags into request_data before _tag_max_budget_check.
litellm/proxy/litellm_pre_call_utils.py:1142
↓ 9 callers
Method
arun_code
(self, *, container, code, **kwargs)
tests/test_litellm/integrations/code_interpreter_interception/test_handler.py:45
↓ 9 callers
Function
assert_canonical_tool_event
Assert tool_event has canonical PANW schema (no legacy keys).
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_panw_prisma_airs.py:123
↓ 9 callers
Method
async_function_with_retries
(self, *args, **kwargs)
litellm/router.py:6288
↓ 9 callers
Method
async_get_azure_client
( self, api_key: Optional[str], api_base: Optional[str], api_version: Optional
litellm/llms/azure/assistants.py:54
↓ 9 callers
Method
async_get_cache
(self, key, parent_otel_span: Optional[Span] = None, **kwargs)
litellm/caching/redis_cache.py:1066
↓ 9 callers
Method
async_get_cache
(self, key, *args, **kwargs)
tests/test_litellm/proxy/auth/test_resolvers_store.py:25
↓ 9 callers
Method
async_get_openai_client
( self, api_key: Optional[str], api_base: Optional[str], timeout: Union[float,
litellm/llms/openai/openai.py:2199
↓ 9 callers
Method
async_log_success_event
( self, kwargs, response_obj, start_time, end_time )
tests/test_litellm/responses/test_no_duplicate_spend_logs.py:73
↓ 9 callers
Method
async_lpop
( self, key: str, count: Optional[int] = None, parent_otel_span: Optional[Span
litellm/caching/redis_cache.py:1573
↓ 9 callers
Method
async_post_call_streaming_iterator_hook
Passes the entire stream to the guardrail This is useful for guardrails that need to see the entire response, such as PII masking.
litellm/proxy/guardrails/guardrail_hooks/unified_guardrail/unified_guardrail.py:253
↓ 9 callers
Method
async_pre_mcp_tool_call_hook
Test access control validation
tests/mcp_tests/test_mcp_hooks.py:32
↓ 9 callers
Method
async_read_secret
Async function to read a secret from AWS Secrets Manager Returns: str: Secret value Raises: ValueErr
litellm/secret_managers/aws_secret_manager_v2.py:113
↓ 9 callers
Method
async_realtime
( self, model: str, websocket: Any, logging_obj: LiteLLMLogging, api_b
litellm/llms/openai/realtime/handler.py:107
↓ 9 callers
Method
async_rotate_secret
Async function to rotate a secret by creating a new one and deleting the old one. This allows for both value and name changes during
litellm/secret_managers/base_secret_manager.py:103
↓ 9 callers
Method
async_set_cache
Internal method to check the type of the result & cache used and adds the result to the cache accordingly Args: result:
litellm/caching/caching_handler.py:925
↓ 9 callers
Method
async_upload_data_to_s3
(self, batch_logging_element: s3BatchLoggingElement)
litellm/integrations/s3_v2.py:274
↓ 9 callers
Function
attach_object_permission_to_dict
Helper method to attach object_permission to a dictionary if object_permission_id is set. This function: 1. Checks if the dictionary has
litellm/proxy/management_helpers/object_permission_utils.py:26
↓ 9 callers
Method
batch_
(self)
tests/test_litellm/proxy/common_utils/test_reset_budget_job.py:135
↓ 9 callers
Function
build_owner_filter
Return a Prisma `where` fragment that scopes a managed-resource listing to records the caller is allowed to see. - ``{}`` means no scoping (p
litellm/llms/base_llm/managed_resources/isolation.py:33
↓ 9 callers
Function
build_prepared_request
( *, logging_obj: RecordingLogging | None = None, provider_config: FakeOCRConfig | None = None,
tests/test_litellm/ocr/test_rust_bridge.py:185
↓ 9 callers
Function
call
(method: str, body: bytes = b"")
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py:2545
↓ 9 callers
Function
check_complete_credentials
if 'api_base' in request body. Check if complete credentials given. Prevent malicious attacks. Supplying an ``api_key`` is necessary but not
litellm/proxy/auth/auth_utils.py:54
↓ 9 callers
Function
check_tools_allowlist
Enforce key/team tool allowlist (metadata.allowed_tools). No DB in hot path — effective allowlist is read from valid_token.metadata and valid
litellm/proxy/auth/auth_checks.py:422
↓ 9 callers
Method
check_user_access_to_response_id
( self, response_id_user_id: Optional[str], response_id_team_id: Optional[str],
litellm/proxy/hooks/responses_id_security.py:67
↓ 9 callers
Function
claim_onboarding_link
Special route. Allows UI link share user to update their password. - Get the invite link - Validate it's still 'valid' - Check if us
litellm/proxy/proxy_server.py:13354
↓ 9 callers
Method
cleanup_old_spend_logs
Main cleanup function. Deletes old spend logs in batches. If pod_lock_manager is available, ensures only one pod runs cleanup.
litellm/proxy/db/db_transaction_queue/spend_log_cleanup.py:156
↓ 9 callers
Method
clear
()
litellm/proxy/_experimental/out/_next/static/chunks/0n.a~e5dwfnkn.js:1
↓ 9 callers
Function
cloneShallow
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 9 callers
Method
close
Close the aiohttp client session and transport if we own them.
litellm/llms/custom_httpx/aiohttp_handler.py:107
↓ 9 callers
Method
converse_chunk_parser
(self, chunk_data: dict)
litellm/llms/bedrock/chat/invoke_handler.py:1483
↓ 9 callers
Function
convert_to_anthropic_tool_invoke
OpenAI tool invokes: { "role": "assistant", "content": null, "tool_calls": [ { "id": "call_abc123",
litellm/litellm_core_utils/prompt_templates/factory.py:1754
↓ 9 callers
Function
convert_to_streaming_response
( response_object: Optional[dict] = None, )
litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py:281
↓ 9 callers
Function
createNamespace
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 9 callers
Method
create_error_response
Create an Anthropic-formatted error response dict. Anthropic error format: { "type": "error", "error
litellm/anthropic_interface/exceptions/exception_mapping_utils.py:39
↓ 9 callers
Function
create_responses_config_class
Generate a Responses API config class dynamically from JSON configuration. Parallel to create_config_class() but for /v1/responses endpoints.
litellm/llms/openai_like/dynamic_config.py:170
↓ 9 callers
Method
delete_user
(self, user_id: str)
tests/e2e/budgets/budget_client.py:232
↓ 9 callers
Method
destroy
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 9 callers
Function
df
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 9 callers
Function
dispatchPluginsSync
(s,o,i={})
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 9 callers
Method
dispatch_success_handlers
Route success logging to async and/or sync handlers for this request. ``prefer_async_handlers`` only bypasses the sync-SDK-only shortcut (e.g
litellm/litellm_core_utils/litellm_logging.py:1513
↓ 9 callers
Function
du
(t)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 9 callers
Function
eH
()
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 9 callers
Function
e_
(e,t,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 9 callers
Function
el
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:46
↓ 9 callers
Function
encode_prompt_id
Convert GitLab path IDs like 'invoice/extract' → 'gitlab::invoice::extract
litellm/integrations/gitlab/gitlab_prompt_manager.py:28
↓ 9 callers
Method
enforce_member_can_assign_access_groups
Field-level opt-in gate: a non-admin team member may only set `access_group_ids` on a (team) key if their team has opted in by adding
litellm/proxy/management_helpers/team_member_permission_checks.py:141
↓ 9 callers
Method
execute_raw
(self, query, *args)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_env_vars.py:948
↓ 9 callers
Function
fetch_mcp_server
Get the info on the mcp server specified by the `server_id` Parameters: - server_id: str - Required. The unique identifier of
litellm/proxy/management_endpoints/mcp_management_endpoints.py:1218
↓ 9 callers
Method
file_content
( self, _is_async: bool, file_content_request: FileContentRequest, api_base: s
litellm/llms/openai/openai.py:1675
↓ 9 callers
Method
flush_and_get_aggregated_daily_spend_update_transactions
Get all updates from the queue and return all updates aggregated by daily_transaction_key. Works for both user and team spend updates.
litellm/proxy/db/db_transaction_queue/daily_spend_update_queue.py:80
↓ 9 callers
Method
flush_state_to_db
Drain state aggregator and apply to LiteLLM_AdaptiveRouterState. Returns number of cells flushed.
litellm/router_strategy/adaptive_router/update_queue.py:96
↓ 9 callers
Method
freeze
()
litellm/proxy/_experimental/out/_next/static/chunks/101az3fsw7lje.js:1
↓ 9 callers
Method
from_dict
Create a LiteLLMSendMessageResponse from a dict. Args: response_dict: Dict with A2A response structure reque
litellm/types/agents.py:368
↓ 9 callers
Method
from_logging_entry
Build from one ``standard_logging_guardrail_information`` entry. Reads the canonical, provider-agnostic ``StandardLoggingGuardrailInformation
litellm/integrations/otel/model/payloads.py:196
↓ 9 callers
Method
get_all_latest_health_checks
Get the latest health check for each model. Uses DB-level DISTINCT ON (model_id, model_name) with ORDER BY checked_at DESC (
litellm/proxy/utils.py:4907
← previous
next →
1,901–2,000 of 68,180, ranked by callers