mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-29 01:42:19 +00:00
* feat(logger): add shared Rust diagnostics and Python logging bridge * feat(logger): dispatch diagnostic processing through Rust * chore: regenerate Cargo.lock after rebase Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: allowlist bounded logging tree walkers in recursive detector Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * perf(logger): skip decoding plain access arguments * test(logger): skip embedded-python logger test when litellm deps are absent Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * style: cargo fmt Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * test: expect NativeDiagnosticProcessor in the native public surface Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(stub): export NativeDiagnosticProcessor via __new__ in _native.pyi Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(tracing): rename logger crate and document host sink contract * test(logger): cover exc, stack, and nested extras in the diagnostic filter Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(logger): keep rendered redacted line when template scan flags a key pattern The blanket REDACTED for a changed msg/color template discarded lines whose rendered form was already redacted by the same pipeline, e.g. 'password=%s' became 'REDACTED' instead of 'password=REDACTED'. Only fall back to REDACTED when the rendered form did not change either, which is where interpolation can mangle the key pattern the scrub would otherwise see. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * ci(rust): install python deps so the logger bridge test runs The end-to-end bridge test skipped silently when litellm's Python deps were absent. uv sync --no-install-project installs them without a maturin build, and PYTHONPATH makes them visible to the embedded interpreter Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| audio_utils | ||
| llm_cost_calc | ||
| llm_response_utils | ||
| prompt_templates | ||
| specialty_caches | ||
| tokenizers | ||
| agentic_followup_kwargs.py | ||
| agentic_loop_settings.py | ||
| api_route_to_call_types.py | ||
| app_crypto.py | ||
| asyncify.py | ||
| aws_partition.py | ||
| bug_report.py | ||
| cached_imports.py | ||
| chat_completion_agentic_loop.py | ||
| classifier_logging.py | ||
| cli_keyring.py | ||
| cli_token_utils.py | ||
| cloud_storage_security.py | ||
| completion_timeout.py | ||
| core_helpers.py | ||
| coroutine_checker.py | ||
| credential_accessor.py | ||
| custom_logger_registry.py | ||
| dd_tracing.py | ||
| default_encoding.py | ||
| dot_notation_indexing.py | ||
| duration_parser.py | ||
| env_utils.py | ||
| error_normalization.py | ||
| exception_mapping_utils.py | ||
| fallback_generalizations.py | ||
| fallback_utils.py | ||
| get_blog_posts.py | ||
| get_litellm_params.py | ||
| get_llm_provider_logic.py | ||
| get_model_cost_map.py | ||
| get_provider_specific_headers.py | ||
| get_supported_openai_params.py | ||
| health_check_helpers.py | ||
| health_check_utils.py | ||
| initialize_dynamic_callback_params.py | ||
| internal_call_metadata.py | ||
| json_fragment_accumulator.py | ||
| json_validation_rule.py | ||
| litellm_logging.py | ||
| llm_judge.py | ||
| llm_request_utils.py | ||
| logging_callback_manager.py | ||
| logging_utils.py | ||
| logging_worker.py | ||
| mock_functions.py | ||
| model_param_helper.py | ||
| model_response_utils.py | ||
| private_json.py | ||
| provider_affinity.py | ||
| ptu_pricing.py | ||
| README.md | ||
| realtime_errors.py | ||
| realtime_streaming.py | ||
| reasoning_effort_utils.py | ||
| redact_messages.py | ||
| request_timeout_resolver.py | ||
| response_header_helpers.py | ||
| rules.py | ||
| safe_json_dumps.py | ||
| safe_json_loads.py | ||
| secret_redaction.py | ||
| sensitive_data_masker.py | ||
| served_output_texts.py | ||
| service_tier_utils.py | ||
| streaming_chunk_builder_utils.py | ||
| streaming_handler.py | ||
| thread_pool_executor.py | ||
| token_counter.py | ||
| tokenizer.py | ||
| url_utils.py | ||
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 utilscore_helpers.py: code used intypes/- 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 Python tokenizer and bundled cacheget_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])
Tokenizer factories return Python tokenizer objects by default. Set LITELLM_RUST=1 or call litellm.rust(True) before constructing tokenizers to select the Rust backend through Route.TOKENIZER in the Rust catalog. Missing native bindings or unsupported native features fall back to Python. Existing tokenizer objects keep their selected backend. Rust-backed tokenizer objects carry the read-only tiktoken.Encoding / tokenizers.Tokenizer surface and are immutable: enable_padding, enable_truncation and add_tokens stay on the Python tokenizer.