mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-08 22:21:35 +00:00
Merge pull request #23425 from BerriAI/cursor/litellm-ci-stability-4513
[Infra] CI/CD Fixes
This commit is contained in:
commit
626d120873
5 changed files with 52 additions and 9 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -970,12 +970,12 @@ def test_cost_discount_vertex_ai():
|
|||
# Save original config
|
||||
original_discount_config = litellm.cost_discount_config.copy()
|
||||
|
||||
# Create mock response
|
||||
# Create mock response (use a model that exists in model_prices_and_context_window.json)
|
||||
response = ModelResponse(
|
||||
id="test-id",
|
||||
choices=[],
|
||||
created=1234567890,
|
||||
model="gemini-pro",
|
||||
model="gemini-3-pro-preview",
|
||||
object="chat.completion",
|
||||
usage=Usage(prompt_tokens=100, completion_tokens=50, total_tokens=150),
|
||||
)
|
||||
|
|
@ -984,7 +984,7 @@ def test_cost_discount_vertex_ai():
|
|||
litellm.cost_discount_config = {}
|
||||
cost_without_discount = completion_cost(
|
||||
completion_response=response,
|
||||
model="vertex_ai/gemini-pro",
|
||||
model="vertex_ai/gemini-3-pro-preview",
|
||||
custom_llm_provider="vertex_ai",
|
||||
)
|
||||
|
||||
|
|
@ -994,7 +994,7 @@ def test_cost_discount_vertex_ai():
|
|||
# Calculate cost with discount
|
||||
cost_with_discount = completion_cost(
|
||||
completion_response=response,
|
||||
model="vertex_ai/gemini-pro",
|
||||
model="vertex_ai/gemini-3-pro-preview",
|
||||
custom_llm_provider="vertex_ai",
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ def test_supports_function_calling_github_openai_alias():
|
|||
def test_supports_function_calling_github_anthropic_alias():
|
||||
assert (
|
||||
litellm.utils.supports_function_calling(
|
||||
model="github/claude-3-5-sonnet-latest"
|
||||
model="github/claude-3-7-sonnet-20250219"
|
||||
)
|
||||
is True
|
||||
)
|
||||
|
|
@ -622,6 +622,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
|
|||
"input_cost_per_image_above_128k_tokens": {"type": "number"},
|
||||
"input_cost_per_image_token": {"type": "number"},
|
||||
"input_cost_per_token_above_200k_tokens": {"type": "number"},
|
||||
"input_cost_per_token_above_256k_tokens": {"type": "number"},
|
||||
"input_cost_per_token_above_272k_tokens": {"type": "number"},
|
||||
"cache_read_input_token_cost_flex": {"type": "number"},
|
||||
"cache_read_input_token_cost_priority": {"type": "number"},
|
||||
|
|
@ -703,6 +704,7 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
|
|||
"output_cost_per_token": {"type": "number"},
|
||||
"output_cost_per_token_above_128k_tokens": {"type": "number"},
|
||||
"output_cost_per_token_above_200k_tokens": {"type": "number"},
|
||||
"output_cost_per_token_above_256k_tokens": {"type": "number"},
|
||||
"output_cost_per_token_above_272k_tokens": {"type": "number"},
|
||||
"output_cost_per_image_above_1024_and_1024_pixels": {"type": "number"},
|
||||
"output_cost_per_image_above_1024_and_1024_pixels_and_premium_image": {
|
||||
|
|
@ -741,6 +743,8 @@ def test_aaamodel_prices_and_context_window_json_is_valid():
|
|||
"supports_vision": {"type": "boolean"},
|
||||
"supports_web_search": {"type": "boolean"},
|
||||
"supports_url_context": {"type": "boolean"},
|
||||
"supports_multimodal": {"type": "boolean"},
|
||||
"uses_embed_content": {"type": "boolean"},
|
||||
"supports_reasoning": {"type": "boolean"},
|
||||
"supports_none_reasoning_effort": {"type": "boolean"},
|
||||
"supports_xhigh_reasoning_effort": {"type": "boolean"},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue