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
↓ 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
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
↓ 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
↓ 64 callers
Function
_
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.js:1
↓ 64 callers
Function
handle_exception_on_proxy
Returns an Exception as ProxyException, this ensures all exceptions are OpenAI API compatible
litellm/proxy/utils.py:5707
↓ 64 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:1971
↓ 63 callers
Method
exit
()
litellm/proxy/_experimental/out/_next/static/chunks/0ivj_wax-joap.js:1
↓ 63 callers
Function
id
(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
↓ 62 callers
Function
rs
()
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 62 callers
Method
send
(e,t,s)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:30
↓ 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
Method
model_validate
(cls, value)
tests/llm_responses_api_testing/test_responses_hooks.py:702
↓ 61 callers
Function
print_verbose
(print_statement)
litellm/_logging.py:413
↓ 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
query_raw
(self, query: str, *args)
tests/proxy_unit_tests/test_proxy_utils.py:1574
↓ 60 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
↓ 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
Method
submit
(self, fn, *args, **kwargs)
tests/test_litellm/passthrough/test_streaming_interrupt_spend_tracking.py:33
↓ 59 callers
Function
u
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0pwkd9r.mc_ee.js:1
↓ 59 callers
Method
walk
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 58 callers
Function
_get_encoding
Get encoding, loading it lazily if needed.
litellm/main.py:8706
↓ 58 callers
Method
list
(e={},t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:7
↓ 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
t8
(e,t,s,r)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:4
↓ 57 callers
Function
C
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0rdv7_7_95b-1.js:1
↓ 57 callers
Function
S
(e)
litellm/proxy/_experimental/out/_next/static/chunks/15hm8gokjq2uu.js:1
↓ 57 callers
Function
_make_signer
(**kwargs: Any)
tests/test_litellm/proxy/guardrails/test_mcp_jwt_signer.py:55
↓ 57 callers
Method
find_first
(self, where)
tests/test_litellm/test_router_retry_policy_update.py:220
↓ 56 callers
Method
extend
(self, key, token, ttl_seconds)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_redis_refresh_coordinator.py:34
↓ 56 callers
Method
reset
(self)
litellm/router.py:11060
↓ 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
Method
async_set_cache
(self, key, value, local_only: bool = False, **kwargs)
litellm/proxy/common_utils/user_api_key_cache.py:137
↓ 55 callers
Method
update_environment
( self, prisma_client: Optional[PrismaClient], user_api_key_cache: UserApiKeyCache,
litellm/proxy/auth/handle_jwt.py:125
↓ 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
Method
close
(self)
litellm/proxy/auth/handle_jwt.py:1037
↓ 53 callers
Method
copy
()
litellm/proxy/_experimental/out/_next/static/chunks/101az3fsw7lje.js:1
↓ 53 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:1320
↓ 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:9417
↓ 52 callers
Function
O
litellm/proxy/_experimental/out/_next/static/chunks/0pwkd9r.mc_ee.js:1
↓ 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
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:664
↓ 51 callers
Function
make_user_api_key_auth
()
tests/test_litellm/proxy/utils/proxy_logging/conftest.py:82
↓ 51 callers
Function
q
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 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
Function
add_guardrail_to_applied_guardrails_header
(request_data: Dict, guardrail_name: Optional[str])
litellm/proxy/common_utils/callback_utils.py:495
↓ 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:11056
↓ 50 callers
Function
getGlobalLitellmHeaderName
()
ui/litellm-dashboard/src/components/networking.tsx:361
↓ 50 callers
Method
model_dump
(self, **_kwargs)
tests/test_litellm/proxy/utils/helpers/test_model_access.py:279
↓ 49 callers
Function
E
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0rdv7_7_95b-1.js:1
↓ 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:10487
↓ 49 callers
Method
create
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:7
↓ 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:1888
↓ 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
↓ 48 callers
Function
I
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.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:4652
↓ 48 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
↓ 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
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
Method
hasListeners
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 48 callers
Function
load_vertex_ai_credentials
()
tests/local_testing/test_amazing_vertex_completion.py:106
↓ 48 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
↓ 48 callers
Method
setState
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 48 callers
Method
should_run_guardrail
Override to add debug logging.
litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py:138
↓ 47 callers
Function
L
litellm/proxy/_experimental/out/_next/static/chunks/01_xjyxcb1uco.js:1
↓ 47 callers
Function
embedding
( model, input=[], # Optional params dimensions: Optional[int] = None, encoding_format: Op
litellm/main.py:5747
↓ 46 callers
Method
_ensure_access_token
Returns auth token and project id
litellm/llms/vertex_ai/vertex_llm_base.py:570
↓ 46 callers
Function
p
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 46 callers
Method
r
()
litellm/proxy/_experimental/out/_next/static/chunks/02813b2b-kz98.js:8
↓ 45 callers
Function
B
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 45 callers
Function
_get_parent_otel_span_from_kwargs
( kwargs: Optional[dict] = None, )
litellm/litellm_core_utils/core_helpers.py:209
↓ 45 callers
Function
_prisma_client
Return a MagicMock prisma_client with async db methods.
tests/pass_through_unit_tests/test_passthrough_managed_ids.py:68
↓ 45 callers
Method
flatMap
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 45 callers
Function
formatNumberWithCommas
( value: number | null | undefined, decimals: number = 0, abbreviate: boolean = false, showZero: boole
ui/litellm-dashboard/src/utils/dataUtils.ts:15
↓ 45 callers
Method
is_empty
(&self)
litellm-rust/crates/ai-gateway/src/integrations/custom_logger/mod.rs:46
↓ 45 callers
Function
new_team
Allow users to create a new team. Apply user permissions to their team. 👉 [Detailed Doc on setting team budgets](https://docs.litellm.ai/doc
litellm/proxy/management_endpoints/team_endpoints.py:902
↓ 45 callers
Method
update
Update an existing record.
litellm/repositories/base_repository.py:96
↓ 44 callers
Function
M
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.js:1
↓ 44 callers
Function
_resp
(body: dict, status_code: int = 200)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_vigil_guard.py:30
↓ 44 callers
Function
cost_per_token
Calculates the cost per token for a given model, prompt tokens, and completion tokens. Parameters: model (str): The name of the mode
litellm/cost_calculator.py:292
↓ 44 callers
Method
count
(self, where: Optional[Dict[str, Any]] = None)
tests/test_litellm/repositories/test_repositories.py:112
↓ 44 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:39
↓ 44 callers
Function
get_litellm_params
( api_key: Optional[str] = None, force_timeout=600, azure=False, logger_fn=None, verbose=F
litellm/litellm_core_utils/get_litellm_params.py:58
↓ 44 callers
Method
removeObserver
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 44 callers
Function
stream_chunk_builder
( chunks: list, messages: Optional[list] = None, start_time=None, end_time=None, logging_o
litellm/main.py:8317
↓ 44 callers
Method
transform_embedding_request
( self, model: str, input: AllEmbeddingInputValues, optional_params: dict,
litellm/llms/oci/embed/transformation.py:175
↓ 44 callers
Method
values
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 43 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:1249
↓ 43 callers
Function
init_guardrails_v2
( all_guardrails: List[Dict], config_file_path: Optional[str] = None, llm_router: Optional[Router]
litellm/proxy/guardrails/init_guardrails.py:19
← previous
next →
201–300 of 68,180, ranked by callers