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
↓ 71 callers
Method
read
Read response content.
litellm/integrations/mock_client_factory.py:74
↓ 70 callers
Function
_
({response:e})
litellm/proxy/_experimental/out/_next/static/chunks/00fcsizkvc4hx.js:1
↓ 70 callers
Method
findIndex
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/02ax9y70kcggv.js:1
↓ 70 callers
Method
update_from_kwargs
Convenience wrapper around update_environment_variables that automatically extracts metadata/litellm_metadata from kwargs, so
litellm/litellm_core_utils/litellm_logging.py:579
↓ 69 callers
Method
get_provider_responses_api_config
( provider: Union[LlmProviders, str], model: Optional[str] = None, )
litellm/utils.py:8150
↓ 68 callers
Method
enter
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 68 callers
Method
exit
()
litellm/proxy/_experimental/out/_next/static/chunks/0ivj_wax-joap.js:1
↓ 68 callers
Function
p
()
litellm/proxy/_experimental/out/_next/static/chunks/0zam.8alu6_vj.js:1
↓ 68 callers
Method
set
(self, name, value, *, nx=False, px=None)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_redis_distributed_lock.py:26
↓ 67 callers
Method
count
Count records matching the criteria.
litellm/repositories/base_repository.py:106
↓ 67 callers
Method
list
List all API keys with optional filtering and pagination. Args: page (Optional[int]): Page number for pagination
litellm/proxy/client/keys.py:34
↓ 66 callers
Function
_read_request_body
Safely read the request body and parse it as JSON. Parameters: - request: The request object to read the body from Returns: - d
litellm/proxy/common_utils/http_parsing_utils.py:42
↓ 66 callers
Function
_user
(user_id: str = "user-1", team_id: str = "team-1")
tests/pass_through_unit_tests/test_passthrough_managed_ids.py:59
↓ 66 callers
Function
k
(e,a)
litellm/proxy/_experimental/out/_next/static/chunks/0zam.8alu6_vj.js:1
↓ 66 callers
Function
u
(t,e,r)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 65 callers
Function
a
(_)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 65 callers
Method
aembedding
( self, model: str, input: list, model_response: EmbeddingResponse, pr
tests/local_testing/test_custom_llm.py:293
↓ 65 callers
Method
post_call_failure_hook
Allows users to raise custom exceptions/log when a call fails, without having to deal with parsing Request body. Callbacks can return
litellm/proxy/utils.py:1973
↓ 64 callers
Function
handle_exception_on_proxy
Returns an Exception as ProxyException, this ensures all exceptions are OpenAI API compatible
litellm/proxy/utils.py:5777
↓ 64 callers
Function
id
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 63 callers
Function
S
()
litellm/proxy/_experimental/out/_next/static/chunks/0zam.8alu6_vj.js:1
↓ 63 callers
Function
T
({label:e,value:r})
litellm/proxy/_experimental/out/_next/static/chunks/00fcsizkvc4hx.js:1
↓ 63 callers
Function
rt
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 62 callers
Method
create
Create a new record.
litellm/repositories/base_repository.py:89
↓ 61 callers
Method
chunk_parser
(self, chunk: dict)
litellm/llms/cohere/common_utils.py:126
↓ 61 callers
Method
clone
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 61 callers
Function
deriveErrorMessage
(errorData: any)
ui/litellm-dashboard/src/lib/http/client.ts:47
↓ 61 callers
Function
print_verbose
(print_statement)
litellm/_logging.py:413
↓ 61 callers
Method
query_raw
(self, query: str, *args)
tests/proxy_unit_tests/test_proxy_utils.py:1574
↓ 60 callers
Function
N
(t,s,l)
litellm/proxy/_experimental/out/_next/static/chunks/0sgrgsvh.osf1.js:1
↓ 60 callers
Function
_make_guardrail
(api_key: str = "hs-cato-key", **extra)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.py:350
↓ 60 callers
Method
send
(e,t,s)
litellm/proxy/_experimental/out/_next/static/chunks/0piozaeodiue..js:30
↓ 60 callers
Function
u
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 60 callers
Function
u
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 59 callers
Function
L
(t,e)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 59 callers
Function
_get_encoding
Get encoding, loading it lazily if needed.
litellm/main.py:8749
↓ 59 callers
Method
consume
(e)
litellm/proxy/_experimental/out/_next/static/chunks/06mj74u6dgxb8.js:1
↓ 59 callers
Method
submit
(self, fn, *args, **kwargs)
tests/test_litellm/passthrough/test_streaming_interrupt_spend_tracking.py:33
↓ 59 callers
Method
walk
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 58 callers
Method
reset
(self)
litellm/router.py:11084
↓ 58 callers
Method
run
()
tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py:1934
↓ 58 callers
Method
start
Start the logging worker. Idempotent - safe to call multiple times.
litellm/litellm_core_utils/logging_worker.py:83
↓ 58 callers
Function
t6
(e,t,s,r)
litellm/proxy/_experimental/out/_next/static/chunks/0piozaeodiue..js:4
↓ 57 callers
Function
C
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/00fcsizkvc4hx.js:1
↓ 57 callers
Function
_make_signer
(**kwargs: Any)
tests/test_litellm/proxy/guardrails/test_mcp_jwt_signer.py:55
↓ 57 callers
Method
extend
(self, key, token, ttl_seconds)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_redis_refresh_coordinator.py:34
↓ 57 callers
Method
find_first
(self, where)
tests/test_litellm/test_router_retry_policy_update.py:220
↓ 57 callers
Method
list
(e={},t)
litellm/proxy/_experimental/out/_next/static/chunks/0piozaeodiue..js:7
↓ 56 callers
Method
async_set_cache
(self, key, value, local_only: bool = False, **kwargs)
litellm/proxy/common_utils/user_api_key_cache.py:137
↓ 55 callers
Function
_make_guardrail
( handler: FakeHandler, *, unreachable_fallback="fail_closed", api_base="https://vigil.test",
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_vigil_guard.py:55
↓ 55 callers
Function
decrypt_value_helper
( value: str, key: str, # this is just for debug purposes, showing the k,v pair that's invalid. not a
litellm/proxy/common_utils/encrypt_decrypt_utils.py:119
↓ 55 callers
Function
generate_key_fn
Generate an API key based on the provided data. Docs: https://docs.litellm.ai/docs/proxy/virtual_keys Parameters: - duration: Optio
litellm/proxy/management_endpoints/key_management_endpoints.py:1451
↓ 55 callers
Function
generic_cost_per_token
Calculates the cost per token for a given model, prompt tokens, and completion tokens. Handles context caching as well. Input:
litellm/litellm_core_utils/llm_cost_calc/utils.py:665
↓ 55 callers
Method
update_environment
( self, prisma_client: Optional[PrismaClient], user_api_key_cache: UserApiKeyCache,
litellm/proxy/auth/handle_jwt.py:125
↓ 54 callers
Method
create
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0piozaeodiue..js:7
↓ 54 callers
Function
exception_type
Maps an LLM Provider Exception to OpenAI Exception Format
litellm/litellm_core_utils/exception_mapping_utils.py:2150
↓ 54 callers
Method
setMetaProperty
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 53 callers
Function
E
(e)
litellm/proxy/_experimental/out/_next/static/chunks/15hm8gokjq2uu.js:1
↓ 53 callers
Method
close
(self)
litellm/proxy/auth/handle_jwt.py:1037
↓ 53 callers
Function
cn
()
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 53 callers
Method
copy
()
litellm/proxy/_experimental/out/_next/static/chunks/11ibt3khr2hk3.js:1
↓ 53 callers
Method
get_model_list
Includes router model_group_alias'es as well if team_id specified, returns matching team-specific models
litellm/router.py:9446
↓ 52 callers
Function
_make_response
(body: dict, status_code: int = 200)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_xecguard.py:56
↓ 52 callers
Function
fc
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 52 callers
Method
r
()
litellm/proxy/_experimental/out/_next/static/chunks/0-0c4mv4-mc9n.js:1
↓ 52 callers
Method
select
Choose one deployment from `candidates` (all sharing the requested `model_name`). Returns `None` when there are no candidates.
litellm-rust/crates/core/src/router/strategy/mod.rs:21
↓ 51 callers
Function
P
(t)
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 51 callers
Function
_logger
(legacy_compat=True, team_metadata_keys=None)
tests/test_litellm/integrations/otel/test_otel_v2_logger.py:103
↓ 51 callers
Function
add_guardrail_to_applied_guardrails_header
(request_data: Dict, guardrail_name: Optional[str])
litellm/proxy/common_utils/callback_utils.py:495
↓ 51 callers
Function
common_checks
Common checks across jwt + key-based auth. 1. If team is blocked 1.1. If project is blocked 2. If team can call model 2.2 If pro
litellm/proxy/auth/auth_checks.py:477
↓ 51 callers
Method
flatMap
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 51 callers
Function
make_user_api_key_auth
()
tests/test_litellm/proxy/utils/proxy_logging/conftest.py:82
↓ 51 callers
Method
model_dump
(self, **_kwargs)
tests/test_litellm/proxy/utils/helpers/test_model_access.py:279
↓ 51 callers
Method
update
(self, where=None, data=None)
tests/litellm_utils_tests/test_proxy_budget_reset.py:63
↓ 50 callers
Function
_gemini_convert_messages_with_history
Converts given messages from OpenAI format to Gemini format - Parts must be iterable - Roles must alternate b/w 'user' and 'model' (same
litellm/llms/vertex_ai/gemini/transformation.py:638
↓ 50 callers
Method
add_standard_logging_guardrail_information_to_request_data
Builds `StandardLoggingGuardrailInformation` and adds it to the request metadata so it can be used for logging to DataDog, Langfuse, etc.
litellm/integrations/custom_guardrail.py:703
↓ 50 callers
Method
flush_cache
(self)
litellm/router.py:11080
↓ 50 callers
Function
getGlobalLitellmHeaderName
()
ui/litellm-dashboard/src/components/networking.tsx:359
↓ 50 callers
Method
get_allowed_mcp_servers
Get the allowed MCP Servers for the user. Priority: 1. If object_permission.mcp_servers is explicitly set, use it (even for
litellm/proxy/_experimental/mcp_server/mcp_server_manager.py:1401
↓ 49 callers
Method
async_pre_routing_hook
This hook is called before the routing decision is made. Used for the litellm auto-router to modify the request before the routing d
litellm/router.py:10511
↓ 49 callers
Function
get_team_object
- Check if team id in proxy Team Table - if valid, return LiteLLM_TeamTable object with defined limits - if not, then raise an error
litellm/proxy/auth/auth_checks.py:1887
↓ 49 callers
Method
remove
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 49 callers
Function
serializers_value
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 49 callers
Function
z
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 48 callers
Function
_bedrock_converse_messages_pt
Converts given messages from OpenAI format to Bedrock format - Roles must alternate b/w 'user' and 'model' (same as anthropic -> merge conse
litellm/litellm_core_utils/prompt_templates/factory.py:4677
↓ 48 callers
Function
create_scratch_team
Raw-seed a scratch-tagged team row; returns its team_id. The target team for the team write matrices (update / member_*). Raw prisma (not POS
tests/proxy_behavior/management/conftest.py:136
↓ 48 callers
Function
encrypt_value_helper
(value: str, new_encryption_key: Optional[str] = None)
litellm/proxy/common_utils/encrypt_decrypt_utils.py:94
↓ 48 callers
Method
get_custom_headers
( *, user_api_key_dict: UserAPIKeyAuth, call_id: Optional[str] = None, model_i
litellm/proxy/common_request_processing.py:789
↓ 48 callers
Function
load_vertex_ai_credentials
()
tests/local_testing/test_amazing_vertex_completion.py:106
↓ 48 callers
Function
q
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 48 callers
Method
setState
(e)
litellm/proxy/_experimental/out/_next/static/chunks/08yy42xvwaak6.js:1
↓ 48 callers
Method
should_run_guardrail
Override to add debug logging.
litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py:138
↓ 47 callers
Function
embedding
( model, input=[], # Optional params dimensions: Optional[int] = None, encoding_format: Op
litellm/main.py:5790
↓ 47 callers
Method
hasListeners
()
litellm/proxy/_experimental/out/_next/static/chunks/08yy42xvwaak6.js:1
↓ 46 callers
Function
R
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 46 callers
Method
_ensure_access_token
Returns auth token and project id
litellm/llms/vertex_ai/vertex_llm_base.py:570
↓ 46 callers
Function
is_request_body_safe
Check if the request body is safe. A malicious user can set the api_base to their own domain and invoke POST /chat/completions to intercept
litellm/proxy/auth/auth_utils.py:341
↓ 46 callers
Function
p
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 46 callers
Method
values
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 45 callers
Function
_get_parent_otel_span_from_kwargs
( kwargs: Optional[dict] = None, )
litellm/litellm_core_utils/core_helpers.py:209
← previous
next →
201–300 of 71,069, ranked by callers