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
Function
Xi
(s,o,i,a)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 8 callers
Method
_add_tools_to_optional_params
Helper util to add tools to optional_params.
litellm/llms/base_llm/chat/transformation.py:142
↓ 8 callers
Function
_agent_command
(name)
tests/test_litellm/proxy/client/cli/test_agents.py:28
↓ 8 callers
Method
_assert_parity
(self, raw_frames)
tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_anthropic_passthrough_logging_handler.py:1168
↓ 8 callers
Method
_assign_unique_short_prefix
Resolve and cache a collision-free short tool prefix on ``server``. Called at registration time for every MCP server entering the reg
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:2685
↓ 8 callers
Function
_async_payload
(content="Hello world! How are you?")
tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_to_streaming_response.py:22
↓ 8 callers
Function
_async_streaming
(response, model, custom_llm_provider, args)
litellm/main.py:699
↓ 8 callers
Function
_auth_headers
()
tests/integration/test_oci_proxy_integration.py:183
↓ 8 callers
Function
_batch_resolve_access_group_resources
Batch-fetch access groups in a single DB query and return a per-group resource map. Returns {ag_id: {"models": [...], "mcp_server_ids":
litellm/proxy/management_endpoints/team_endpoints.py:3926
↓ 8 callers
Function
_build_anthropic_tool_name_maps
Build (forward, reverse) tool-name maps for a single request. forward[original] = sanitized -- only present when name was rewritten reverse
litellm/llms/anthropic/chat/transformation.py:152
↓ 8 callers
Function
_build_batch_response
( *, batch_id: str = "batch_managed_ids_test", status: str = "completed", output_file_id: Opti
tests/test_litellm/enterprise/proxy/test_batch_update_db_managed_output_file_id.py:17
↓ 8 callers
Method
_build_complete_streaming_response
Builds complete response from raw chunks - Converts str chunks to generic chunks - Converts generic chunks to litellm chunks
litellm/proxy/pass_through_endpoints/llm_provider_handlers/base_passthrough_logging_handler.py:160
↓ 8 callers
Function
_build_custom_pricing_entry
Build a complete model cost entry from kwargs and model_info. Collects all CustomPricingLiteLLMParams fields present in kwargs and merges met
litellm/main.py:1056
↓ 8 callers
Function
_build_db_connection_url_params
Build the Prisma DATABASE_URL query params controlling connection pool behavior. `connect_timeout` / `socket_timeout` map to the Prisma URL param
litellm/proxy/proxy_cli.py:42
↓ 8 callers
Method
_build_decode_kwargs
Build the audience/issuer/options kwargs for ``jwt.decode``. Setting ``JWT_AUDIENCE`` (and optionally ``JWT_ISSUER``) turns on the co
litellm/proxy/auth/handle_jwt.py:784
↓ 8 callers
Function
_build_oauth_protected_resource_response
Build OAuth protected resource response with the appropriate URL pattern. For pass-through MCP servers (``MCPServer.is_oauth_passthrough``),
litellm/proxy/_experimental/mcp_server/discoverable_endpoints.py:1103
↓ 8 callers
Function
_build_payload
( model_group: str = "bedrock-claude-group", custom_llm_provider: str = "bedrock", additional_head
tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.py:44
↓ 8 callers
Function
_build_prisma_mock
()
tests/test_litellm/enterprise/proxy/test_batch_update_db_managed_output_file_id.py:48
↓ 8 callers
Function
_build_simple_text_stream
Produce SSE bytes for a simple text response (no tool calls).
tests/test_litellm/llms/anthropic/experimental_pass_through/messages/test_agentic_streaming_iterator.py:35
↓ 8 callers
Function
_call_summary_model
Invoke the configured summary model. Prefers ``llm_router.acompletion`` so the model alias resolves against the proxy's ``model_list``; falls
litellm/llms/anthropic/experimental_pass_through/context_management/editors/compact.py:805
↓ 8 callers
Method
_check_max_streaming_duration
Raise litellm.Timeout if the stream has exceeded LITELLM_MAX_STREAMING_DURATION_SECONDS.
litellm/litellm_core_utils/streaming_handler.py:205
↓ 8 callers
Function
_check_model_access
Enforce model-permission checks for MCP sampling requests. Runs the same authorization checks as ``/chat/completions``: key-level, team-level
litellm/proxy/_experimental/mcp_server/sampling_handler.py:639
↓ 8 callers
Function
_check_passthrough_routes_caller_permission
Only proxy admins may set `allowed_passthrough_routes` (top-level or under `metadata`) — it short-circuits the role-based route gate, so keys
litellm/proxy/management_endpoints/common_utils.py:79
↓ 8 callers
Method
_check_rate_limits
Check rate limits using THREE-PHASE approach to prevent partial increments. Phase 1: Read-only check of ALL limits (no increments)
litellm/proxy/hooks/dynamic_rate_limiter_v3.py:369
↓ 8 callers
Function
_check_team_member_budget
Check if team member is over their max budget within the team.
litellm/proxy/auth/auth_checks.py:3706
↓ 8 callers
Function
_collect_async
(payload)
tests/test_litellm/litellm_core_utils/llm_response_utils/test_convert_to_streaming_response.py:44
↓ 8 callers
Method
_common_add_cooldown_logic
( self, model_id: str, original_exception, exception_status, cooldown_time: float )
litellm/router_utils/cooldown_cache.py:44
↓ 8 callers
Function
_convert_openai_response_to_mcp_result
Convert a litellm completion response to MCP CreateMessageResult. Args: response: The litellm ModelResponse. model_name: The
litellm/proxy/_experimental/mcp_server/sampling_handler.py:562
↓ 8 callers
Method
_create_mock_httpx_response
Create a mock httpx response
tests/test_litellm/proxy/pass_through_endpoints/llm_provider_handlers/test_openai_passthrough_logging_handler.py:61
↓ 8 callers
Method
_create_prefixed_tools
Create prefixed tools and update tool mapping. Args: tools: List of original tools from server server: Serve
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:2745
↓ 8 callers
Method
_decode_encrypted_item_id
Decode a litellm-encoded encrypted-content item ID. Returns a dict with ``model_id`` and ``item_id`` keys, or ``None`` if the string
litellm/responses/utils.py:244
↓ 8 callers
Function
_decode_realtime_token_payload
Decode realtime token payload; returns None for legacy/raw ephemeral tokens.
litellm/proxy/realtime_endpoints/endpoints.py:186
↓ 8 callers
Function
_decode_vector_store_ids_in_tools
Decodes unified (LiteLLM-managed) vector_store_ids in file_search tools to provider-native IDs. Non-unified IDs are passed through unchanged
litellm/litellm_core_utils/prompt_templates/common_utils.py:590
↓ 8 callers
Function
_delete_cache_key_object
( hashed_token: str, user_api_key_cache: UserApiKeyCache, proxy_logging_obj: Optional[ProxyLogging
litellm/proxy/auth/auth_checks.py:1766
↓ 8 callers
Function
_emit_llm
Drive the real boundary flow: open at ``pre_call`` then close at the async callback. ``ambient``, if given, is the span that is the active OTel co
tests/test_litellm/integrations/otel/test_otel_v2_logger.py:110
↓ 8 callers
Function
_enforce_key_and_fallback_model_access
Key-level model allowlist and client fallbacks (same as standard auth). Not included in common_checks — common_checks enforces team/user/proj
litellm/proxy/auth/user_api_key_auth.py:2660
↓ 8 callers
Method
_ensure_tool_results_have_corresponding_tool_calls
Ensure that tool_result messages have corresponding tool_calls in the previous assistant message. This is critical for Anthropic API
litellm/responses/litellm_completion_transformation/transformation.py:729
↓ 8 callers
Method
_ensure_upstream_initialize_instructions_cached
Open one upstream session and cache InitializeResult.instructions if missing. No-op when: - YAML/DB instructions are set o
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:570
↓ 8 callers
Function
_enum_values
(model_group: str = "bedrock-claude-group")
tests/test_litellm/integrations/test_prometheus_remaining_tokens_router_fallback.py:67
↓ 8 callers
Method
_events_for_chunk
Translate a single upstream Responses API chunk into the list of Interactions API events it should produce. Returning a list
litellm/interactions/litellm_responses_transformation/streaming_iterator.py:174
↓ 8 callers
Function
_execute_virtual_key_regeneration
Generate new token, update DB, invalidate cache, and return response.
litellm/proxy/management_endpoints/key_management_endpoints.py:4172
↓ 8 callers
Function
_expect_block
Assert that the guardrail BLOCKS the sentence.
tests/guardrails_tests/test_sg_pdpa_guardrails.py:62
↓ 8 callers
Function
_extract_base64_data
Extract pure base64 data from an image URL. If the URL is a data URL (e.g., "data:image/png;base64,iVBOR..."), extract and return only t
litellm/litellm_core_utils/prompt_templates/common_utils.py:1508
↓ 8 callers
Function
_extract_max_media_resolution_from_messages
Extract the highest media resolution (detail) from image content in messages. This is used to set the global media_resolution in generation_
litellm/llms/vertex_ai/gemini/transformation.py:138
↓ 8 callers
Method
_extract_rate_limit_labels
Pull the unified ``category`` / ``rate_limit_type`` fields off any exception that declares them (``litellm.RateLimitError`` and bare-
litellm/integrations/prometheus.py:2627
↓ 8 callers
Method
_extract_tags
(self, log: StandardLoggingPayload)
litellm/integrations/datadog/datadog_cost_management.py:167
↓ 8 callers
Method
_extract_usage_metadata_from_websocket_messages
Extract and aggregate usage metadata from a list of WebSocket messages. Args: websocket_messages: List of WebSocket mess
litellm/proxy/pass_through_endpoints/llm_provider_handlers/vertex_ai_live_passthrough_logging_handler.py:52
↓ 8 callers
Method
_fetch_single_authorization_server_metadata
( self, issuer_url: str, server_url: str )
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:2490
↓ 8 callers
Method
_filter_health_check_unhealthy_deployments
Sync version of _async_filter_health_check_unhealthy_deployments.
litellm/router.py:10902
↓ 8 callers
Function
_freeze_today
(monkeypatch, frozen)
tests/test_litellm/proxy/utils/helpers/test_month_end_projection.py:16
↓ 8 callers
Function
_get_allowed_mcp_servers
Return allowed MCP servers for a request after applying filters. Args: user_api_key_auth: The authenticated user's API key info.
litellm/proxy/_experimental/mcp_server/server.py:1172
↓ 8 callers
Method
_get_allowed_mcp_servers_for_key
Get the key's own MCP ceiling from its object_permission (mcp_servers, tag-style mcp_access_groups, mcp_tool_permissions). U
litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py:924
↓ 8 callers
Method
_get_auth_headers
Generate authentication headers based on auth type.
litellm/experimental_mcp_client/client.py:414
↓ 8 callers
Function
_get_base_model_from_litellm_call_metadata
( metadata: Optional[dict], )
litellm/litellm_core_utils/get_litellm_params.py:47
↓ 8 callers
Method
_get_batch_rate_limiter
Get or lazy-load the batch rate limiter.
litellm/proxy/hooks/parallel_request_limiter_v3.py:335
↓ 8 callers
Function
_get_cached_temporary_mcp_server_or_404
( server_id: str, user_api_key_dict: UserAPIKeyAuth, request: Optional[Request] = None
litellm/proxy/management_endpoints/mcp_management_endpoints.py:1565
↓ 8 callers
Method
_get_mcp_auth_header_from_headers
Get the header passed to LiteLLM to pass to downstream MCP servers By default litellm will check for the header `x-mcp-auth` by sett
litellm/proxy/_experimental/mcp_server/auth/user_api_key_auth_mcp.py:409
↓ 8 callers
Function
_get_prisma_client
Get the prisma client from proxy_server.
litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py:39
↓ 8 callers
Function
_get_proxy_model_info
(model: dict)
litellm/proxy/proxy_server.py:12138
↓ 8 callers
Function
_get_resource_types
Return the list of SCIM ResourceType definitions per RFC 7643 Section 6.
litellm/proxy/management_endpoints/scim/scim_v2.py:618
↓ 8 callers
Method
_get_router_deployment_budget_limiter
Return the router's deployment-budget callback. Uses exact-type matching so proxy subclasses (e.g. virtual-key model budgets)
litellm/router.py:8188
↓ 8 callers
Function
_handle_invalid_parallel_tool_calls
Handle hallucinated parallel tool call from openai - https://community.openai.com/t/model-tries-to-call-unknown-function-multi-tool-use-parallel/
litellm/litellm_core_utils/llm_response_utils/convert_dict_to_response.py:371
↓ 8 callers
Method
_handler
(self, model, custom_llm_provider=None)
tests/test_litellm/proxy/response_api_endpoints/test_endpoints.py:659
↓ 8 callers
Function
_has_attribute_error_in_chain
Walk the exception chain to find an AttributeError at any depth. Checks __cause__, __context__, and the litellm-specific original_exception a
litellm/proxy/common_request_processing.py:706
↓ 8 callers
Function
_has_non_empty_value
Check if a value has real content (not None, not empty list, not blank string).
litellm/proxy/management_endpoints/common_utils.py:564
↓ 8 callers
Method
_has_post_call_guardrails
True when a guardrail explicitly registers post_call. event_hook=None matches all hooks in should_run_guardrail but must not defer as
litellm/proxy/common_request_processing.py:1916
↓ 8 callers
Method
_init_kwargs_for_pass_through_endpoint
Filter out litellm params from the request body
litellm/proxy/pass_through_endpoints/pass_through_endpoints.py:512
↓ 8 callers
Method
_is_engine_alive
(self)
litellm/proxy/utils.py:4107
↓ 8 callers
Function
_is_object_dict
(value: object)
litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.py:58
↓ 8 callers
Function
_is_object_list
(value: object)
litellm/proxy/guardrails/guardrail_hooks/repelloai/repelloai.py:62
↓ 8 callers
Method
_load_environment_variables
(self, config: dict)
litellm/proxy/proxy_server.py:3880
↓ 8 callers
Method
_log_completed_response
(self, *, is_async: bool)
litellm/responses/streaming_iterator.py:263
↓ 8 callers
Function
_make_app
()
tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py:112
↓ 8 callers
Function
_make_client
()
tests/test_litellm/proxy/public_endpoints/test_public_endpoints.py:644
↓ 8 callers
Function
_make_completed_response
(response_id: str = "resp_test")
tests/llm_responses_api_testing/test_responses_hooks.py:55
↓ 8 callers
Method
_make_existing_key
(self, user_id="creator-123", created_by="creator-123")
tests/test_litellm/proxy/management_endpoints/test_key_management_endpoints.py:9721
↓ 8 callers
Function
_make_generic_chunk
( text: str, is_finished: bool = False, finish_reason: str = "", usage: Optional[dict] = None,
tests/test_litellm/litellm_core_utils/test_streaming_overhead.py:46
↓ 8 callers
Function
_make_guardrail
(**kwargs)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_headroom.py:35
↓ 8 callers
Function
_make_jwt_handler
(team_id_jwt_field: str)
tests/test_litellm/proxy/auth/test_handle_jwt.py:2625
↓ 8 callers
Method
_make_logging_obj
Create a mock logging object.
tests/test_litellm/llms/github_copilot/test_github_copilot_transformation.py:552
↓ 8 callers
Function
_make_prisma_client
()
tests/test_litellm/proxy/management_endpoints/test_workflow_management_endpoints.py:101
↓ 8 callers
Method
_make_router
(self, timeout=None, stream_timeout=None)
tests/test_litellm/test_router.py:5185
↓ 8 callers
Function
_make_search_response
()
tests/test_litellm/integrations/websearch_interception/test_websearch_native_blocks.py:32
↓ 8 callers
Function
_make_team_scoped_router
Build a Router whose model_list looks like what the proxy creates for team-scoped BYOK DB models: the internal model_name is ``<public_na
tests/test_litellm/proxy/auth/test_auth_checks.py:1225
↓ 8 callers
Function
_make_test_images
()
tests/image_gen_tests/test_image_edits.py:115
↓ 8 callers
Method
_make_test_provider
(self)
tests/test_litellm/llms/openai_like/responses/test_openai_like_responses.py:106
↓ 8 callers
Function
_make_user_api_key_auth
Build a minimal UserAPIKeyAuth-like object for tests.
tests/test_litellm/proxy/_experimental/mcp_server/test_mcp_sampling_model_access.py:22
↓ 8 callers
Function
_make_wav_bytes
(seconds: float = 1.0, sample_rate: int = 16000)
tests/test_litellm/llms/nvidia_riva/audio_transcription/test_handler.py:31
↓ 8 callers
Function
_matches_claude_model_pattern
Check if a model string matches the Claude model naming pattern. Matches patterns like: - claude-opus-4-7 - claude-sonnet-4-6 -
litellm/litellm_core_utils/get_llm_provider_logic.py:75
↓ 8 callers
Function
_model_list
()
tests/test_litellm/router_strategy/test_lar1_routing.py:15
↓ 8 callers
Method
_on_engine_death_from_thread
Called on the event loop thread when the waitpid thread detects engine death.
litellm/proxy/utils.py:4239
↓ 8 callers
Function
_params
(config, query, optional_params)
tests/test_litellm/llms/apiserpent/test_apiserpent_search.py:17
↓ 8 callers
Method
_parse_bool_env
Parse a boolean environment variable. Accepts true/false, 1/0, yes/no, on/off (case-insensitive, whitespace-tolerant) — matching the
litellm/integrations/newrelic/newrelic.py:154
↓ 8 callers
Method
_parse_lines
(lines: list[str])
litellm/llms/e2b/sandbox/transformation.py:167
↓ 8 callers
Function
_patch_logging_flags
(monkeypatch, needs_wrap=False, needs_per_chunk=False)
tests/test_litellm/proxy/proxy_server/test_streaming_helpers.py:617
↓ 8 callers
Function
_payload
(**overrides)
tests/test_litellm/integrations/otel/test_otel_v2_emitter.py:27
↓ 8 callers
Function
_perform_health_check
Perform a health check for each model in the list. max_concurrency: Optional limit on concurrent health check requests.
litellm/proxy/health_check.py:246
↓ 8 callers
Method
_pkce_token_exchange
Performs a direct OAuth token exchange including the PKCE code_verifier. fastapi-sso does not forward code_verifier, so when PKCE is
litellm/proxy/management_endpoints/ui_sso.py:3498
↓ 8 callers
Method
_prepare
( self, audio_file: Optional[FileTypes], optional_params: dict, litellm_params
litellm/llms/soniox/audio_transcription/handler.py:137
↓ 8 callers
Method
_prepare_request
( self, credentials, data: dict, optional_params: dict, aws_region_nam
litellm/proxy/guardrails/guardrail_hooks/bedrock_guardrails.py:566
← previous
next →
2,101–2,200 of 68,180, ranked by callers