MCPcopy Create free account

hub / github.com/BerriAI/litellm / functions

Functions68,180 in github.com/BerriAI/litellm

↓ 66 callersFunction_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 callersFunction_user
(user_id: str = "user-1", team_id: str = "team-1")
tests/pass_through_unit_tests/test_passthrough_managed_ids.py:59
↓ 66 callersMethodlist
List all API keys with optional filtering and pagination. Args: page (Optional[int]): Page number for pagination
litellm/proxy/client/keys.py:34
↓ 65 callersFunctiona
(_)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 65 callersMethodaembedding
( self, model: str, input: list, model_response: EmbeddingResponse, pr
tests/local_testing/test_custom_llm.py:293
↓ 64 callersFunction_
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.js:1
↓ 64 callersFunctionhandle_exception_on_proxy
Returns an Exception as ProxyException, this ensures all exceptions are OpenAI API compatible
litellm/proxy/utils.py:5707
↓ 64 callersMethodpost_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 callersMethodexit
()
litellm/proxy/_experimental/out/_next/static/chunks/0ivj_wax-joap.js:1
↓ 63 callersFunctionid
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 62 callersMethodcreate
Create a new record.
litellm/repositories/base_repository.py:89
↓ 62 callersFunctionrs
()
litellm/proxy/_experimental/out/_next/static/chunks/03~yq9q893hmn.js:1
↓ 62 callersMethodsend
(e,t,s)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:30
↓ 61 callersMethodchunk_parser
(self, chunk: dict)
litellm/llms/cohere/common_utils.py:126
↓ 61 callersMethodclone
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 61 callersFunctionderiveErrorMessage
(errorData: any)
ui/litellm-dashboard/src/lib/http/client.ts:47
↓ 61 callersMethodmodel_validate
(cls, value)
tests/llm_responses_api_testing/test_responses_hooks.py:702
↓ 61 callersFunctionprint_verbose
(print_statement)
litellm/_logging.py:413
↓ 60 callersFunction_make_guardrail
(api_key: str = "hs-cato-key", **extra)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_cato_networks.py:350
↓ 60 callersMethodquery_raw
(self, query: str, *args)
tests/proxy_unit_tests/test_proxy_utils.py:1574
↓ 60 callersMethodset
(self, name, value, *, nx=False, px=None)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_redis_distributed_lock.py:26
↓ 60 callersFunctionu
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 60 callersFunctionu
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 59 callersMethodsubmit
(self, fn, *args, **kwargs)
tests/test_litellm/passthrough/test_streaming_interrupt_spend_tracking.py:33
↓ 59 callersFunctionu
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0pwkd9r.mc_ee.js:1
↓ 59 callersMethodwalk
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 58 callersFunction_get_encoding
Get encoding, loading it lazily if needed.
litellm/main.py:8706
↓ 58 callersMethodlist
(e={},t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:7
↓ 58 callersMethodrun
()
tests/llm_translation/test_llm_response_utils/test_convert_dict_to_chat_completion.py:1934
↓ 58 callersMethodstart
Start the logging worker. Idempotent - safe to call multiple times.
litellm/litellm_core_utils/logging_worker.py:83
↓ 58 callersFunctiont8
(e,t,s,r)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:4
↓ 57 callersFunctionC
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0rdv7_7_95b-1.js:1
↓ 57 callersFunctionS
(e)
litellm/proxy/_experimental/out/_next/static/chunks/15hm8gokjq2uu.js:1
↓ 57 callersFunction_make_signer
(**kwargs: Any)
tests/test_litellm/proxy/guardrails/test_mcp_jwt_signer.py:55
↓ 57 callersMethodfind_first
(self, where)
tests/test_litellm/test_router_retry_policy_update.py:220
↓ 56 callersMethodextend
(self, key, token, ttl_seconds)
tests/test_litellm/proxy/_experimental/mcp_server/outbound_credentials/test_redis_refresh_coordinator.py:34
↓ 56 callersMethodreset
(self)
litellm/router.py:11060
↓ 55 callersFunction_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 callersMethodasync_set_cache
(self, key, value, local_only: bool = False, **kwargs)
litellm/proxy/common_utils/user_api_key_cache.py:137
↓ 55 callersMethodupdate_environment
( self, prisma_client: Optional[PrismaClient], user_api_key_cache: UserApiKeyCache,
litellm/proxy/auth/handle_jwt.py:125
↓ 54 callersFunctionexception_type
Maps an LLM Provider Exception to OpenAI Exception Format
litellm/litellm_core_utils/exception_mapping_utils.py:2150
↓ 54 callersMethodsetMetaProperty
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 53 callersMethodclose
(self)
litellm/proxy/auth/handle_jwt.py:1037
↓ 53 callersMethodcopy
()
litellm/proxy/_experimental/out/_next/static/chunks/101az3fsw7lje.js:1
↓ 53 callersFunctiongenerate_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 callersMethodget_model_list
Includes router model_group_alias'es as well if team_id specified, returns matching team-specific models
litellm/router.py:9417
↓ 52 callersFunctionO
litellm/proxy/_experimental/out/_next/static/chunks/0pwkd9r.mc_ee.js:1
↓ 52 callersFunction_make_response
(body: dict, status_code: int = 200)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_xecguard.py:56
↓ 52 callersFunctionfc
(e)
litellm/proxy/_experimental/out/_next/static/chunks/04jvxoid~vpxj.js:1
↓ 52 callersFunctiongeneric_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 callersFunctionmake_user_api_key_auth
()
tests/test_litellm/proxy/utils/proxy_logging/conftest.py:82
↓ 51 callersFunctionq
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0c4pfjjue0uc-.js:1
↓ 51 callersMethodupdate
(self, where=None, data=None)
tests/litellm_utils_tests/test_proxy_budget_reset.py:63
↓ 50 callersFunction_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 callersFunctionadd_guardrail_to_applied_guardrails_header
(request_data: Dict, guardrail_name: Optional[str])
litellm/proxy/common_utils/callback_utils.py:495
↓ 50 callersMethodadd_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 callersMethodflush_cache
(self)
litellm/router.py:11056
↓ 50 callersFunctiongetGlobalLitellmHeaderName
()
ui/litellm-dashboard/src/components/networking.tsx:361
↓ 50 callersMethodmodel_dump
(self, **_kwargs)
tests/test_litellm/proxy/utils/helpers/test_model_access.py:279
↓ 49 callersFunctionE
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/0rdv7_7_95b-1.js:1
↓ 49 callersMethodasync_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 callersMethodcreate
(e,t)
litellm/proxy/_experimental/out/_next/static/chunks/16.oisvgwzo8s.js:7
↓ 49 callersFunctionget_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 callersMethodremove
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 49 callersFunctionserializers_value
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 48 callersFunctionI
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.js:1
↓ 48 callersFunction_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 callersFunctioncommon_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 callersFunctioncreate_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 callersMethodget_custom_headers
( *, user_api_key_dict: UserAPIKeyAuth, call_id: Optional[str] = None, model_i
litellm/proxy/common_request_processing.py:789
↓ 48 callersMethodhasListeners
()
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 48 callersFunctionload_vertex_ai_credentials
()
tests/local_testing/test_amazing_vertex_completion.py:106
↓ 48 callersMethodselect
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 callersMethodsetState
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 48 callersMethodshould_run_guardrail
Override to add debug logging.
litellm/proxy/guardrails/guardrail_hooks/grayswan/grayswan.py:138
↓ 47 callersFunctionL
litellm/proxy/_experimental/out/_next/static/chunks/01_xjyxcb1uco.js:1
↓ 47 callersFunctionembedding
( model, input=[], # Optional params dimensions: Optional[int] = None, encoding_format: Op
litellm/main.py:5747
↓ 46 callersMethod_ensure_access_token
Returns auth token and project id
litellm/llms/vertex_ai/vertex_llm_base.py:570
↓ 46 callersFunctionp
(s)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 46 callersMethodr
()
litellm/proxy/_experimental/out/_next/static/chunks/02813b2b-kz98.js:8
↓ 45 callersFunctionB
litellm/proxy/_experimental/out/_next/static/chunks/0~0su3wi_7f6-.js:1
↓ 45 callersFunction_get_parent_otel_span_from_kwargs
( kwargs: Optional[dict] = None, )
litellm/litellm_core_utils/core_helpers.py:209
↓ 45 callersFunction_prisma_client
Return a MagicMock prisma_client with async db methods.
tests/pass_through_unit_tests/test_passthrough_managed_ids.py:68
↓ 45 callersMethodflatMap
(s,o)
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 45 callersFunctionformatNumberWithCommas
( value: number | null | undefined, decimals: number = 0, abbreviate: boolean = false, showZero: boole
ui/litellm-dashboard/src/utils/dataUtils.ts:15
↓ 45 callersMethodis_empty
(&self)
litellm-rust/crates/ai-gateway/src/integrations/custom_logger/mod.rs:46
↓ 45 callersFunctionnew_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 callersMethodupdate
Update an existing record.
litellm/repositories/base_repository.py:96
↓ 44 callersFunctionM
(e,r)
litellm/proxy/_experimental/out/_next/static/chunks/0~-ovi6c4wjt1.js:1
↓ 44 callersFunction_resp
(body: dict, status_code: int = 200)
tests/test_litellm/proxy/guardrails/guardrail_hooks/test_vigil_guard.py:30
↓ 44 callersFunctioncost_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 callersMethodcount
(self, where: Optional[Dict[str, Any]] = None)
tests/test_litellm/repositories/test_repositories.py:112
↓ 44 callersFunctiondecrypt_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 callersFunctionget_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 callersMethodremoveObserver
(e)
litellm/proxy/_experimental/out/_next/static/chunks/0.4.bbjx7y007.js:143
↓ 44 callersFunctionstream_chunk_builder
( chunks: list, messages: Optional[list] = None, start_time=None, end_time=None, logging_o
litellm/main.py:8317
↓ 44 callersMethodtransform_embedding_request
( self, model: str, input: AllEmbeddingInputValues, optional_params: dict,
litellm/llms/oci/embed/transformation.py:175
↓ 44 callersMethodvalues
()
litellm/proxy/swagger/swagger-ui-bundle.js:2
↓ 43 callersMethodget_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 callersFunctioninit_guardrails_v2
( all_guardrails: List[Dict], config_file_path: Optional[str] = None, llm_router: Optional[Router]
litellm/proxy/guardrails/init_guardrails.py:19
← previousnext →201–300 of 68,180, ranked by callers