litellm/litellm/litellm_core_utils
Ryan Crabbe 75bc8329e2 Merge origin/main into litellm_perf_skip_usage_roundtrip
Resolve conflict in litellm_logging.py: take main's version and
re-apply get_usage_as_dict optimization on top.
2026-02-21 12:55:55 -08:00
..
audio_utils
llm_cost_calc Merge pull request #20541 from ryan-crabbe/perf/cost-calculator-optimizations 2026-02-21 12:18:38 -08:00
llm_response_utils fix: reduce proxy overhead for large base64 payloads (#21594) 2026-02-19 12:10:52 -08:00
prompt_templates Fix mypy issues 2026-02-18 18:34:04 +05:30
specialty_caches
tokenizers
api_route_to_call_types.py Agent Guardrails - on streaming output (#21206) 2026-02-14 11:36:52 -08:00
app_crypto.py
asyncify.py
cached_imports.py
cli_token_utils.py
core_helpers.py Add compaction type block in the output 2026-02-06 11:31:35 +05:30
coroutine_checker.py
credential_accessor.py
custom_logger_registry.py feat: add support focus export 2026-01-08 16:48:06 +09:00
dd_tracing.py
default_encoding.py fix: resolve Read-only file system error in non-root images (#19449) 2026-01-20 19:00:52 -08:00
dot_notation_indexing.py Add Kubernetes ServiceAccount JWT authentication support (#18055) 2026-01-02 14:02:31 +05:30
duration_parser.py
env_utils.py fix(callbacks): allow MAX_CALLBACKS override via env var (#20781) 2026-02-09 12:11:32 -08:00
exception_mapping_utils.py fix openai tests 2026-02-12 17:53:47 -08:00
fallback_utils.py
get_litellm_params.py perf: Optimize get_litellm_params with sparse kwargs extraction (#19884) 2026-02-07 10:38:43 -08:00
get_llm_provider_logic.py Fix MCP streaming test skip logic and metadata None check (#20428) 2026-02-12 19:39:05 +05:30
get_model_cost_map.py [Stability] Investigate + fix issue where model cost map became poorly formatted (#20895) 2026-02-10 15:17:01 -08:00
get_provider_specific_headers.py
get_supported_openai_params.py
health_check_helpers.py
health_check_utils.py
initialize_dynamic_callback_params.py Fix test_global_redaction_off_with_dynamic_params 2026-02-05 18:26:03 +05:30
json_validation_rule.py
litellm_logging.py Merge origin/main into litellm_perf_skip_usage_roundtrip 2026-02-21 12:55:55 -08:00
llm_request_utils.py
logging_callback_manager.py Merge origin/main into perf/callback-registration-routing 2026-02-21 12:40:23 -08:00
logging_utils.py fix(types): resolve MyPy assignment type errors in logging_utils and vertex transformation 2026-02-20 13:46:51 -03:00
logging_worker.py [Release Day] - Fixed CI/CD issues & changed processes (#19902) 2026-01-28 17:57:24 -08:00
mock_functions.py
model_param_helper.py perf: cache _get_relevant_args_to_use_for_logging() at module level (#20077) 2026-02-02 10:54:49 -08:00
model_response_utils.py
README.md
realtime_streaming.py
redact_messages.py fix: complete asyncio.iscoroutinefunction deprecation fix across codebase 2026-02-17 18:20:44 -03:00
response_header_helpers.py
rules.py
safe_json_dumps.py fix: shared health check serialization (#21119) 2026-02-13 09:15:43 -08:00
safe_json_loads.py
sensitive_data_masker.py fix: don't mask cost_per_token fields in SensitiveDataMasker 2026-02-20 18:13:27 -08:00
streaming_chunk_builder_utils.py fix(responses): eliminate per-chunk thread spawning in async streaming path (#21709) 2026-02-20 16:26:23 -08:00
streaming_handler.py Merge origin/main into litellm_fix_streaming_connection_pool_leak 2026-02-21 12:44:50 -08:00
thread_pool_executor.py
token_counter.py fix(mypy): resolve missing return statements and type casting issues (#20618) 2026-02-06 17:49:35 -08:00

Folder Contents

This folder contains general-purpose utilities that are used in multiple places in the codebase.

Core files:

  • streaming_handler.py: The core streaming logic + streaming related helper utils
  • core_helpers.py: code used in types/ - e.g. map_finish_reason.
  • exception_mapping_utils.py: utils for mapping exceptions to openai-compatible error types.
  • default_encoding.py: code for loading the default encoding (tiktoken)
  • get_llm_provider_logic.py: code for inferring the LLM provider from a given model name.
  • duration_parser.py: code for parsing durations - e.g. "1d", "1mo", "10s"
  • api_route_to_call_types.py: mapping of API routes to their corresponding CallTypes (e.g., /chat/completions -> [acompletion, completion])