Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/BerriAI/litellm
/ functions
Functions
68,141 in github.com/BerriAI/litellm
⨍
Functions
68,141
◇
Types & classes
10,035
↳
Endpoints
1,734
↓ 20 callers
Method
get_proxy_hook
Get a proxy hook from the proxy_hook_mapping
litellm/proxy/utils.py:557
↓ 20 callers
Function
handle_generic_stream_chunk
Parse a single GENERIC SSE chunk into a LiteLLM ModelResponseStream.
litellm/llms/oci/chat/generic.py:361
↓ 20 callers
Function
hash_token
(token: str)
litellm/proxy/_types.py:215
↓ 20 callers
Function
make_mcp_request_obj
()
tests/test_litellm/proxy/utils/proxy_logging/conftest.py:119
↓ 20 callers
Function
n
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 20 callers
Function
new_managed_id
Mint a fresh managed ID for a given raw provider ID.
litellm/proxy/pass_through_endpoints/managed_id_codec.py:95
↓ 20 callers
Method
parse
()
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:4
↓ 20 callers
Function
prometheus_label_factory
Returns a dictionary of label + values for prometheus. Ensures end_user param is not sent to prometheus if it is not supported. When ``
litellm/integrations/prometheus.py:3618
↓ 20 callers
Function
record_vcr_outcome
Call from the post-yield section of an autouse fixture per test.
tests/_vcr_conftest_common.py:1784
↓ 20 callers
Method
resolve_server_api_key
Resolve a single-secret search API key, falling back to a server-managed secret only when the request targets a trusted host.
litellm/llms/base_llm/search/transformation.py:139
↓ 20 callers
Method
transform_realtime_request
( self, message: str, model: str, session_configuration_request: Optional[str]
litellm/llms/gemini/realtime/transformation.py:570
↓ 20 callers
Function
ty
(e,t,n,r)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 19 callers
Function
F
litellm/proxy/_experimental/out/_next/static/chunks/0rdv7_7_95b-1.js:1
↓ 19 callers
Method
__init__
( self, content=None, role=None, function_call=None, tool_calls=None,
litellm/types/utils.py:1266
↓ 19 callers
Method
_auth_with_aws_role
Authenticate with AWS Role
litellm/llms/bedrock/base_aws_llm.py:1048
↓ 19 callers
Function
_base_patches
(agent: MagicMock)
tests/test_litellm/proxy/agent_endpoints/test_a2a_endpoints.py:382
↓ 19 callers
Method
_calculate_usage
( completion_response: Union[GenerateContentResponseBody, BidiGenerateContentServerMessage], )
litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py:1746
↓ 19 callers
Function
_can_object_call_model
Checks if token can call a given model Args: - model: str - llm_router: Optional[Router] - models: List[str]
litellm/proxy/auth/auth_checks.py:2856
↓ 19 callers
Method
_handle_success
Create the litellm_request span then close the proxy span.
litellm/integrations/opentelemetry.py:1122
↓ 19 callers
Function
_make_agent_mock
(url: str = "http://backend-agent:10001")
tests/test_litellm/proxy/agent_endpoints/test_a2a_endpoints.py:355
↓ 19 callers
Function
_make_challenge
(verifier: str)
tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py:36
↓ 19 callers
Function
_make_request_mock
( method: str, params: dict, request_id: object = "req-1" )
tests/test_litellm/proxy/agent_endpoints/test_a2a_endpoints.py:366
↓ 19 callers
Function
_make_run
( run_id: str = "run-1", session_id: str = "sess-1", workflow_type: str = "shin-builder", stat
tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py:26
↓ 19 callers
Function
_obo_server
(**overrides)
tests/test_litellm/proxy/_experimental/mcp_server/auth/test_token_exchange.py:28
↓ 19 callers
Method
_resolve_static_headers_with_env_vars
Return server.static_headers with ``${NAME}`` interpolated. Globals come from ``server.env_vars`` entries with ``scope=="global"``. P
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1642
↓ 19 callers
Function
_run_centralized_common_checks
Run ``common_checks`` once at the ``user_api_key_auth`` wrapper boundary, regardless of which ``_user_api_key_auth_builder`` path returned. Th
litellm/proxy/auth/user_api_key_auth.py:1989
↓ 19 callers
Function
_sanitize_request_body_for_spend_logs_payload
Recursively sanitize request body to prevent logging large base64 strings or other large values. Truncates strings longer than MAX_STRING_LEN
litellm/proxy/spend_tracking/spend_tracking_utils.py:583
↓ 19 callers
Method
_serialize_chunk
Serialize a streaming chunk to a JSON string for WebSocket transmission.
litellm/responses/streaming_iterator.py:1705
↓ 19 callers
Method
_transform_request_helper
Bedrock doesn't support tool calling without `tools=` param specified.
litellm/llms/bedrock/chat/converse_transformation.py:1478
↓ 19 callers
Method
_transform_response
( self, model: str, response: httpx.Response, model_response: ModelResponse,
litellm/llms/bedrock/chat/converse_transformation.py:2028
↓ 19 callers
Function
append_query_params
(url: Optional[str], params: dict)
litellm/proxy/proxy_cli.py:77
↓ 19 callers
Method
async_get_cache
( self, key, parent_otel_span: Optional[Span] = None, local_only: bool = False
litellm/caching/dual_cache.py:205
↓ 19 callers
Function
custom_prompt
( role_dict: dict, messages: list, initial_prompt_value: str = "", final_prompt_value: str = "
litellm/litellm_core_utils/prompt_templates/factory.py:5145
↓ 19 callers
Function
decode_model_from_file_id
Extract model name from an encoded file/batch ID. Handles IDs that start with "file-" or "batch_" prefix.
litellm/proxy/openai_files_endpoints/common_utils.py:152
↓ 19 callers
Function
duration_in_seconds
Parameters: - duration: - "<number>s" - seconds - "<number>m" - minutes - "<number>h" - hours - "<number>d" -
litellm/litellm_core_utils/duration_parser.py:38
↓ 19 callers
Function
ep
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 19 callers
Function
generate_key
( session, i, budget=None, budget_duration=None, models=["azure-models", "gpt-4", "gpt-ima
tests/test_keys.py:60
↓ 19 callers
Method
getAPIList
(e,t,s)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:31
↓ 19 callers
Function
get_audit_log_changed_by
( *, litellm_changed_by: Optional[str], user_api_key_dict: UserAPIKeyAuth, litellm_proxy_admin
litellm/proxy/management_helpers/audit_logs.py:38
↓ 19 callers
Method
get_error_class
(self, *args, **kwargs)
tests/test_litellm/test_thinking_enabled.py:40
↓ 19 callers
Method
get_labels
(label_name: DEFINED_PROMETHEUS_METRICS)
litellm/types/integrations/prometheus.py:730
↓ 19 callers
Method
get_labels_for_metric
Get the labels for a metric, filtered if configured. The result is cached on the instance so the label set used to construct
litellm/integrations/prometheus.py:964
↓ 19 callers
Method
get_model_ids
if 'model_name' is none, returns all. Returns list of model id's. Optimized with O(1) or O(k) index lookup when model_name
litellm/router.py:9020
↓ 19 callers
Function
get_prisma_client_or_throw
(message: str)
litellm/proxy/utils.py:5850
↓ 19 callers
Method
is_model_gpt_5_model
(cls, model: str)
litellm/llms/openai/chat/gpt_5_transformation.py:58
↓ 19 callers
Function
make_response
Build a minimal ModelResponse-like dict.
tests/test_litellm/integrations/newrelic/test_newrelic.py:73
↓ 19 callers
Function
n
()
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 19 callers
Function
process_response_headers
`preserve_litellm_internal_headers` must only be True when the input is a LiteLLM-owned dict (e.g. `_hidden_params["additional_headers"]` tha
litellm/litellm_core_utils/core_helpers.py:233
↓ 19 callers
Method
recreate_prisma_client
Disconnect and reconnect the Prisma client with a new database URL. Kills the old engine subprocess directly (SIGTERM → SIGKILL) rather than
litellm/proxy/db/prisma_client.py:323
↓ 19 callers
Function
release_budget_reservation
(budget_reservation: Optional[dict])
litellm/proxy/spend_tracking/budget_reservation.py:190
↓ 19 callers
Method
request
(method: HttpMethod, path: string, options?: RequestOptions)
ui/litellm-dashboard/src/lib/http/client.ts:75
↓ 19 callers
Function
safe_json_loads
Safely parse a JSON string. If parsing fails, return the default value (None by default).
litellm/litellm_core_utils/safe_json_loads.py:9
↓ 19 callers
Method
set
(...e)
litellm/proxy/_experimental/out/_next/static/chunks/0pidya1qvuvx8.js:1
↓ 19 callers
Method
should_call_route
Check if management route is disabled and raise exception
litellm/proxy/auth/route_checks.py:67
↓ 19 callers
Method
transform
Transform LiteLLM data to CBF format, dropping records with zero successful_requests or invalid CZRNs.
litellm/integrations/cloudzero/transform.py:37
↓ 19 callers
Method
transform_video_create_request
Transform the video creation request for Veo API. Veo expects: { "instances": [ {
litellm/llms/gemini/videos/transformation.py:240
↓ 19 callers
Method
translate_response
Translate an OpenAI ResponsesAPIResponse to AnthropicMessagesResponse.
litellm/llms/anthropic/experimental_pass_through/responses_adapters/transformation.py:384
↓ 19 callers
Method
url
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 19 callers
Method
validate_environment
Expects LAGO_API_BASE, LAGO_API_KEY, LAGO_API_EVENT_CODE, Optional: LAGO_API_CHARGE_BY in t
litellm/integrations/lago.py:38
↓ 18 callers
Function
_apply
Run the production call path: load from env, write to env.
tests/test_litellm/proxy/db/test_db_url_settings.py:26
↓ 18 callers
Function
_common_key_generation_helper
( data: GenerateKeyRequest, user_api_key_dict: UserAPIKeyAuth, litellm_changed_by: Optional[str],
litellm/proxy/management_endpoints/key_management_endpoints.py:646
↓ 18 callers
Method
_common_logic
(self, kwargs: dict, response_obj)
litellm/integrations/openmeter.py:50
↓ 18 callers
Function
_get_call_stack_info
Get the function names from the previous 1-2 functions in the call stack. Args: num_frames: Number of previous frames to include (de
litellm/caching/redis_cache.py:60
↓ 18 callers
Function
_make_guardrail
(apply_result: dict)
tests/test_litellm/llms/bedrock/passthrough/guardrail_translation/test_handler.py:28
↓ 18 callers
Function
_make_rate_limiter
()
tests/test_litellm/proxy/hooks/test_batch_file_validation.py:891
↓ 18 callers
Function
_override_openai_response_model
Force the OpenAI-compatible `model` field in the response to match what the client requested. LiteLLM internally prefixes some provider/depl
litellm/proxy/common_request_processing.py:572
↓ 18 callers
Function
_proxy_attrs_for_centralized_checks
Build the minimal proxy_server module attributes that _run_centralized_common_checks reads. ``master_key`` defaults to a non-None value becau
tests/test_litellm/proxy/auth/test_user_api_key_auth.py:2636
↓ 18 callers
Function
_redact_pii_matches
Redact match-like fields from a Bedrock ApplyGuardrail JSON payload. Delegates to :func:`redact_nested_match_and_regex_keys` (same rules as
litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:119
↓ 18 callers
Function
_scrub_db_overlay_remote_module_loads
Strip ``s3://`` / ``gcs://`` entries from the DB-overlay value for fields whose contents reach ``get_instance_fn``. The same scheme is allowed
litellm/proxy/proxy_server.py:3365
↓ 18 callers
Method
async_delete_cache
(self, key: str)
litellm/proxy/_experimental/mcp_server/outbound_credentials/dual_cache_token_backend.py:31
↓ 18 callers
Method
async_get_cache
- Check if the cache key is in-memory - Else: - add missing cache key from REDIS - update in-memory cache
litellm/proxy/hooks/batch_redis_get.py:93
↓ 18 callers
Method
attempt_db_reconnect
Attempt to reconnect the Prisma client in a singleflight manner. Returns: bool: True if reconnection succeeded, else Fal
litellm/proxy/utils.py:4598
↓ 18 callers
Function
clean_headers
Removes litellm api key from headers Args: headers: Request headers litellm_key_header_name: Custom header name for LiteLLM
litellm/proxy/litellm_pre_call_utils.py:574
↓ 18 callers
Method
client_ack_messages
(self)
litellm/litellm_core_utils/realtime_streaming.py:1141
↓ 18 callers
Method
complete
(e,t,r)
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:5
↓ 18 callers
Function
create_scratch_key
Seed a scratch-tagged key via /key/generate; returns its cleartext. Shared by the write-scenario matrices (key update/regenerate/delete). key
tests/proxy_behavior/management/conftest.py:102
↓ 18 callers
Method
disconnect
For closing connection on server shutdown
litellm/proxy/db/base_client.py:43
↓ 18 callers
Function
eL
()
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 18 callers
Function
eP
()
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 18 callers
Function
eT
(e)
litellm/proxy/_experimental/out/_next/static/chunks/101az3fsw7lje.js:1
↓ 18 callers
Function
emit_vcr_classification_summary
Render the per-classification summary at session end. Output sections (only included when non-empty): * **Verdict counts** — full breakdown
tests/_vcr_conftest_common.py:1885
↓ 18 callers
Method
get_anthropic_headers
( self, api_key: Optional[str] = None, auth_token: Optional[str] = None, anthr
litellm/llms/anthropic/common_utils.py:521
↓ 18 callers
Method
get_api_base
(api_base: Optional[str] = None)
litellm/llms/xai/common_utils.py:44
↓ 18 callers
Method
get_attached_policies
Get list of policy names attached to the given context. Args: context: The request context to match against Ret
litellm/proxy/policy_engine/attachment_registry.py:87
↓ 18 callers
Function
get_key_model_tpm_limit
Get the model tpm limit for a given api key. Priority order (returns first found): 1. Key metadata (model_tpm_limit) 2. Key model_ma
litellm/proxy/auth/auth_utils.py:859
↓ 18 callers
Method
get_mcp_server_by_name
Get the MCP Server from the server name. Uses priority-based matching to avoid collisions: 1. First pass: exact alias match
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:3885
↓ 18 callers
Method
get_redis_lock_key
(cronjob_id: str)
litellm/proxy/db/db_transaction_queue/pod_lock_manager.py:39
↓ 18 callers
Method
init
(self)
tests/e2e/lifecycle.py:29
↓ 18 callers
Method
initialize_azure_sdk_client
( self, litellm_params: dict, api_key: Optional[str], api_base: Optional[str],
litellm/llms/azure/common_utils.py:513
↓ 18 callers
Method
iter_lines
Mock iter_lines method for synchronous streaming.
tests/test_litellm/test_groq_streaming_encoding.py:32
↓ 18 callers
Function
l
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 18 callers
Method
load_attachments
Load attachments from a configuration list. Args: attachments_config: List of attachment dictionaries from YAML.
litellm/proxy/policy_engine/attachment_registry.py:47
↓ 18 callers
Function
merge_agent_card
Build the LiteLLM-fronted agent card. Args: upstream_card: Card returned by the upstream agent's well-known endpoint. Ma
litellm/proxy/a2a/agent_card.py:108
↓ 18 callers
Function
mock_open
Helper to create a mock file object
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_model_armor.py:1426
↓ 18 callers
Method
route
Route a requested model to the corresponding llm deployments based on the regex pattern loop through all the patterns and find the m
litellm/router_utils/pattern_match_deployments.py:112
↓ 18 callers
Function
sN
(e,t,n)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 18 callers
Method
set_cache
(self, key, value, local_only: bool = False, **kwargs)
litellm/proxy/common_utils/user_api_key_cache.py:132
↓ 18 callers
Function
supports_reasoning
Check if the given model supports reasoning and return a boolean value.
litellm/utils.py:2492
↓ 18 callers
Function
t
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 18 callers
Function
tl
(t,e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
← previous
next →
701–800 of 68,141, ranked by callers