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 <yuneng-jiang@users.noreply.github.com>
This commit is contained in:
parent
5d7bfe6260
commit
aacc7b18f8
@ -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": {
|
||||
|
||||
@ -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="")
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user