* perf(router): add model_name index for O(1) deployment lookups Add model_name_to_deployment_indices mapping to optimize _get_all_deployments() from O(n) to O(1) + O(k) lookups. - Add model_name_to_deployment_indices: Dict[str, List[int]] - Add _build_model_name_index() to build/maintain the index - Update _add_model_to_list_and_index_map() to maintain both indices - Refactor to use idx = len(self.model_list) before append (cleaner) - Optimize _get_all_deployments() to use index instead of linear scan * test(router): add test coverage for _build_model_name_index Add single comprehensive test for _build_model_name_index() function to fix code coverage CI failure. The test verifies: - Index correctly maps model_name to deployment indices - Handles multiple deployments per model_name - Clears and rebuilds index correctly Fixes: CI code coverage error for _build_model_name_index |
||
|---|---|---|
| .. | ||
| anthropic_interface | ||
| assistants | ||
| batch_completion | ||
| batches | ||
| caching | ||
| completion_extras | ||
| endpoints/speech/speech_to_completion_bridge | ||
| experimental_mcp_client | ||
| files | ||
| fine_tuning | ||
| google_genai | ||
| images | ||
| integrations | ||
| litellm_core_utils | ||
| llms | ||
| passthrough | ||
| proxy | ||
| realtime_api | ||
| rerank_api | ||
| responses | ||
| router_strategy | ||
| router_utils | ||
| secret_managers | ||
| types | ||
| vector_stores | ||
| __init__.py | ||
| _logging.py | ||
| _redis.py | ||
| _service_logger.py | ||
| _uuid.py | ||
| _version.py | ||
| budget_manager.py | ||
| constants.py | ||
| cost_calculator.py | ||
| cost.json | ||
| exceptions.py | ||
| main.py | ||
| model_prices_and_context_window_backup.json | ||
| mypy.ini | ||
| py.typed | ||
| router.py | ||
| scheduler.py | ||
| timeout.py | ||
| utils.py | ||