MCPcopy Create free account

hub / github.com/BerriAI/litellm / functions

Functions68,180 in github.com/BerriAI/litellm

↓ 16 callersMethodaiter_lines
(self)
tests/test_litellm/sandbox/test_e2b_sandbox.py:31
↓ 16 callersMethodapply_guardrail
Apply Bedrock guardrail to a batch of texts for testing purposes. This method allows users to test Bedrock guardrails without making
litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:1616
↓ 16 callersMethodapply_guardrail
(self, inputs, request_data, **kwargs)
tests/test_litellm/integrations/test_custom_guardrail.py:1166
↓ 16 callersFunctionas_str
(value: object)
litellm/integrations/otel/model/utils.py:12
↓ 16 callersFunctionassert_bfl_polling_url
Validate that a polling URL points to a BFL-controlled host. BFL returns polling URLs on subdomains like ``gateway.bfl.ai`` that differ from
litellm/llms/black_forest_labs/common_utils.py:28
↓ 16 callersMethodasync_get_available_deployment
( self, model: str, messages: Optional[list[dict[str, str]]] = None, input: Op
litellm/router_strategy/lar1_routing.py:89
↓ 16 callersMethodasync_pre_call_hook
Pre-call hook to sanitize user prompts.
litellm/proxy/guardrails/guardrail_hooks/model_armor/model_armor.py:330
↓ 16 callersMethodatext_completion
( self, model: str, prompt: str, is_retry: Optional[bool] = False, is_
litellm/router.py:3947
↓ 16 callersMethodatranscription
Example Usage: ``` from litellm import Router client = Router(model_list = [ { "model_na
litellm/router.py:3636
↓ 16 callersMethodbudget_alerts
(self, type, user_info)
tests/test_litellm/proxy/auth/test_auth_checks.py:1982
↓ 16 callersMethodbuild_mcp_server_from_table
( self, mcp_server: LiteLLM_MCPServerTable, *, credentials_are_encrypted: bool
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1011
↓ 16 callersFunctioncall_with_db_reconnect_retry
Run a Prisma read coroutine with one transport-reconnect-and-retry. The canonical "self-heal a transient DB transport blip" wrapper used by `
litellm/proxy/db/exception_handler.py:231
↓ 16 callersMethodcheck_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:276
↓ 16 callersMethodcount
(self, where: Optional[Dict[str, Any]] = None)
tests/test_litellm/proxy/memory/test_memory_endpoints.py:121
↓ 16 callersFunctiondate
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 16 callersMethoddelete_cache
(self, key)
litellm/caching/disk_cache.py:90
↓ 16 callersFunctioneB
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 16 callersFunctionem
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 16 callersFunctionextract_file_data
Extracts and processes file data from various input formats. Args: file_data: Can be a tuple of (filename, content, [content_type],
litellm/litellm_core_utils/prompt_templates/common_utils.py:747
↓ 16 callersMethodget_api_key
Return the API key for this provider.
tests/test_litellm/interactions/base_interactions_test.py:29
↓ 16 callersFunctionget_attachment_registry
Get the global AttachmentRegistry singleton. Returns: The global AttachmentRegistry instance
litellm/proxy/policy_engine/attachment_registry.py:463
↓ 16 callersFunctionget_azure_ad_token
Get Azure AD token from various authentication methods. This function tries different methods to obtain an Azure AD token: 1. From an ex
litellm/llms/azure/common_utils.py:253
↓ 16 callersFunctionget_custom_url
(request_base_url: str, route: Optional[str] = None)
litellm/proxy/utils.py:5803
↓ 16 callersMethodget_levo_config
Retrieves the Levo configuration based on environment variables. Returns: LevoConfig: Configuration object containing Le
litellm/integrations/levo/levo.py:41
↓ 16 callersFunctionget_management_object_ttl
In-memory TTL for management-object cache writes (keys, teams, users, budgets, ...). Honors ``general_settings.user_api_key_cache_ttl``, whi
litellm/proxy/common_utils/user_api_key_cache.py:153
↓ 16 callersMethodget_team_id
(self, token: dict, default_value: Optional[str])
litellm/proxy/auth/handle_jwt.py:351
↓ 16 callersMethodhasKey
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 16 callersFunctionhash_password
Hash a password using scrypt with a random salt.
litellm/proxy/utils.py:5041
↓ 16 callersFunctioninitialize_pass_through_endpoints
1. Create a global list of pass-through endpoints (db + config) 2. Clear all existing pass-through endpoints from the FastAPI app routes
litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:2617
↓ 16 callersFunctioninstall_live_call_probe
Activate the live-call socket probe for non-VCR-marked tests. Call this from inside the per-test autouse ``_vcr_outcome_gate`` fixture *befor
tests/_vcr_conftest_common.py:1845
↓ 16 callersFunctionis_cached_message
Returns true, if message is marked as needing to be cached. Used for anthropic/gemini context caching. Follows the anthropic format {"c
litellm/utils.py:7090
↓ 16 callersFunctioniter_message_text
Yield every text fragment from ``messages`` AND ``input``. Walks every role (user, assistant, system, …) — guardrails inspect the entire conv
litellm/proxy/guardrails/_content_utils.py:88
↓ 16 callersFunctionkt
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 16 callersMethodmake_bedrock_api_request
( self, source: Literal["INPUT", "OUTPUT"], messages: Optional[List[AllMessageValues]]
litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:632
↓ 16 callersFunctionmake_ui_spend_logs_mock_prisma
Create a MockPrismaClient for /spend/logs/ui endpoint tests. Args: mock_spend_logs: List of mock spend log dicts. filter_fn:
tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py:148
↓ 16 callersMethodmodel_dump
Default to exclude_unset to avoid Pydantic serializer warnings for OpenAIObject-derived types.
litellm/types/utils.py:1756
↓ 16 callersFunctiono
(t,e)
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 16 callersFunctionprompt_factory
( model: str, messages: list, custom_llm_provider: Optional[str] = None, api_key: Optional[str
litellm/litellm_core_utils/prompt_templates/factory.py:5187
↓ 16 callersMethodredact_standard_logging_payload_from_model_call_details
Redacts or excludes fields from StandardLoggingPayload before callbacks receive it. This method handles two features: 1. tur
litellm/integrations/custom_logger.py:835
↓ 16 callersFunctionredact_string
Scrub known secret/credential patterns from *value* and return the result.
litellm/litellm_core_utils/secret_redaction.py:81
↓ 16 callersMethodreset
()
litellm/proxy/_experimental/out/_next/static/chunks/058o-fyv9lb_l.js:10
↓ 16 callersFunctionsanitizeUrl
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 16 callersMethodsave_config
(self, new_config: dict)
litellm/proxy/proxy_server.py:3568
↓ 16 callersMethodsetup_uoft_guardrail
Setup guardrail with all UofT patterns (mimics the policy template sub-guardrail)
tests/test_litellm/proxy/guardrails/guardrail_hooks/content_filter/test_uoft_policy_e2e.py:19
↓ 16 callersMethodtransform_embedding_response
( self, model: str, raw_response: httpx.Response, model_response: EmbeddingRes
litellm/llms/oci/embed/transformation.py:248
↓ 16 callersMethodtransform_responses_api_tools_to_chat_completion_tools
Transform a Responses API tools into a Chat Completion tools
litellm/responses/litellm_completion_transformation/transformation.py:1255
↓ 16 callersMethodtranslate_generate_content_to_completion
Transform generate_content request to litellm completion format Args: model: The model name contents: Genera
litellm/google_genai/adapters/transformation.py:177
↓ 16 callersMethodtranslate_thinking_to_reasoning
Convert Anthropic thinking param to Responses API reasoning param. ``thinking.budget_tokens`` is bucketed via the shared ``r
litellm/llms/anthropic/experimental_pass_through/responses_adapters/transformation.py:242
↓ 16 callersFunctionverify_password
Verify a password against a stored hash. Supports scrypt and SHA256.
litellm/proxy/utils.py:5052
↓ 15 callersFunctionM
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 15 callersMethod_build_encrypted_item_id
Encode model_id into an output item ID for encrypted-content items. Format: ``encitem_{base64("litellm:model_id:{model_id};item_id:{original_
litellm/responses/utils.py:234
↓ 15 callersMethod_build_response_from_payload
Shared response-building logic (also used by the handler).
litellm/llms/soniox/audio_transcription/transformation.py:188
↓ 15 callersFunction_build_sampling_request
Build a synthetic FastAPI Request for sampling sub-calls. Converts the original MCP connection's HTTP headers into ASGI scope format so that
litellm/proxy/_experimental/mcp_server/sampling_handler.py:935
↓ 15 callersMethod_create_aiohttp_transport
Creates an AiohttpTransport with RequestNotRead error handling Note: aiohttp TCPConnector ssl parameter accepts: - SSLContex
litellm/llms/custom_httpx/http_handler.py:980
↓ 15 callersFunction_default_date_range
Return (start_date, end_date) for the common 7-day range used in UI spend tests.
tests/test_litellm/proxy/spend_tracking/test_spend_management_endpoints.py:23
↓ 15 callersMethod_enhance_usage_with_perplexity_fields
Extract citation tokens and search queries from Perplexity API response and add them to the usage object using standard LiteLLM field
litellm/llms/perplexity/chat/transformation.py:106
↓ 15 callersFunction_enrich_http_exception_with_guardrail_context
If `exc` is an HTTPException with a dict `detail`, mutate it in place to add `guardrail_name` and `guardrail_mode` taken from the callback in
litellm/proxy/utils.py:341
↓ 15 callersFunction_extract_converse_texts
Walk a Bedrock Converse request body and collect text content. Returns (texts, holders) where each holder is the (container, key) pair t
litellm/llms/bedrock/passthrough/guardrail_translation/handler.py:76
↓ 15 callersFunction_get_prisma_client_or_raise_exception
Check if database is connected and raise HTTPException if not.
litellm/proxy/management_endpoints/scim/scim_v2.py:146
↓ 15 callersFunction_is_model_cost_zero
Check if a model has zero cost (no configured pricing). Uses the router's get_model_group_info method to get pricing information. Args:
litellm/proxy/auth/auth_checks.py:151
↓ 15 callersFunction_kwargs
(payload=None)
tests/test_litellm/integrations/otel/test_otel_v2_logger.py:90
↓ 15 callersFunction_make_checker
()
tests/test_litellm/test_check_licenses.py:36
↓ 15 callersFunction_make_instruction_server
( server_id="s1", name="s1", *, alias=None, server_name=None, instructions=None, s
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_server.py:4627
↓ 15 callersFunction_make_prisma_with_existing
Build a MagicMock prisma_client whose user-credentials table returns ``row`` for find_unique and behaves async-correctly for upsert/find_many.
tests/test_litellm/proxy/_experimental/mcp_server/test_db_credentials.py:43
↓ 15 callersFunction_make_sync_client
()
tests/test_litellm/interactions/test_agents_http_handler.py:54
↓ 15 callersFunction_make_wrapper
( chunks: list, provider: str = "anthropic", async_stream: bool = False, )
tests/test_litellm/litellm_core_utils/test_streaming_overhead.py:88
↓ 15 callersMethod_mask_response_create
Enforce the authorized model and apply Presidio PII masking to a ``response.create`` message before it is forwarded to the upstream
litellm/responses/streaming_iterator.py:1329
↓ 15 callersFunction_mock_inspect_response
( json_body: dict, *, status: int = 200, url: str = CHAT_URL )
tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py:71
↓ 15 callersMethod_parse_gcs_uri
Validate a managed GCS file_id and return (bucket, url-encoded-object-path).
litellm/llms/vertex_ai/files/transformation.py:514
↓ 15 callersFunction_redact_response
( *, sanitized_text=None, sanitized_messages=None, sanitized_mcp_arguments=None, sanitized
tests/test_litellm/proxy/guardrails/guardrail_hooks/_cisco_ai_defense_test_utils.py:177
↓ 15 callersMethod_to_model_list
Convert a list of database records to domain models.
litellm/repositories/base_repository.py:53
↓ 15 callersMethodabort
()
litellm/proxy/_experimental/out/_next/static/chunks/0nnx~7-7e5t~1.js:1
↓ 15 callersMethodacreate_file
(self, *args, **kwargs)
tests/batches_tests/test_batch_rate_limits.py:704
↓ 15 callersMethodaimage_generation
( self, model: str, prompt: str, api_key: Optional[str], api_base: Opt
tests/local_testing/test_custom_llm.py:249
↓ 15 callersFunctionapply_policies
Apply guardrails to inputs from policy names and/or a direct list of guardrail names. Runs all guardrails in order; if one fails, the error
litellm/proxy/management_endpoints/policy_endpoints/endpoints.py:114
↓ 15 callersMethodasync_get_cache
( self, key, litellm_parent_otel_span: Union[Span, None], local_only: bool = F
litellm/proxy/utils.py:228
↓ 15 callersMethodasync_log_failure_event
(self, kwargs, response_obj, start_time, end_time)
tests/test_litellm/proxy/test_litellm_pre_call_utils.py:2126
↓ 15 callersMethodasync_logging_hook
For masking logged request/response. Return a modified version of the request/result.
litellm/integrations/custom_logger.py:426
↓ 15 callersFunctioncallback
Actual callback function that Boto3 will call.
litellm/llms/bedrock/common_utils.py:331
↓ 15 callersMethodcheck
(self, text: str)
litellm/proxy/guardrails/guardrail_hooks/litellm_content_filter/guardrail_benchmarks/test_eval.py:520
↓ 15 callersMethodcheck_responses_cost
Check if background responses are complete and track their cost. - Get all status="queued" or "in_progress" and file_purpose="respons
enterprise/litellm_enterprise/proxy/common_utils/check_responses_cost.py:85
↓ 15 callersMethodchunk_parser
Parse a Responses API streaming chunk and convert to OpenAI format. Args: chunk: Dict containing the Responses API event
litellm/completion_extras/litellm_responses_transformation/transformation.py:1373
↓ 15 callersMethodde_anonymize_event_stream
( body_bytes: bytes, proxy_logging_obj: "ProxyLogging", user_api_key_dict: "UserAPIKey
litellm/llms/pass_through/guardrail_translation/handler.py:291
↓ 15 callersMethoddelete_key
(self, key: str)
tests/e2e/budgets/budget_client.py:190
↓ 15 callersFunctione
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 15 callersFunctione7
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 15 callersFunctioneK
(e,t,r,n,o,a,i,l,s=null,c=null,u=null,d=null)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 15 callersFunctioneg
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 15 callersFunctionei
(t,e,r)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 15 callersFunctionfn
(t,e,r,n)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 15 callersMethodgenerate_key
( self, *, models: list[str] | None = None, max_budget: float | None = None,
tests/e2e/budgets/budget_client.py:163
↓ 15 callersMethodget_cache
( self, key, parent_otel_span: Optional[Span] = None, local_only: bool = False
litellm/caching/dual_cache.py:141
↓ 15 callersMethodget_config
(cls)
litellm/llms/maritalk.py:41
↓ 15 callersFunctionget_model_cost_map
Public entry point — returns the model cost map dict. 1. If ``LITELLM_LOCAL_MODEL_COST_MAP`` is set, uses the local backup only. 2. Othe
litellm/litellm_core_utils/get_model_cost_map.py:237
↓ 15 callersFunctionget_standard_logging_object_payload
( kwargs: Optional[dict], init_response_obj: Union[Any, BaseModel, dict], start_time: dt_object,
litellm/litellm_core_utils/litellm_logging.py:5143
↓ 15 callersMethodhealth_check_server
Perform a health check on a specific MCP server. Args: server_id: The ID of the server to health check mcp_a
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:3969
↓ 15 callersFunctioni
()
litellm/proxy/_experimental/out/_next/static/chunks/0ys10755n8os_.js:1
↓ 15 callersMethodinfo
(model, **kwargs)
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_sampling_priority_selection.py:180
↓ 15 callersFunctionisIterable
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 15 callersMethodis_recording
(self)
tests/test_litellm/integrations/otel/test_otel_v2_mount.py:53
← previousnext →901–1,000 of 68,180, ranked by callers