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
↓ 21 callers
Method
get
(self, key, default=None)
litellm/types/router.py:304
↓ 21 callers
Method
get_config
(cls)
litellm/llms/maritalk.py:41
↓ 21 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:1020
↓ 21 callers
Function
get_supported_openai_params
Returns the supported openai params for a given model + provider Example: ``` get_supported_openai_params(model="anthropic.claude-3"
litellm/litellm_core_utils/get_supported_openai_params.py:8
↓ 21 callers
Method
image_generation
( self, model: str, prompt: str, api_key: Optional[str], api_base: Opt
tests/local_testing/test_custom_llm.py:231
↓ 21 callers
Function
isReferenceLikeElement
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 21 callers
Method
is_callback_disabled_dynamically
Check if a callback is disabled via the x-litellm-disable-callbacks header or via `litellm_disabled_callbacks` in standard_callback_dynam
enterprise/litellm_enterprise/enterprise_callbacks/callback_controls.py:16
↓ 21 callers
Method
list
(self, thread_id)
tests/local_testing/test_assistants.py:189
↓ 21 callers
Function
modelAvailableCall
( accessToken: string, userID: string, userRole: string, return_wildcard_routes: boolean = false, te
ui/litellm-dashboard/src/components/networking.tsx:1809
↓ 21 callers
Method
result
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 21 callers
Method
safe_get_vertex_ai_project
Safely get Vertex AI project without mutating the litellm_params dict. Unlike get_vertex_ai_project(), this does NOT pop values from
litellm/llms/vertex_ai/vertex_llm_base.py:1150
↓ 21 callers
Method
serialize
Encode a value for DualCache / Redis (``json.dumps``-safe). If ``model_type`` is set, the payload is validated with that model, then
litellm/proxy/common_utils/cache_pydantic_utils.py:40
↓ 21 callers
Method
should_run_guardrail
Returns True if the guardrail should be run on the event_type
litellm/integrations/custom_guardrail.py:555
↓ 21 callers
Function
t
()
litellm/proxy/_experimental/out/_next/static/chunks/11ibt3khr2hk3.js:1
↓ 21 callers
Method
trace
(self, name, **kwargs)
litellm/litellm_core_utils/dd_tracing.py:40
↓ 21 callers
Method
transform
Transform LiteLLM data to CBF format, dropping records with zero successful_requests or invalid CZRNs.
litellm/integrations/cloudzero/transform.py:37
↓ 21 callers
Method
transform_anthropic_messages_request
No transformation is needed for Anthropic messages This takes in a request in the Anthropic /v1/messages API spec -> transforms it
litellm/llms/anthropic/experimental_pass_through/messages/transformation.py:389
↓ 21 callers
Method
transform_request
( self, model: str, messages: List[Dict[str, str]], # type: ignore optional_p
litellm/llms/sap/chat/transformation.py:319
↓ 21 callers
Method
translate_request
Translate a full Anthropic /v1/messages request dict to litellm.responses() / litellm.aresponses() kwargs.
litellm/llms/anthropic/experimental_pass_through/responses_adapters/transformation.py:278
↓ 21 callers
Function
ut
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 20 callers
Function
F
({redisType:e,redisTypeDescriptions:r,onTypeChange:a})
litellm/proxy/_experimental/out/_next/static/chunks/00fcsizkvc4hx.js:1
↓ 20 callers
Method
_bedrock_converse_messages_pt_async
( messages: List, model: str, llm_provider: str, user_continue_message: Option
litellm/litellm_core_utils/prompt_templates/factory.py:4318
↓ 20 callers
Function
_bedrock_tools_pt
OpenAI tools looks like: tools = [ { "type": "function", "function": { "name": "get_current_w
litellm/litellm_core_utils/prompt_templates/factory.py:4988
↓ 20 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:2855
↓ 20 callers
Function
_check_and_merge_model_level_guardrails
Check if the model has guardrails defined and merge them with existing guardrails in the request data. Args: data: The request data
litellm/proxy/utils.py:5642
↓ 20 callers
Function
_clear_url_env
(monkeypatch)
tests/test_litellm/proxy/utils/helpers/test_url_helpers.py:19
↓ 20 callers
Method
_get_token_and_url
Internal function. Returns the token and url for the call. Handles logic if it's google ai studio vs. vertex ai. Returns
litellm/llms/vertex_ai/vertex_llm_base.py:670
↓ 20 callers
Function
_get_tools_from_mcp_servers
Helper method to fetch tools from MCP servers based on server filtering criteria. Args: user_api_key_auth: User authenti
litellm/proxy/_experimental/mcp_server/server.py:1674
↓ 20 callers
Method
_handle_error
(self, e: Exception, provider_config: Any)
litellm/interactions/http_handler.py:53
↓ 20 callers
Function
_make_guardrail
(**kwargs)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py:57
↓ 20 callers
Function
_make_request
(**overrides)
tests/test_litellm/llms/anthropic/experimental_pass_through/responses_adapters/test_responses_adapters_transformation.py:25
↓ 20 callers
Function
_make_response
Build a stub httpx-like response.
tests/test_litellm/interactions/test_agents_http_handler.py:41
↓ 20 callers
Function
_redact_prompt_leaks_in_error_string
Strip echoed request input from provider error strings. Provider validation errors (e.g. OpenAI ``RateLimitError`` carrying 178 pydantic
litellm/proxy/spend_tracking/spend_tracking_utils.py:740
↓ 20 callers
Function
_validate_update_key_data
Validate permissions and constraints for key update.
litellm/proxy/management_endpoints/key_management_endpoints.py:2232
↓ 20 callers
Method
aspeech
Example Usage: ``` from litellm import Router client = Router(model_list = [ { "model_na
litellm/router.py:3751
↓ 20 callers
Method
async_get_available_deployment
Async implementation of 'get_available_deployments'. Allows all cache calls to be made async => 10x perf impact (8rps -> 100 rps).
litellm/router.py:10261
↓ 20 callers
Method
async_post_call_success_hook
(self, data, user_api_key_dict, response)
tests/test_litellm/proxy/test_model_level_guardrails.py:338
↓ 20 callers
Method
at
(e)
litellm/proxy/_experimental/out/_next/static/chunks/02ax9y70kcggv.js:1
↓ 20 callers
Function
can_modify_verification_token
Check if user has permission to modify (delete/regenerate) a verification token. Rules: - Proxy admin can modify any key - Internal
litellm/proxy/management_endpoints/key_management_endpoints.py:3826
↓ 20 callers
Function
create_pass_through_route
( endpoint, target: str, custom_headers: Optional[Mapping[str, Any]] = None, _forward_headers:
litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:1579
↓ 20 callers
Function
create_tool_function
Create a tool function for an OpenAPI operation. This function creates an async tool function that can be called with keyword arguments. Para
litellm/proxy/_experimental/mcp_server/openapi_to_mcp_generator.py:329
↓ 20 callers
Method
destroy
()
litellm/proxy/_experimental/out/_next/static/chunks/0-0c4mv4-mc9n.js:1
↓ 20 callers
Function
e0
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 20 callers
Method
embedding
( self, model: str, input: Union[str, List], is_async: Optional[bool] = False,
litellm/router.py:4528
↓ 20 callers
Function
ev
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 20 callers
Function
get_bedrock_base_model
Get the base model from the given model name. Handle model names like: - "us.meta.llama3-2-11b-instruct-v1:0" -> "meta.llama3-2-11b-inst
litellm/llms/bedrock/common_utils.py:651
↓ 20 callers
Method
get_custom_loggers_for_type
Get all custom loggers that are instances of the given class type
litellm/litellm_core_utils/logging_callback_manager.py:380
↓ 20 callers
Function
get_custom_url
(request_base_url: str, route: Optional[str] = None)
litellm/proxy/utils.py:5873
↓ 20 callers
Function
get_instance_fn
(value: str, config_file_path: Optional[str] = None)
litellm/proxy/types_utils/utils.py:8
↓ 20 callers
Method
get_labels
(label_name: DEFINED_PROMETHEUS_METRICS)
litellm/types/integrations/prometheus.py:770
↓ 20 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:9049
↓ 20 callers
Method
get_proxy_hook
Get a proxy hook from the proxy_hook_mapping
litellm/proxy/utils.py:559
↓ 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
Method
list_batches
( self, *, key: str, provider: str | None = None )
tests/e2e/batches/batch_client.py:135
↓ 20 callers
Function
make_mcp_request_obj
()
tests/test_litellm/proxy/utils/proxy_logging/conftest.py:119
↓ 20 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:121
↓ 20 callers
Function
mock_stream
()
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_presidio.py:1443
↓ 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
processor_data
The exact `data` dict the processor was constructed with.
tests/test_litellm/proxy/video_endpoints/test_endpoints.py:105
↓ 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
request
(method: HttpMethod, path: string, options?: RequestOptions)
ui/litellm-dashboard/src/lib/http/client.ts:75
↓ 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
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
↓ 20 callers
Function
supports_reasoning
Check if the given model supports reasoning and return a boolean value.
litellm/utils.py:2495
↓ 20 callers
Function
tg
(t,e)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 20 callers
Method
toHexString
()
litellm/proxy/_experimental/out/_next/static/chunks/0e9hs7onyj28m.js:1
↓ 20 callers
Function
to_server_spec
Map a v1 server onto a ServerSpec for a migrated mode, or None to defer to v1. BYOK is the per-user source of the ``api_key`` mode; its scheme ri
litellm/proxy/_experimental/mcp_server/outbound_credentials/adapter.py:54
↓ 20 callers
Method
transform_realtime_request
( self, message: str, model: str, session_configuration_request: Optional[str]
litellm/llms/gemini/realtime/transformation.py:521
↓ 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
Method
_calculate_usage
( completion_response: Union[GenerateContentResponseBody, BidiGenerateContentServerMessage], )
litellm/llms/vertex_ai/gemini/vertex_and_google_ai_studio_gemini.py:1746
↓ 19 callers
Method
_handle_success
Create the litellm_request span then close the proxy span.
litellm/integrations/opentelemetry.py:1122
↓ 19 callers
Function
_make_challenge
(verifier: str)
tests/test_litellm/proxy/_experimental/mcp_server/test_byok_oauth_endpoints.py:36
↓ 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
_make_team_obj
Create a mock team object with the given MCP permissions.
tests/test_litellm/proxy/management_helpers/test_object_permission_utils.py:195
↓ 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:1815
↓ 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:2089
↓ 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:1479
↓ 19 callers
Method
_transform_response
( self, model: str, response: httpx.Response, model_response: ModelResponse,
litellm/llms/bedrock/chat/converse_transformation.py:2029
↓ 19 callers
Function
append_query_params
(url: Optional[str], params: dict)
litellm/proxy/proxy_cli.py:77
↓ 19 callers
Method
async_delete_cache
(self, key: str)
litellm/proxy/_experimental/mcp_server/outbound_credentials/dual_cache_token_backend.py:31
↓ 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
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:295
↓ 19 callers
Method
budget_alerts
(self, type, user_info)
tests/test_litellm/proxy/auth/test_auth_checks.py:1982
↓ 19 callers
Method
build_mcp_server_from_table
( self, mcp_server: LiteLLM_MCPServerTable, *, credentials_are_encrypted: bool
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1050
↓ 19 callers
Method
check
(self, text: str)
litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py:520
↓ 19 callers
Method
count
(self, where: Optional[Dict[str, Any]] = None)
tests/test_litellm/proxy/memory/test_memory_endpoints.py:121
↓ 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:5176
↓ 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
eF
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 19 callers
Function
el
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.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/0piozaeodiue..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
Function
get_prisma_client_or_throw
(message: str)
litellm/proxy/utils.py:5920
↓ 19 callers
Method
init
(self)
tests/e2e/lifecycle.py:29
← previous
next →
701–800 of 71,069, ranked by callers