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
↓ 8 callers
Method
_process_async_embedding_cached_response
Returns the final embedding cached response and a boolean indicating if all elements in the list have a cache hit For embedding resp
litellm/caching/caching_handler.py:384
↓ 8 callers
Function
_public_named_router
(*team_rows: dict)
tests/test_litellm/proxy/proxy_server/test_team_model_name_translation.py:1155
↓ 8 callers
Method
_reap_all_zombies
Reap ALL zombie child processes via waitpid(-1, WNOHANG). Returns a set of reaped PIDs. As PID 1 in Docker (or any process that spaw
litellm/proxy/utils.py:4119
↓ 8 callers
Method
_rebuild_anthropic_response_from_sse
Parse collected SSE bytes into an Anthropic Messages response dict. Processes SSE events in order: - message_start -> enve
litellm/llms/anthropic/experimental_pass_through/messages/agentic_streaming_iterator.py:258
↓ 8 callers
Method
_record_exception_on_span
Record exception information on the span using OTEL standard methods. This extracts error information from StandardLoggingPayload an
litellm/integrations/opentelemetry.py:1928
↓ 8 callers
Function
_relay_elicitation_to_downstream
Relay an elicitation request to the downstream MCP client. Uses the ServerSession's elicit_form() or elicit_url() methods to send the eli
litellm/proxy/_experimental/mcp_server/elicitation_handler.py:85
↓ 8 callers
Function
_reset
()
tests/test_litellm/sandbox/test_sandbox_tools.py:6
↓ 8 callers
Method
_resolve_category_file_path
Resolve a category file path that may be relative. Paths in policy templates (e.g. category_file) are often stored as relati
litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/content_filter.py:322
↓ 8 callers
Function
_resolve_session_key
Pick a stable per-conversation key for owner-cache attribution. Order: 1. Honor a client-supplied session id (`litellm_session_id` on eithe
litellm/router_strategy/adaptive_router/hooks.py:40
↓ 8 callers
Method
_responses_api_response_obj
Return a dict mimicking ResponsesAPIResponse with a message output.
tests/test_litellm/integrations/test_opentelemetry.py:3769
↓ 8 callers
Method
_route_openai_thinking_to_responses_api_if_needed
When users call `litellm.anthropic.messages.*` with a non-Anthropic model and `thinking={"type": "enabled", ...}`, LiteLLM converts t
litellm/llms/anthropic/experimental_pass_through/adapters/handler.py:294
↓ 8 callers
Function
_run_update
(data: UpdateMCPServerRequest, fields_set=None)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_partial_update.py:29
↓ 8 callers
Function
_sample_agent_config
()
tests/test_litellm/proxy/agent_endpoints/test_endpoints.py:33
↓ 8 callers
Function
_sanitize_file_path
Reject path traversal and URL-encode each path segment.
litellm/integrations/bitbucket/bitbucket_client.py:12
↓ 8 callers
Function
_select_model_by_priority
Score available models by MCP priority weights and return the best. Scoring strategy (per the MCP spec, priorities are 0-1 floats): * **cost
litellm/proxy/_experimental/mcp_server/sampling_handler.py:156
↓ 8 callers
Function
_server
(**overrides)
tests/test_litellm/proxy/_experimental/mcp_server/test_oauth2_token_cache.py:22
↓ 8 callers
Function
_server
(**kwargs)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_adapter.py:32
↓ 8 callers
Method
_set_langfuse_specific_attributes
Sets Langfuse specific metadata attributes onto the OTEL span. All keys supported by the vanilla Langfuse integration are mapped to
litellm/integrations/langfuse/langfuse_otel.py:212
↓ 8 callers
Method
_should_skip_metrics_for_invalid_key
Determine if Prometheus metrics should be skipped for invalid API key requests. This is a centralized validation method that extract
litellm/integrations/prometheus.py:1818
↓ 8 callers
Function
_stored_value
Pull the credential_b64 value passed to the most recent upsert call.
tests/test_litellm/proxy/_experimental/mcp_server/test_db_credentials.py:63
↓ 8 callers
Method
_stub_reconsider_guards
Default reconsider-guard stubs: pretend bot closed + no cooldown. The new safety guards (`was_closed_by_agent_shin`, `seconds_since_l
tests/test_litellm/test_github_triage_with_llm.py:1089
↓ 8 callers
Function
_summarize
(rows: list[SpendLogRow])
tests/e2e/spend_tracking/test_spend_tracking_e2e.py:36
↓ 8 callers
Function
_sync_guardrail_info_to_logging_obj
Copy standard_logging_guardrail_information from request_data into logging_obj. The @log_guardrail_information decorator writes guardrail info to
litellm/integrations/custom_guardrail.py:1038
↓ 8 callers
Function
_team_row
( *, team_id: str = "team-victim", metadata: dict | None = None, admin_user_id: str = "victim_
tests/test_litellm/proxy/management_endpoints/test_team_callback_endpoints.py:29
↓ 8 callers
Function
_tool_call
(arguments, name="f", tc_id="1")
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_vigil_guard.py:622
↓ 8 callers
Method
_transform_input_file_item_to_file_item
Transform a Responses API input_file item to a Chat Completion file item Args: item: Dictionary containing input_file ty
litellm/responses/litellm_completion_transformation/transformation.py:1126
↓ 8 callers
Function
_translate_model_name_for_response
For team-scoped DB rows, replace `model_name` with the public name in `model_info.team_public_model_name` before returning. The DB column and
litellm/proxy/proxy_server.py:12111
↓ 8 callers
Method
_update_headers_with_anthropic_beta
Auto-inject anthropic-beta headers based on features used. Handles: - context_management: adds 'context-management-2025-06-2
litellm/llms/anthropic/experimental_pass_through/messages/transformation.py:366
↓ 8 callers
Function
_update_single_user_helper
Helper function to update a single user. Used by both user_update and bulk_user_update endpoints. Returns the updated user data or raise
litellm/proxy/management_endpoints/internal_user_endpoints.py:1182
↓ 8 callers
Function
_verify_team_access
Verify the caller is authorized to manage the given team. Access is granted if: - Caller is a proxy admin, OR - Caller is an org adm
litellm/proxy/management_endpoints/team_endpoints.py:176
↓ 8 callers
Function
_worker_report
Stand-in for a pytest TestReport delivered to the xdist controller. Only the attributes ``aggregate_report_outcome`` reads (``nodeid``, ``whe
tests/llm_translation/test_vcr_classification.py:520
↓ 8 callers
Function
_yaml_escape
Escape a string for safe embedding in a double-quoted YAML scalar.
litellm/setup_wizard.py:184
↓ 8 callers
Function
a
litellm/proxy/_experimental/out/_next/static/chunks/05btv.l5gro_..js:10
↓ 8 callers
Function
acompletion_with_mcp
Async completion with MCP integration. This function handles MCP tool integration following the same pattern as aresponses_api_with_mcp.
litellm/responses/mcp/chat_completions_handler.py:80
↓ 8 callers
Method
acreate_fine_tuning_job
( self, create_fine_tuning_job_data: dict, openai_client: Union[AsyncOpenAI, AsyncAzur
litellm/llms/openai/fine_tuning/handler.py:100
↓ 8 callers
Function
adapt_messages_to_cohere_standard
Build a Cohere ``chatHistory`` list from an OpenAI-format message array. - All messages except the *last user message* are included. The caller p
litellm/llms/oci/chat/cohere.py:62
↓ 8 callers
Function
add
Add two numbers
tests/mcp_tests/mcp_server.py:32
↓ 8 callers
Function
add_fallback_headers_to_response
Add fallback headers to the response Args: response: The response to add the headers to attempted_fallbacks: The number of f
litellm/router_utils/add_retry_fallback_headers.py:105
↓ 8 callers
Method
add_litellm_callback
(self, cb)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py:798
↓ 8 callers
Function
add_new_member
Add a new member to a team - add team id to user table - add team member w/ budget to team member table Returns created/existing us
litellm/proxy/management_helpers/utils.py:255
↓ 8 callers
Function
add_openai_metadata
Add metadata to openai optional parameters, excluding hidden params. OpenAI 'metadata' only supports string values. Args: param
litellm/utils.py:9070
↓ 8 callers
Method
add_vertex_credentials
Add the vertex credentials for the given project-id, location
litellm/proxy/pass_through_endpoints/passthrough_endpoint_router.py:103
↓ 8 callers
Method
adelete_sandbox
(self, *, container, **kwargs)
tests/test_litellm/integrations/code_interpreter_interception/test_handler.py:49
↓ 8 callers
Function
aimage_edit
Asynchronously calls the `image_edit` function with the given arguments and keyword arguments. Parameters: - `args` (tuple): Positional
litellm/images/main.py:954
↓ 8 callers
Function
apply_context_management
Run edits in order; return a single ``PolyfillResult``. The dispatcher is async so async editors (``compact_20260112``) can ``await`` the con
litellm/llms/anthropic/experimental_pass_through/context_management/dispatcher.py:56
↓ 8 callers
Function
apply_guardrail
Apply a guardrail to text input and return the processed result. This endpoint allows testing guardrails by applying them to custom text inp
litellm/proxy/guardrails/guardrail_endpoints.py:2175
↓ 8 callers
Method
apply_guardrail
Apply Ovalix guardrail to the given inputs (request or response text). Used by the unified guardrail flow and the /apply_guardrail A
litellm/proxy/guardrails/guardrail_hooks/ovalix/ovalix.py:188
↓ 8 callers
Method
apply_guardrail
Apply OpenAI moderation guardrail using the unified guardrail interface. This method is called by the UnifiedLLMGuardrails system fo
litellm/proxy/guardrails/guardrail_hooks/openai/moderations.py:185
↓ 8 callers
Method
apply_guardrail
Filters MCP tools the end user cannot access based on their object_permission.mcp_servers / mcp_access_groups settings.
litellm/proxy/guardrails/guardrail_hooks/mcp_end_user_permission/mcp_end_user_permission.py:55
↓ 8 callers
Function
apply_redacted_messages_back
Write redacted messages back to whichever field(s) the caller used. Mask/anonymize paths take a synthesised messages list (from :func:`build_
litellm/proxy/guardrails/_content_utils.py:167
↓ 8 callers
Method
as_str
(&self)
litellm-rust/crates/ai-gateway/src/integrations/custom_logger/types.rs:28
↓ 8 callers
Function
asend_message_streaming
Async: Send a streaming message to an A2A agent. If litellm_params contains custom_llm_provider, routes through the completion bridge.
litellm/a2a_protocol/main.py:417
↓ 8 callers
Function
assert_response_shape
(response, custom_llm_provider)
tests/llm_translation/test_rerank.py:30
↓ 8 callers
Function
assert_user_can_access_vector_store_id
Resolve a managed vector store id and enforce ownership if it exists. Unknown ids are treated as provider-native ids and are not rejected he
litellm/proxy/vector_store_endpoints/utils.py:261
↓ 8 callers
Method
async_get_cache
(self, key: str, **kwargs)
tests/test_litellm/proxy/hooks/test_sensitive_data_routing.py:36
↓ 8 callers
Method
async_get_fully_unhealthy_model_names
Returns the set of model names where every backing deployment is currently marked unhealthy by background health checks (and the heal
litellm/router.py:9303
↓ 8 callers
Method
async_health_check
(self)
litellm/integrations/galileo.py:89
↓ 8 callers
Method
async_health_check
Health check for SQS by sending a small test message to the configured queue.
litellm/integrations/sqs.py:312
↓ 8 callers
Method
async_increment_cache
( self, key, value: float, litellm_parent_otel_span: Union[Span, None],
litellm/proxy/utils.py:284
↓ 8 callers
Method
async_log_success_event
(self, kwargs, response_obj, start_time, end_time)
tests/proxy_unit_tests/test_custom_callback_input.py:281
↓ 8 callers
Method
async_post_call_failure_hook
(self, **kwargs)
tests/test_litellm/proxy/utils/proxy_logging/test_post_call_failure_hook.py:104
↓ 8 callers
Method
async_post_call_streaming_hook
Allow user to modify outgoing streaming data -> per chunk Covers: 1. /chat/completions
litellm/proxy/utils.py:2413
↓ 8 callers
Method
async_register_script
Register a Lua script with Redis asynchronously. Works with both standalone Redis and Redis Cluster. The returned callable n
litellm/caching/redis_cache.py:518
↓ 8 callers
Method
async_service_success_hook
(self, **kwargs)
tests/test_litellm/proxy/common_utils/test_reset_budget_job.py:207
↓ 8 callers
Function
b
()
litellm/proxy/_experimental/out/_next/static/chunks/0_9wsaj_z5w6i.js:1
↓ 8 callers
Method
build_debug_headers
Build masked debug response headers. Parameters ---------- inbound_headers : dict Raw headers received f
litellm/proxy/_experimental/mcp_server/mcp_debug.py:179
↓ 8 callers
Function
cb
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 8 callers
Function
chat_completion
Follows the exact same API spec as `OpenAI's Chat API https://platform.openai.com/docs/api-reference/chat` ```bash curl -X POST http://
litellm/proxy/proxy_server.py:8312
↓ 8 callers
Function
chat_completion
( session, key, messages, model: Union[str, List] = "gpt-5.5", guardrails: Optional[List]
tests/otel_tests/test_guardrails.py:10
↓ 8 callers
Method
check_batch_cost
Check if the batch JOB has been tracked. - get all status="validating" and file_purpose="batch" jobs - check if batch is now
enterprise/litellm_enterprise/proxy/common_utils/check_batch_cost.py:100
↓ 8 callers
Method
chunk
Split text into chunks using RecursiveCharacterTextSplitter. Args: text: Text from OCR (if used) file_conten
litellm/rag/ingestion/base_ingestion.py:188
↓ 8 callers
Method
chunk_parser
(self, chunk: dict)
litellm/llms/ollama/chat/transformation.py:438
↓ 8 callers
Function
ci
(t,e,r)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 8 callers
Function
cleanup
Cleanup after each test
tests/load_tests/test_memory_usage.py:239
↓ 8 callers
Method
cleanup_expired_keys
Main entry point for deleting expired UI session keys. Uses PodLockManager to ensure only one pod runs cleanup in multi-pod deploymen
litellm/proxy/common_utils/expired_ui_session_key_cleanup_manager.py:44
↓ 8 callers
Function
clear_cache
Clear router caches and reload models.
litellm/proxy/management_endpoints/model_management_endpoints.py:1680
↓ 8 callers
Function
clear_prometheus_registry
Helper function to clear the Prometheus registry
tests/enterprise/litellm_enterprise/integrations/test_prometheus.py:54
↓ 8 callers
Method
close
(self)
tests/test_litellm/integrations/gitlab/test_gitlab_client.py:69
↓ 8 callers
Function
construct_database_url_from_env_vars
Construct a DATABASE_URL from individual environment variables. Returns: Optional[str]: The constructed DATABASE_URL or None if requi
litellm/proxy/utils.py:5880
↓ 8 callers
Method
count_tokens
Count tokens in text using litellm.token_counter. Args: text: Text to count tokens for Returns: Tok
litellm/a2a_protocol/utils.py:91
↓ 8 callers
Method
create
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:1
↓ 8 callers
Function
create_a2a_client
Create an A2A client for the given agent URL. This resolves the agent card and returns a ready-to-use A2A client. The client can be reus
litellm/a2a_protocol/main.py:583
↓ 8 callers
Function
create_container
( name: str, expires_after: Optional[Dict[str, Any]] = None, file_ids: Optional[List[str]] = None,
litellm/containers/main.py:120
↓ 8 callers
Function
create_missing_views
-------------------------------------------------- NOTE: Copy of `litellm/db_scripts/create_views.py`. ----------------------------------
litellm/proxy/db/create_views.py:14
↓ 8 callers
Function
create_mock_response
Helper function to create a mock HTTP response.
tests/litellm_utils_tests/test_cyberark.py:25
↓ 8 callers
Method
create_skill
( data: NewSkillRequest, user_id: Optional[str] = None, user_api_key_dict: Optional[Us
litellm/llms/litellm_proxy/skills/handler.py:62
↓ 8 callers
Function
create_user
Create a user according to SCIM v2 protocol
litellm/proxy/management_endpoints/scim/scim_v2.py:1049
↓ 8 callers
Method
create_user
(self, *, max_budget: float)
tests/e2e/budgets/budget_client.py:222
↓ 8 callers
Function
de
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 8 callers
Function
decode_character_id_with_provider
Decode provider and model_id from encoded character_id.
litellm/types/videos/utils.py:136
↓ 8 callers
Method
decrypt_model_list_from_db
(self, new_models: list)
litellm/proxy/proxy_server.py:4930
↓ 8 callers
Method
delete_team
(self, team_id: str)
tests/e2e/budgets/budget_client.py:295
↓ 8 callers
Function
delete_verification_tokens
Helper that deletes the list of tokens from the database - check if user is proxy admin - check if user is team admin and key is a team
litellm/proxy/management_endpoints/key_management_endpoints.py:3750
↓ 8 callers
Function
dl
(t,e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 8 callers
Function
e4
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/15hm8gokjq2uu.js:1
↓ 8 callers
Function
e9
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 8 callers
Function
eD
()
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 8 callers
Function
eL
(e,t,n,r)
litellm/proxy/_experimental/out/_next/static/chunks/101az3fsw7lje.js:1
↓ 8 callers
Function
eT
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:94
↓ 8 callers
Function
ensure_batch_response_managed_file_ids
Normalize batch file IDs to managed unified IDs before DB persistence.
litellm/proxy/openai_files_endpoints/common_utils.py:867
← previous
next →
2,201–2,300 of 68,180, ranked by callers