MCPcopy Create free account

hub / github.com/BerriAI/litellm / functions

Functions68,141 in github.com/BerriAI/litellm

↓ 12 callersFunction_make_mock_request
Build a mock FastAPI Request with configurable headers.
tests/test_litellm/proxy/agent_endpoints/test_agent_headers.py:36
↓ 12 callersFunction_make_model_call_details
Build a model_call_details dict that mimics real proxy/SDK flows.
tests/test_litellm/litellm_core_utils/test_redact_messages.py:30
↓ 12 callersFunction_make_openai_jsonl_bytes
(n_rows: int, padding: int = 400)
tests/test_litellm/llms/vertex_ai/files/test_vertex_ai_files_streaming.py:60
↓ 12 callersMethod_make_pr
( self, *, number: int = 1, created_days_ago: int = 10, is_draft: bool
tests/test_litellm/test_github_close_low_quality_prs.py:121
↓ 12 callersFunction_make_server
(**kwargs)
tests/mcp_tests/test_per_user_oauth_cache.py:43
↓ 12 callersMethod_make_server
(auth_type, delegate_auth_to_upstream=False)
tests/test_litellm/proxy/_experimental/mcp_server/auth/test_user_api_key_auth_mcp.py:1707
↓ 12 callersMethod_map_size_to_aspect_ratio
Map OpenAI size format to OpenRouter aspect_ratio format. Uses the same mapping as image generation since OpenRouter handles
litellm/llms/openrouter/image_edit/transformation.py:268
↓ 12 callersFunction_mock_response
()
tests/test_litellm/llms/parallel_ai/test_parallel_ai_search.py:36
↓ 12 callersFunction_ovalix_env
()
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_ovalix.py:59
↓ 12 callersFunction_patch_validation_helpers
Stub out the DB helpers resolve_and_validate_end_user_id delegates to.
tests/test_litellm/proxy/auth/test_auth_checks.py:3428
↓ 12 callersMethod_post_call_image_processing
(response: httpx.Response, image_url: str = "")
litellm/litellm_core_utils/prompt_templates/factory.py:3376
↓ 12 callersFunction_reject_url_valued_destinations
Reject URL-valued ``model``/``file_id`` unless admin-allowlisted. Some providers (HuggingFace, Oobabooga, Gemini files) accept a URL in the i
litellm/proxy/litellm_pre_call_utils.py:211
↓ 12 callersFunction_resolve_credential_from_model_config
Walk the precedence chain and return the first matching credential name. Checks (in order): 1. project_model_config[model_name][provider
litellm/proxy/litellm_pre_call_utils.py:1947
↓ 12 callersMethod_run_deferred_stream_guardrails
Run non-streaming post-call guardrail hooks on an assembled streaming response, then fire success logging via ``dispatch_success_hand
litellm/proxy/common_request_processing.py:2136
↓ 12 callersFunction_sample_payload
(**overrides)
tests/test_litellm/integrations/otel/test_otel_v2_sources_of_truth.py:40
↓ 12 callersFunction_search_request
Engine/app-mode search request (vertex_engine_id set).
tests/test_litellm/llms/vertex_ai/test_vertex_ai_search_vector_store_transformation.py:145
↓ 12 callersMethod_should_raise_guardrail_blocked_exception
Only raise exception for "BLOCKED" actions, not for "ANONYMIZED" actions. If `self.mask_request_content` or `self.mask_response_cont
litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:1060
↓ 12 callersMethod_strip_base64_from_messages
Removes or redacts base64-encoded file data (e.g., PDFs, images, audio) from messages and responses before sending to SQS. B
litellm/integrations/custom_logger.py:946
↓ 12 callersMethod_strip_sse_data_from_chunk
Strips the 'data: ' prefix from Server-Sent Events (SSE) chunks. Some providers like sagemaker send it as `data:`, need to handle bo
litellm/litellm_core_utils/streaming_handler.py:2191
↓ 12 callersMethod_validate_return_to
Validate that return_to matches the configured control_plane_url origin. Returns True if return_to is valid and should be used.
litellm/proxy/management_endpoints/ui_sso.py:2391
↓ 12 callersMethodaclose
(self)
litellm/llms/custom_httpx/aiohttp_transport.py:145
↓ 12 callersMethodacompletion
(self, *args, **kwargs)
litellm/proxy/example_config_yaml/custom_handler.py:18
↓ 12 callersMethodapply_guardrail
( self, inputs: GenericGuardrailAPIInputs, request_data: dict, input_type: Lit
litellm/proxy/guardrails/guardrail_hooks/onyx/onyx.py:88
↓ 12 callersFunctionassert_same_origin
Verify ``candidate_url`` shares scheme, host, and port with ``expected_url``. Use when an upstream API returns a URL meant for follow-up requests
litellm/litellm_core_utils/url_utils.py:315
↓ 12 callersMethodasync_check_and_create_cache
Receives - messages: List of dict - messages in the openai format Returns - messages - List[dict] - filtered list of
litellm/llms/vertex_ai/context_caching/vertex_ai_context_caching.py:427
↓ 12 callersMethodasync_moderation_hook
(self, data: dict, **kwargs)
tests/test_litellm/integrations/test_custom_guardrail.py:1038
↓ 12 callersMethodasync_post_call_failure_hook
(self, *args, **kwargs)
tests/test_litellm/proxy/hooks/test_post_call_failure_hook_integration.py:89
↓ 12 callersMethodasync_pre_call_deployment_hook
(self, kwargs: dict[str, Any], call_type: CallTypes | None)
litellm/integrations/code_interpreter_interception/handler.py:170
↓ 12 callersMethodasync_pre_call_hook
Runs before the LLM API call to validate and potentially modify input. Uses 'PROMPT' messageType as this is input to the model.
litellm/proxy/guardrails/guardrail_hooks/lasso/lasso.py:177
↓ 12 callersFunctionca
(e,t,n)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 12 callersMethodchat
( self, key: str, model: str, content: str, *, max_tokens: int
tests/e2e/budgets/budget_client.py:198
↓ 12 callersMethodchunk_processor
( response: httpx.Response, request_body: Optional[dict], litellm_logging_obj: LiteLLM
litellm/proxy/pass_through_endpoints/streaming_handler.py:29
↓ 12 callersMethodclose
Close the WebSocket
tests/llm_translation/realtime/base_realtime_tests.py:125
↓ 12 callersFunctioncollect
Apply an extractor table to ``source``, dropping ``None`` results.
litellm/integrations/otel/mappers/utils.py:20
↓ 12 callersFunctioncompute_short_server_prefix
Derive the deterministic three-character prefix for a server. Uses SHA-256 of ``f"{server_id}#{attempt}"`` and folds the first eight bytes in
litellm/proxy/_experimental/mcp_server/utils.py:90
↓ 12 callersMethodconsume_stream
(self, streaming_response: StreamingResponse)
tests/test_litellm/proxy/test_common_request_processing.py:1097
↓ 12 callersFunctioncopyToClipboard
( text: string | null | undefined, messageText: string = "Copied to clipboard", )
ui/litellm-dashboard/src/utils/dataUtils.ts:66
↓ 12 callersFunctioncost_calculator
fal.ai image generation cost calculator
litellm/llms/fal_ai/cost_calculator.py:7
↓ 12 callersFunctioncost_per_web_search_request
Calculate the cost of web search requests for X.AI models. X.AI Live Search costs $25 per 1,000 sources used. Each source costs $0.025.
litellm/llms/xai/cost_calculator.py:55
↓ 12 callersFunctioncreate_standard_logging_payload
()
tests/enterprise/litellm_enterprise/enterprise_callbacks/test_prometheus_logging_callbacks.py:46
↓ 12 callersFunctiond
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 12 callersMethoddefaultMutationOptions
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0n.a~e5dwfnkn.js:1
↓ 12 callersFunctione
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 12 callersFunctione
()
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:31
↓ 12 callersFunctione8
(e,t,n,r,l,o,a,i,d,c)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 12 callersFunctioneh
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 12 callersFunctionenc_project
(p)
tests/test_litellm/integrations/gitlab/test_gitlab_client.py:90
↓ 12 callersFunctionextract_request_tool_names
Extract tool names from the request body for the given route. Uses guardrail translation handlers when available, else standalone extractors
litellm/proxy/guardrails/tool_name_extraction.py:63
↓ 12 callersFunctionextract_ttl_from_cached_messages
Extract TTL from cached messages. Returns the first valid TTL found. Args: messages: List of messages to extract TTL from Retur
litellm/llms/vertex_ai/context_caching/transformation.py:51
↓ 12 callersMethodfetch
(self, user_id: str, server_id: str)
litellm/proxy/_experimental/mcp_server/outbound_credentials/oauth_token_store.py:166
↓ 12 callersFunctionfetch_all_mcp_servers
Get all of the configured mcp servers for the user in the db with their associated teams ``` curl --location 'http://localhos
litellm/proxy/management_endpoints/mcp_management_endpoints.py:870
↓ 12 callersFunctionfilter_and_transform_beta_headers
Filter and transform beta headers based on provider's mapping configuration. This function: 1. Only allows headers that are present in t
litellm/anthropic_beta_headers_manager.py:215
↓ 12 callersMethodfindAll
(e={})
litellm/proxy/_experimental/out/_next/static/chunks/0n.a~e5dwfnkn.js:1
↓ 12 callersMethodflush_and_get_aggregated_db_spend_update_transactions
Flush all updates from the queue and return all updates aggregated by entity type.
litellm/proxy/db/db_transaction_queue/spend_update_queue.py:27
↓ 12 callersMethodgetConfigs
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 12 callersMethodget_aggregated_daily_spend_update_transactions
Aggregate updates by daily_transaction_key.
litellm/proxy/db/db_transaction_queue/daily_spend_update_queue.py:100
↓ 12 callersMethodget_api_key
(api_key: Optional[str] = None)
litellm/llms/gemini/common_utils.py:366
↓ 12 callersMethodget_app_roles_from_id_token
Extract app roles from the Microsoft Entra ID (Azure AD) id_token JWT. App roles are assigned in the Azure AD Enterprise Application
litellm/proxy/management_endpoints/ui_sso.py:3847
↓ 12 callersMethodget_base_completion_call_args
Must return the base completion call args
tests/llm_responses_api_testing/base_responses_api.py:109
↓ 12 callersMethodget_credentials
(self, prisma_client: PrismaClient)
litellm/proxy/proxy_server.py:6348
↓ 12 callersFunctionget_deployments_for_tag
Returns a list of deployments that match the requested model and tags in the request. Executes tag based filtering based on the tags in requ
litellm/router_strategy/tag_based_routing.py:117
↓ 12 callersFunctionget_end_user_object
Returns end user object from database or cache. If end user exists but has no budget_id, applies the default budget (if configured via l
litellm/proxy/auth/auth_checks.py:1072
↓ 12 callersMethodget_model_group_info
For a given model group name, return the combined model info Returns: - ModelGroupInfo if able to construct a model group
litellm/router.py:8763
↓ 12 callersFunctionget_server_root_path
Get the server root path from the environment variables. - If SERVER_ROOT_PATH is set, return it. - Otherwise, default to "/".
litellm/proxy/utils.py:5830
↓ 12 callersFunctionget_token_count
(messages, model)
litellm/utils.py:6600
↓ 12 callersMethodget_url_and_signed_request
Build the AgentCore URL, construct a JSON-RPC envelope, and sign the request. Args: request_id: A2A JSON-RPC request ID
litellm/a2a_protocol/providers/bedrock_agentcore/transformation.py:77
↓ 12 callersMethodget_vertex_region
(self, vertex_region: Optional[str], model: str)
litellm/llms/vertex_ai/vertex_llm_base.py:70
↓ 12 callersMethodhandle
( self, method: str, path: str, body: bytes, fetch_upstream: FetchUpst
tests/_openai_record_replay_proxy.py:152
↓ 12 callersFunctionincrement_spend_counters
Atomically increment spend counters for budget enforcement. Uses spend_counter_cache (DualCache with Redis backend when available) so co
litellm/proxy/proxy_server.py:2210
↓ 12 callersFunctioninfo_key_fn
Retrieve information about a key. Parameters: key: Optional[str] = Query parameter representing the key in the request user_a
litellm/proxy/management_endpoints/key_management_endpoints.py:3238
↓ 12 callersFunctionis_base64_encoded_unified_id
Check if a resource ID is a base64 encoded unified ID. Args: resource_id: The resource ID to check prefix: The expected pref
litellm/llms/base_llm/managed_resources/utils.py:42
↓ 12 callersMethodis_initialized
(self)
litellm/proxy/db/tool_registry_writer.py:297
↓ 12 callersMethodjsonify_object
(self, data: dict)
litellm/proxy/utils.py:2957
↓ 12 callersFunctionl
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 12 callersFunctionl
(e)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:1
↓ 12 callersMethodload_local_model_cost_map
Load the local backup model cost map bundled with the package.
litellm/litellm_core_utils/get_model_cost_map.py:37
↓ 12 callersFunctionmake_inputs_with_tools
Create GenericGuardrailAPIInputs with tool_calls.
tests/test_litellm/integrations/rubrik_test_helpers.py:19
↓ 12 callersFunctionn
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/05.uhnqp00zd5.js:1
↓ 12 callersFunctiono
()
litellm/proxy/_experimental/out/_next/static/chunks/05btv.l5gro_..js:1
↓ 12 callersFunctionrQ
(e,t,r,s)
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:5
↓ 12 callersFunctionredis_key_for
(cassette_path: str)
tests/_vcr_redis_persister.py:95
↓ 12 callersFunctionregister_client
(request: Request, mcp_server_name: Optional[str] = None)
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py:1396
↓ 12 callersMethodrender_template
(self, template_id: str, variables: Optional[Dict[str, Any]] = None)
litellm/integrations/gitlab/gitlab_prompt_manager.py:210
↓ 12 callersMethodreset_budget_for_litellm_budget_table
Resets the budget for all LiteLLM End-Users (Customers), and Team Members if their budget has expired The corresponding Budget durati
litellm/proxy/common_utils/reset_budget_job.py:221
↓ 12 callersFunctionresolve_mcp_auth
Resolve the auth value for an MCP server. Priority: 1. ``mcp_auth_header`` — per-request/per-user override 2. OAuth2 Token Exchange (OBO
litellm/proxy/_experimental/mcp_server/oauth2_token_cache.py:276
↓ 12 callersFunctions
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:1
↓ 12 callersMethodsave_cassette
(cassette_path, cassette_dict, serializer)
tests/_vcr_redis_persister.py:187
↓ 12 callersFunctionsend_email
smtp_host, smtp_port, smtp_username, smtp_password, sender_name, sender_email,
litellm/proxy/utils.py:4963
↓ 12 callersMethodset_deployment_health_states
Bulk-write all deployment health states as a single cache entry.
litellm/router_utils/health_state_cache.py:45
↓ 12 callersMethodstream
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:30
↓ 12 callersMethodterminate
(self)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py:1569
↓ 12 callersMethodtransform_litellm_user_to_scim_user
( user: Union[LiteLLM_UserTable, NewUserResponse], )
litellm/proxy/management_endpoints/scim/scim_transformations.py:20
↓ 12 callersMethodtransform_request
( self, model: str, messages: List[AllMessageValues], optional_params: dict,
litellm/llms/vertex_ai/vertex_ai_partner_models/anthropic/transformation.py:86
↓ 12 callersMethodtransform_response
( self, model: str, raw_response: Response, model_response: ModelResponse,
litellm/llms/predibase/chat/transformation.py:126
↓ 12 callersMethodtransform_response
Transform Responses API response to chat completion response
litellm/completion_extras/litellm_responses_transformation/transformation.py:652
↓ 12 callersMethodtransform_retrieve_file_request
Get URL and params for retrieving a file.
litellm/llms/manus/files/transformation.py:285
↓ 12 callersMethodtransform_search_request
Transform Search request to Brave Search API format. Transforms Perplexity unified spec parameters: - query → q (same)
litellm/llms/brave/search/transformation.py:161
↓ 12 callersFunctiontrim_messages
Trim a list of messages to fit within a model's token limit. Args: messages: Input messages to be trimmed. Each message is a diction
litellm/utils.py:6660
↓ 12 callersFunctionu7
(e,t,n)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 12 callersMethodupdate_headers_with_optional_anthropic_beta
Update headers with optional anthropic beta.
litellm/llms/anthropic/chat/transformation.py:1696
← previousnext →1,301–1,400 of 68,141, ranked by callers