mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
Fixes bare 'import orjson' in three hot-path modules that broke non-proxy users (orjson is an optional dependency). Each module now uses try/except with a stdlib json fallback: - litellm/llms/openai_like/chat/handler.py - litellm/llms/openai_like/chat/transformation.py - litellm/llms/custom_httpx/llm_http_handler.py Adds comprehensive benchmarking tools inspired by neul-labs/fast-litellm: - benchmark_perf_integration.py: micro-benchmarks for each optimized hot path (JSON serialization, URL parsing, deployment lookup, spend-log sanitization, Prometheus label caching, routing, etc.) - benchmark_sdk_hotpath.py: end-to-end SDK throughput measurement against a local mock server - loadtest_config_nodb.yaml: proxy config without database dependency Measured speedups (per-component, micro-benchmark): JSON serialization: 13.7x (orjson vs stdlib json) JSON deserialization: 3.7x httpx URL parsing: 202.2x (LRU-cached vs raw parse) Deployment lookup: 10.6x (O(1) index vs O(n) scan) Prometheus labels: 30.5x (cached model_dump) Simple shuffle: 5.8x (lazy logging) safe_json_dumps: 5.7x (orjson final step) Overall cumulative: 18.7x Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com> |
||
|---|---|---|
| .. | ||
| benchmark_perf_integration.py | ||
| benchmark_sdk_hotpath.py | ||
| compare_perf_results.py | ||
| compare_results.py | ||
| loadtest_config.yaml | ||
| loadtest_config_nodb.yaml | ||
| loadtest_config_perf.yaml | ||
| loadtest_config_sidecar.yaml | ||
| locustfile.py | ||
| locustfile_perf.py | ||
| memory_leak_utils.py | ||
| mock_openai_server.py | ||
| run_loadtest.sh | ||
| run_perf_comparison.sh | ||
| test_datadog_load_test.py | ||
| test_langsmith_load_test.py | ||
| test_linear_memory_growth.py | ||
| test_memory_usage.py | ||
| test_otel_load_test.py | ||
| test_vertex_embeddings_load_test.py | ||
| test_vertex_load_tests.py | ||
| vertex_key.json | ||