From aacc7b18f865e80722f0eb3c8c06f3e83ddf34c3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 12 Mar 2026 03:11:29 +0000 Subject: [PATCH] fix(ci): add missing provider docs, fix deprecated model refs in cost tests - Add black_forest_labs and charity_engine to provider_endpoints_support.json (fixes check_code_and_doc_quality job) - Replace o1-mini with o1 in test_reasoning_tokens_no_price_set (model removed from cost map) - Replace gemini-2.5-pro-exp-03-25 with gemini-2.5-pro in test_generic_cost_per_token_above_200k_tokens (model removed from cost map) - Fix test_get_cost_for_anthropic_web_search to use claude-3-7-sonnet-20250219 with custom_llm_provider='anthropic' so web search cost is computed correctly Co-authored-by: yuneng-jiang --- provider_endpoints_support.json | 33 +++++++++++++++++++ .../llm_cost_calc/test_llm_cost_calc_utils.py | 7 ++-- .../test_tool_call_cost_tracking.py | 7 ++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/provider_endpoints_support.json b/provider_endpoints_support.json index b1d4d5a116..64942636a9 100644 --- a/provider_endpoints_support.json +++ b/provider_endpoints_support.json @@ -2518,6 +2518,39 @@ "search": true, "a2a": false } + }, + "black_forest_labs": { + "display_name": "Black Forest Labs (`black_forest_labs`)", + "url": "https://docs.litellm.ai/docs/providers/black_forest_labs", + "endpoints": { + "chat_completions": false, + "messages": false, + "responses": false, + "embeddings": false, + "image_generations": true, + "image_edits": true, + "audio_transcriptions": false, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false + } + }, + "charity_engine": { + "display_name": "Charity Engine (`charity_engine`)", + "url": "https://docs.litellm.ai/docs/providers/charity_engine", + "endpoints": { + "chat_completions": true, + "messages": true, + "responses": true, + "embeddings": false, + "image_generations": false, + "audio_transcriptions": false, + "audio_speech": false, + "moderations": false, + "batches": false, + "rerank": false + } } }, "endpoints": { diff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py index 00c751c6fd..e907e92e66 100644 --- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py +++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_llm_cost_calc_utils.py @@ -42,7 +42,9 @@ from litellm.types.utils import CacheCreationTokenDetails, Usage def test_reasoning_tokens_no_price_set(): - model = "o1-mini" + # Use o1 - o1-mini was deprecated/renamed; o1 has same reasoning-token semantics + # (no separate output_cost_per_reasoning_token, so all completion tokens use output_cost_per_token) + model = "o1" custom_llm_provider = "openai" os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" litellm.model_cost = litellm.get_model_cost_map(url="") @@ -266,7 +268,8 @@ def test_image_tokens_fallback_to_base_cost(): def test_generic_cost_per_token_above_200k_tokens(): - model = "gemini-2.5-pro-exp-03-25" + # gemini-2.5-pro-exp-03-25 was removed; gemini-2.5-pro has same above-200k pricing + model = "gemini-2.5-pro" custom_llm_provider = "vertex_ai" os.environ["LITELLM_LOCAL_MODEL_COST_MAP"] = "True" litellm.model_cost = litellm.get_model_cost_map(url="") diff --git a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py index 9eb8ae542e..a3bd0274dd 100644 --- a/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py +++ b/tests/test_litellm/litellm_core_utils/llm_cost_calc/test_tool_call_cost_tracking.py @@ -121,17 +121,20 @@ def test_get_cost_for_built_in_tools_file_search(): def test_get_cost_for_anthropic_web_search(): """ - Test that the cost for a web search is 0.00 when no response object is provided + Test that Anthropic web search cost is tracked when usage.server_tool_use.web_search_requests + is set. Use claude-3-7-sonnet-20250219 (has search_context_cost_per_query) and + custom_llm_provider=anthropic so get_cost_for_anthropic_web_search is invoked. """ from litellm.types.utils import ServerToolUse, Usage - model = "claude-3-7-sonnet-latest" + model = "claude-3-7-sonnet-20250219" usage = Usage(server_tool_use=ServerToolUse(web_search_requests=1)) cost = StandardBuiltInToolCostTracking.get_cost_for_built_in_tools( model=model, usage=usage, response_object=None, standard_built_in_tools_params=None, + custom_llm_provider="anthropic", ) assert cost > 0.0