mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-09 22:31:41 +00:00
test: collapse blank lines left by removed tests
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
ac573fd66e
commit
5cfe20a68d
44 changed files with 0 additions and 236 deletions
|
|
@ -40,7 +40,6 @@ class TestBedrockGovCloudSupport:
|
|||
assert "us-gov-east-1" in all_regions
|
||||
assert "us-gov-west-1" in all_regions
|
||||
|
||||
|
||||
def test_govcloud_model_routing(self):
|
||||
"""Test that GovCloud models are routed correctly"""
|
||||
# Test Claude model routing
|
||||
|
|
@ -117,8 +116,6 @@ class TestBedrockGovCloudSupport:
|
|||
assert not any("us-gov-east-1" in model for model in litellm.bedrock_models)
|
||||
assert not any("us-gov-west-1" in model for model in litellm.bedrock_models)
|
||||
|
||||
|
||||
|
||||
@patch("litellm.completion")
|
||||
def test_govcloud_completion_cost_calculation(self, mock_completion):
|
||||
"""Test that completion requests use correct pricing for GovCloud models"""
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
|
||||
|
||||
import litellm
|
||||
from litellm import get_llm_provider
|
||||
|
||||
|
|
@ -65,8 +64,6 @@ def test_hyperbolic_in_provider_lists():
|
|||
assert "https://api.hyperbolic.xyz/v1" in openai_compatible_endpoints
|
||||
|
||||
|
||||
|
||||
|
||||
def test_hyperbolic_supported_params():
|
||||
"""Test that supported OpenAI parameters are correctly configured"""
|
||||
from litellm.llms.hyperbolic.chat.transformation import HyperbolicChatConfig
|
||||
|
|
|
|||
|
|
@ -102,8 +102,6 @@ async def test_lambda_ai_completion_call():
|
|||
raise
|
||||
|
||||
|
||||
|
||||
|
||||
def test_lambda_ai_model_list_populated():
|
||||
"""Test that lambda_ai_models list is populated correctly"""
|
||||
# Ensure we're using local model cost map and repopulate models
|
||||
|
|
|
|||
|
|
@ -68,8 +68,6 @@ def test_morph_in_provider_lists():
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_morph_supported_params():
|
||||
"""Test that MorphChatConfig returns correct supported parameters."""
|
||||
config = MorphChatConfig()
|
||||
|
|
|
|||
|
|
@ -2,7 +2,6 @@ import os
|
|||
from unittest.mock import patch
|
||||
|
||||
|
||||
|
||||
import pytest
|
||||
|
||||
import litellm
|
||||
|
|
@ -182,8 +181,6 @@ class TestOpenAIO3(BaseOSeriesModelsTest, BaseLLMChatTest):
|
|||
pass
|
||||
|
||||
|
||||
|
||||
|
||||
def test_o3_reasoning_effort():
|
||||
resp = litellm.completion(
|
||||
model="o3-mini",
|
||||
|
|
|
|||
|
|
@ -47,14 +47,6 @@ def test_get_model_info_custom_llm_with_same_name_vllm(monkeypatch):
|
|||
assert model_info["input_cost_per_token"] == 0.0
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_get_model_info_gemini_pro():
|
||||
info = litellm.get_model_info("gemini-2.0-flash")
|
||||
print("info", info)
|
||||
|
|
|
|||
|
|
@ -45,8 +45,6 @@ def test_xai_openai_compatible_provider_info():
|
|||
assert dynamic_api_key == "api-key"
|
||||
|
||||
|
||||
|
||||
|
||||
def test_xai_validate_environment_reads_api_key(monkeypatch):
|
||||
monkeypatch.setenv("XAI_API_KEY", "api-key")
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ class TestAzureMAIImageGeneration:
|
|||
assert not AzureFoundryMAIImageGenerationConfig.is_mai_model("flux.2-pro")
|
||||
assert not AzureFoundryMAIImageGenerationConfig.is_mai_model("MAI-DS-R1")
|
||||
|
||||
|
||||
def test_get_mai_image_generation_url(self):
|
||||
url = AzureFoundryMAIImageGenerationConfig.get_mai_image_generation_url(
|
||||
api_base="https://my-resource.services.ai.azure.com",
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ from importlib.resources import files
|
|||
import pytest
|
||||
|
||||
|
||||
|
||||
@pytest.fixture(scope="module")
|
||||
def use_local_model_cost_map():
|
||||
monkeypatch = pytest.MonkeyPatch()
|
||||
|
|
@ -39,8 +38,6 @@ def use_local_model_cost_map():
|
|||
monkeypatch.undo()
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_name,expected_prompt,expected_completion",
|
||||
[
|
||||
|
|
@ -72,8 +69,6 @@ def test_azure_ai_fw_cost_per_token(
|
|||
assert completion_cost == pytest.approx(expected_completion)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_azure_ai_fw_nemotron_lightning_supports_tool_choice(use_local_model_cost_map):
|
||||
from litellm.llms.azure_ai.chat.transformation import AzureAIStudioConfig
|
||||
|
||||
|
|
|
|||
|
|
@ -33,10 +33,6 @@ def use_local_model_cost_map():
|
|||
monkeypatch.undo()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_azure_ai_kimi_k26_cost_per_token(use_local_model_cost_map):
|
||||
from litellm.llms.azure_ai.cost_calculator import cost_per_token
|
||||
from litellm.types.utils import Usage
|
||||
|
|
|
|||
|
|
@ -99,8 +99,6 @@ GPT_5_6_PROFILES = [
|
|||
]
|
||||
|
||||
|
||||
|
||||
|
||||
def _bedrock_response(model, usage):
|
||||
return ModelResponse(
|
||||
id="test",
|
||||
|
|
@ -118,8 +116,6 @@ def _bedrock_response(model, usage):
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_proxy_cost_calculation_scenario():
|
||||
"""Test exact GitHub issue scenario: proxy cost calculation"""
|
||||
model = "litellm_proxy/bedrock/us.anthropic.claude-3-5-haiku-20241022-v1:0"
|
||||
|
|
@ -159,8 +155,6 @@ def test_bedrock_gpt_5_6_profiles_route_to_converse(profile, local_model_cost_ma
|
|||
assert BedrockModelInfo.get_bedrock_route(f"bedrock/{profile.model_id}") == "converse"
|
||||
|
||||
|
||||
|
||||
|
||||
def test_bedrock_gpt_5_6_above_272k_tier_applies_to_cost(local_model_cost_map):
|
||||
"""A prompt over 272K tokens is billed at the long-context rate, not the base rate."""
|
||||
response = _bedrock_response(
|
||||
|
|
@ -220,8 +214,6 @@ def test_bedrock_gpt_5_6_bills_cache_write_tokens(local_model_cost_map):
|
|||
assert cost == pytest.approx(expected, rel=1e-9)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("profile", GPT_5_6_PROFILES, ids=lambda p: p.model_id)
|
||||
def test_bedrock_gpt_5_6_offers_tools_and_reasoning_effort_but_not_thinking(profile, local_model_cost_map):
|
||||
"""GPT-5.x on Converse maps reasoning_effort to reasoning.effort, so reasoning_effort
|
||||
|
|
|
|||
|
|
@ -157,7 +157,6 @@ class TestBedrockMantleResponsesURL:
|
|||
assert url == "https://bedrock-mantle.us-east-2.api.aws/v1/responses"
|
||||
assert url.count("/responses") == 1
|
||||
|
||||
|
||||
def test_url_aws_region_name_overrides_stale_api_base(self, monkeypatch):
|
||||
monkeypatch.delenv("BEDROCK_MANTLE_REGION", raising=False)
|
||||
monkeypatch.delenv("BEDROCK_MANTLE_API_BASE", raising=False)
|
||||
|
|
@ -1776,9 +1775,6 @@ class TestBedrockMantleResponsesSigV4:
|
|||
|
||||
class TestBedrockMantleResponsesPricing:
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model, input_cost, output_cost",
|
||||
[
|
||||
|
|
|
|||
|
|
@ -684,9 +684,6 @@ class TestBedrockMantleProviderResolution:
|
|||
class TestBedrockMantlePricing:
|
||||
"""Tests that verify Bedrock Mantle uses correct AWS Bedrock pricing, not OpenAI pricing."""
|
||||
|
||||
|
||||
|
||||
|
||||
def test_safeguard_models_have_larger_output_tokens(self, monkeypatch):
|
||||
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "true")
|
||||
litellm.add_known_models()
|
||||
|
|
@ -697,10 +694,6 @@ class TestBedrockMantlePricing:
|
|||
assert info_safeguard["max_output_tokens"] > info_120b["max_output_tokens"]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model_id",
|
||||
[
|
||||
|
|
|
|||
|
|
@ -16,8 +16,6 @@ from litellm.types.utils import (
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_validate_environment_sets_session_affinity_from_litellm_session_id():
|
||||
config = FireworksAIConfig()
|
||||
|
||||
|
|
@ -395,8 +393,6 @@ def test_get_supported_openai_params_parallel_tool_calls_without_tool_choice(
|
|||
assert "tool_choice" not in supported_params
|
||||
|
||||
|
||||
|
||||
|
||||
def test_get_provider_info_omits_false_supports_reasoning(monkeypatch):
|
||||
"""Test that Fireworks only overrides supports_reasoning for supported models."""
|
||||
config = FireworksAIConfig()
|
||||
|
|
|
|||
|
|
@ -56,8 +56,6 @@ def use_local_model_cost_map():
|
|||
monkeypatch.undo()
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("alias", KIMI_ALIASES)
|
||||
def test_fireworks_kimi_get_model_info_limits(use_local_model_cost_map, alias):
|
||||
model_info = use_local_model_cost_map.get_model_info(model=alias)
|
||||
|
|
|
|||
|
|
@ -306,8 +306,6 @@ def test_gemini_realtime_transformation_generation_complete():
|
|||
assert contains_audio_done_event, "Expected audio done event"
|
||||
|
||||
|
||||
|
||||
|
||||
def test_gemini_realtime_tool_call_transformation():
|
||||
"""Test transformation of Gemini toolCall to OpenAI function_call_arguments.done format."""
|
||||
config = GeminiRealtimeConfig()
|
||||
|
|
@ -1831,8 +1829,6 @@ def test_is_audio_only_live_model_uses_cost_map(model, expected, patch_gemini_au
|
|||
assert GeminiRealtimeConfig._is_audio_only_live_model(model) == expected
|
||||
|
||||
|
||||
|
||||
|
||||
def test_is_setup_message_and_is_content_message():
|
||||
config = GeminiRealtimeConfig()
|
||||
assert config.is_setup_message({"setup": {}}) is True
|
||||
|
|
|
|||
|
|
@ -231,8 +231,6 @@ def test_inception_in_provider_lists():
|
|||
assert "https://api.inceptionlabs.ai/v1" in litellm.openai_compatible_endpoints
|
||||
|
||||
|
||||
|
||||
|
||||
def test_inception_model_list_populated(monkeypatch):
|
||||
monkeypatch.setenv("LITELLM_LOCAL_MODEL_COST_MAP", "True")
|
||||
litellm.model_cost = litellm.get_model_cost_map(url="")
|
||||
|
|
|
|||
|
|
@ -143,8 +143,6 @@ async def test_inception_fim_async():
|
|||
assert r.choices[0].text == "a + b"
|
||||
|
||||
|
||||
|
||||
|
||||
def test_inception_fim_targets_fim_endpoint():
|
||||
"""
|
||||
End-to-end: a FIM request must hit `/v1/fim/completions` (NOT
|
||||
|
|
|
|||
|
|
@ -709,11 +709,6 @@ class TestKimiK26ModelRegistry:
|
|||
return GetModelCostMap.load_local_model_cost_map()
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class TestMoonshotResponseSchemaSupport:
|
||||
"""Every model currently live on api.moonshot.ai supports json_schema
|
||||
response_format, which gates discovery via litellm.responses(). The flag
|
||||
|
|
@ -735,7 +730,6 @@ class TestMoonshotResponseSchemaSupport:
|
|||
def model_cost_map(self):
|
||||
return GetModelCostMap.load_local_model_cost_map()
|
||||
|
||||
|
||||
def test_supports_response_schema_utility_reports_true(self, model_cost_map, monkeypatch):
|
||||
monkeypatch.setattr(litellm, "model_cost", model_cost_map)
|
||||
assert litellm.utils.supports_response_schema(model="moonshot/kimi-k2.5") is True
|
||||
|
|
|
|||
|
|
@ -318,7 +318,6 @@ class TestDarkbloom:
|
|||
assert config.custom_llm_provider == "darkbloom"
|
||||
|
||||
|
||||
|
||||
class TestPublicAIIntegration:
|
||||
"""Integration tests for PublicAI provider"""
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ class TestLibertAIProviderConfig:
|
|||
assert api_base == "https://custom.example.com/v1"
|
||||
assert api_key == "sk-test"
|
||||
|
||||
|
||||
def test_libertai_router_config(self):
|
||||
"""Test that libertai can be used in Router configuration"""
|
||||
from litellm import Router
|
||||
|
|
@ -79,7 +78,6 @@ class TestLibertAIProviderConfig:
|
|||
assert len(router.model_list) == 1
|
||||
assert router.model_list[0]["model_name"] == "libertai-chat"
|
||||
|
||||
|
||||
def test_libertai_supported_endpoints_matrix(self):
|
||||
"""The runtime-served backup matrix (GET /public/supported_endpoints) lists libertai."""
|
||||
import json
|
||||
|
|
|
|||
|
|
@ -316,7 +316,6 @@ class TestPerplexityCostCalculator:
|
|||
|
||||
assert math.isclose(total_cost, expected_total, rel_tol=1e-6)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("citation_tokens", [0, 10, 25, 100])
|
||||
@pytest.mark.parametrize("search_queries", [0, 1, 5, 10])
|
||||
@pytest.mark.parametrize("reasoning_tokens", [0, 15, 30])
|
||||
|
|
@ -462,7 +461,6 @@ class TestPerplexityCostCalculator:
|
|||
assert math.isclose(prompt_cost, expected_prompt, rel_tol=1e-9)
|
||||
assert math.isclose(completion_cost, expected_completion, rel_tol=1e-9)
|
||||
|
||||
|
||||
def test_agent_api_fallback_rates_price_a_response_without_metered_cost(self):
|
||||
"""Perplexity meters cost on the response, but when `usage.cost` is absent the
|
||||
calculator falls back to the mapped per-token rates. Regression: that fallback
|
||||
|
|
|
|||
|
|
@ -136,7 +136,6 @@ class TestVertexAIVideoConfig:
|
|||
# Should NOT include endpoint
|
||||
assert not url.endswith(":predictLongRunning")
|
||||
|
||||
|
||||
def test_veo_31_lite_provider_routing_from_local_model_map(
|
||||
self, monkeypatch: pytest.MonkeyPatch
|
||||
):
|
||||
|
|
|
|||
|
|
@ -97,8 +97,6 @@ def test_redirected_slug_keeps_its_retirement_date(cost_map: dict, slug: str):
|
|||
assert cost_map[slug]["deprecation_date"] == expected_retirement_date(slug)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("slug", REDIRECTED_SLUGS)
|
||||
def test_redirected_slug_carries_the_target_tier_rates(cost_map: dict, slug: str):
|
||||
"""The request executes as grok-4.3, so it is tiered at grok-4.3's 200k boundary."""
|
||||
|
|
@ -108,8 +106,6 @@ def test_redirected_slug_carries_the_target_tier_rates(cost_map: dict, slug: str
|
|||
assert entry[field] == target[field], field
|
||||
|
||||
|
||||
|
||||
|
||||
def test_both_cost_maps_agree_on_the_redirected_slugs():
|
||||
prices = json.loads(PRICES_PATH.read_text(encoding="utf-8"))
|
||||
backup = json.loads(BACKUP_PRICES_PATH.read_text(encoding="utf-8"))
|
||||
|
|
|
|||
|
|
@ -55,12 +55,9 @@ def test_zai_in_provider_lists():
|
|||
assert "zai" in litellm.provider_list
|
||||
|
||||
|
||||
|
||||
|
||||
def test_zai_glm46_cost_calculation(local_model_cost_map):
|
||||
"""Test the cost calculation for glm-4.6"""
|
||||
|
||||
|
||||
prompt_cost, completion_cost = cost_per_token(
|
||||
model="zai/glm-4.6",
|
||||
prompt_tokens=1000000, # 1M tokens
|
||||
|
|
@ -72,10 +69,6 @@ def test_zai_glm46_cost_calculation(local_model_cost_map):
|
|||
assert math.isclose(completion_cost, 2.2, rel_tol=1e-6)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_glm47_cost_calculation(local_model_cost_map):
|
||||
"""Test cost calculation for GLM-4.7"""
|
||||
|
||||
|
|
|
|||
|
|
@ -31,10 +31,6 @@ def model_data():
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_usgov_carries_20_percent_premium_over_global(model_data):
|
||||
"""The us-gov rates must equal 1.2x the global anthropic.* rates,
|
||||
matching AWS's documented GovCloud uplift.
|
||||
|
|
@ -80,26 +76,6 @@ def test_usgov_cross_region_above_200k_ratio_to_global(model_data):
|
|||
ratio = usgov_info[field] / global_info[field]
|
||||
assert abs(ratio - 1.2) < 1e-9, f"{field}: us-gov / global ratio is {ratio}, expected 1.2"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_usgov_east_haiku_profile_mirrors_in_region_row(model_data):
|
||||
"""us-gov-east-1 serves claude-3-haiku through the us-gov. inference profile
|
||||
|
|
@ -113,20 +89,6 @@ def test_usgov_east_haiku_profile_mirrors_in_region_row(model_data):
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
GOV_ROW_SOURCES = {
|
||||
"us-gov.anthropic.claude-fable-5-1": "anthropic.claude-fable-5-1",
|
||||
"bedrock/us-gov-west-1/anthropic.claude-fable-5-1": "anthropic.claude-fable-5-1",
|
||||
|
|
|
|||
|
|
@ -26,11 +26,6 @@ def _load_root_cost_map() -> dict:
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_fable_5_geo_multiplier_without_fast_mode():
|
||||
"""First-party ``inference_geo='us'`` carries the 1.1x premium, but unlike
|
||||
the Opus line there is no fast-mode variant for Fable 5; a ``fast`` key
|
||||
|
|
@ -65,8 +60,6 @@ def test_fable_5_registered_for_bedrock_converse():
|
|||
assert "anthropic.claude-fable-5" in BEDROCK_CONVERSE_MODELS
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cost_map",
|
||||
[_load_root_cost_map(), GetModelCostMap.load_local_model_cost_map()],
|
||||
|
|
@ -138,8 +131,6 @@ FABLE_5_1_VARIANTS = (
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cost_map",
|
||||
[_load_root_cost_map(), GetModelCostMap.load_local_model_cost_map()],
|
||||
|
|
@ -158,10 +149,6 @@ def test_fable_5_1_cache_reads_cost_a_quarter_of_fable_5(cost_map):
|
|||
), model_name
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_fable_5_1_present_in_bundled_backup():
|
||||
backup = GetModelCostMap.load_local_model_cost_map()
|
||||
root = _load_root_cost_map()
|
||||
|
|
@ -174,8 +161,6 @@ def test_fable_5_1_registered_for_bedrock_converse():
|
|||
assert "anthropic.claude-fable-5-1" in BEDROCK_CONVERSE_MODELS
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"model",
|
||||
[
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import json
|
|||
import os
|
||||
|
||||
|
||||
|
||||
|
||||
def test_bedrock_haiku_4_5_matches_sonnet_capabilities():
|
||||
"""
|
||||
Test that Haiku 4.5 has same capabilities as Sonnet 4.5
|
||||
|
|
|
|||
|
|
@ -71,10 +71,6 @@ def test_claude_4_6_australia_region_uses_au_prefix_not_apac():
|
|||
), "apac.anthropic.claude-sonnet-4-6 should not be in bedrock_converse_models"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_opus_4_6_alias_and_dated_metadata_match():
|
||||
json_path = os.path.join(
|
||||
os.path.dirname(__file__), "../../model_prices_and_context_window.json"
|
||||
|
|
|
|||
|
|
@ -28,11 +28,6 @@ def _load_root_cost_map() -> dict:
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_opus_4_8_fast_mode_multiplier():
|
||||
"""Opus 4.8 dropped fast-mode pricing to 2x base ($10/$50 per MTok);
|
||||
Opus 4.7 was 6x ($30/$150)."""
|
||||
|
|
@ -42,14 +37,10 @@ def test_opus_4_8_fast_mode_multiplier():
|
|||
assert entry["fast"] == 2.0
|
||||
|
||||
|
||||
|
||||
|
||||
def test_opus_4_8_registered_for_bedrock_converse():
|
||||
assert "anthropic.claude-opus-4-8" in BEDROCK_CONVERSE_MODELS
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cost_map",
|
||||
[_load_root_cost_map(), GetModelCostMap.load_local_model_cost_map()],
|
||||
|
|
|
|||
|
|
@ -51,11 +51,6 @@ def _load_root_cost_map() -> dict:
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model_name", BEDROCK_OPUS_5_VARIANTS)
|
||||
def test_opus_5_bedrock_entries_declare_no_effort_ceiling(model_name):
|
||||
"""Bedrock accepts every effort level for Opus 5, so no clamp belongs here.
|
||||
|
|
@ -135,8 +130,6 @@ def test_opus_5_registered_for_bedrock_converse():
|
|||
assert "anthropic.claude-opus-5" in BEDROCK_CONVERSE_MODELS
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cost_map",
|
||||
[_load_root_cost_map(), GetModelCostMap.load_local_model_cost_map()],
|
||||
|
|
|
|||
|
|
@ -40,11 +40,6 @@ def _load_root_cost_map() -> dict:
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_sonnet_5_present_in_bundled_backup():
|
||||
"""The bundled backup is the runtime fallback (and what tests load with
|
||||
``LITELLM_LOCAL_MODEL_COST_MAP=True``); it must carry the same entries as the
|
||||
|
|
@ -58,8 +53,6 @@ def test_sonnet_5_registered_for_bedrock_converse():
|
|||
assert "anthropic.claude-sonnet-5" in BEDROCK_CONVERSE_MODELS
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"cost_map",
|
||||
[_load_root_cost_map(), GetModelCostMap.load_local_model_cost_map()],
|
||||
|
|
|
|||
|
|
@ -27,8 +27,6 @@ BACKUP_MAP = os.path.join(
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def _load(path: str) -> dict:
|
||||
with open(path, encoding="utf-8") as f:
|
||||
return json.load(f)
|
||||
|
|
@ -38,14 +36,6 @@ def _cloudflare_keys(data: dict) -> set:
|
|||
return {k for k in data if k.startswith("cloudflare/")}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_root_and_backup_have_identical_cloudflare_keys():
|
||||
if not os.path.exists(ROOT_MAP):
|
||||
pytest.skip("root cost map only ships in source checkouts")
|
||||
|
|
|
|||
|
|
@ -32,8 +32,6 @@ def _load(path):
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_blue_alias_matches_its_snapshot_computer_use():
|
||||
cost_map = _load(MAIN_PATH)
|
||||
|
||||
|
|
|
|||
|
|
@ -39,10 +39,6 @@ class TestDeepSeekModelCostEntries:
|
|||
"""Verify that provider-prefixed DeepSeek entries contain the same
|
||||
capability flags as their bare-name counterparts in the JSON files."""
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_deepseek_chat_max_input_tokens_matches_bare_in_backup(self):
|
||||
data = _load_backup_json()
|
||||
bare = data.get("deepseek-chat", {})
|
||||
|
|
@ -56,8 +52,6 @@ class TestDeepSeekModelCostEntries:
|
|||
assert prefixed.get("max_output_tokens") == bare.get("max_output_tokens")
|
||||
|
||||
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# API-level tests – verify supports_response_schema returns True
|
||||
# ---------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -17,8 +17,6 @@ import pytest
|
|||
from litellm.utils import get_model_info
|
||||
|
||||
|
||||
|
||||
|
||||
NEW_ENTRIES = {
|
||||
"fireworks_ai/accounts/fireworks/models/deepseek-v4-pro-0813": {
|
||||
"input_cost_per_token": 1.32e-06,
|
||||
|
|
@ -39,8 +37,6 @@ def model_data():
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_bare_fireworks_ids_resolve_through_prefixed_entries():
|
||||
"""Bare IDs from #37274 resolve via the provider-prefix lookup path."""
|
||||
for bare_id, prefixed_key in [
|
||||
|
|
|
|||
|
|
@ -2,10 +2,6 @@ import json
|
|||
from pathlib import Path
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_azure_ai_gpt_5_5_backup_matches_main():
|
||||
"""Ensure the bundled model cost map stays in sync with the canonical file."""
|
||||
repo_root = Path(__file__).parents[2]
|
||||
|
|
|
|||
|
|
@ -41,19 +41,11 @@ REALTIME_ONLY_GPT_MODELS_WITHOUT_ENDPOINTS = (
|
|||
ALL_REALTIME_ONLY_GPT_MODELS = REALTIME_ONLY_GPT_MODELS + REALTIME_ONLY_GPT_MODELS_WITHOUT_ENDPOINTS
|
||||
|
||||
|
||||
|
||||
|
||||
def test_realtime_is_a_valid_mode_literal():
|
||||
hints = get_type_hints(ModelInfoBase, include_extras=False)
|
||||
assert "realtime" in get_args(hints["mode"])
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_backup_matches_main_for_realtime_models():
|
||||
repo_root = Path(__file__).parents[2]
|
||||
with open(repo_root / "model_prices_and_context_window.json") as f:
|
||||
|
|
|
|||
|
|
@ -25,13 +25,6 @@ def _load(path):
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", SYNCED_MODELS)
|
||||
def test_backup_matches_main(model):
|
||||
"""Ensure the bundled (backup) cost map stays in sync with the canonical file."""
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ def _load(path):
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", SMALL_4_0_MODELS)
|
||||
def test_backup_matches_main(model):
|
||||
main_cost = _load(MAIN_PATH)
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ def _load_cost_map(filename: str = "model_prices_and_context_window.json") -> di
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model, input_cost, cached_cost, output_cost", PRICING)
|
||||
def test_muse_spark_1_2_cost_per_token(
|
||||
local_model_cost_map, model: str, input_cost: float, cached_cost: float, output_cost: float
|
||||
|
|
|
|||
|
|
@ -23,9 +23,6 @@ def _load_cost_map(filename: str = "model_prices_and_context_window.json") -> di
|
|||
return json.load(f)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model, input_cost, cached_cost, output_cost", PRICING)
|
||||
def test_muse_spark_1_3_cost_per_token(
|
||||
local_model_cost_map, model: str, input_cost: float, cached_cost: float, output_cost: float
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ def test_replicate_models_have_valid_key_prefix(model_cost: dict[str, Any]) -> N
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_replicate_backup_matches_main() -> None:
|
||||
repo_root = Path(__file__).parents[2]
|
||||
main_path = repo_root / "model_prices_and_context_window.json"
|
||||
|
|
|
|||
|
|
@ -76,14 +76,6 @@ def cost_map() -> CostMap:
|
|||
return COST_MAP_ADAPTER.validate_python(json.load(f))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def test_together_chat_entries_never_carry_context_length_as_output_ceiling(cost_map: CostMap):
|
||||
inflated = sorted(
|
||||
model
|
||||
|
|
@ -96,10 +88,6 @@ def test_together_chat_entries_never_carry_context_length_as_output_ceiling(cost
|
|||
assert inflated == []
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", sorted(DEPRECATED_MODELS))
|
||||
def test_together_deprecated_model_carries_deprecation_date(cost_map: CostMap, model: str):
|
||||
info = cost_map.get(model)
|
||||
|
|
@ -153,8 +141,6 @@ CACHED_INPUT_MODELS: Final = (
|
|||
)
|
||||
|
||||
|
||||
|
||||
|
||||
def test_together_prompt_caching_flag_implies_cache_read_rate(cost_map: CostMap):
|
||||
for model, info in cost_map.items():
|
||||
if model.startswith("together_ai/") and info.get("supports_prompt_caching"):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue