mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-29 06:33:28 +00:00
test(cost): keep release provider checks explicit
This commit is contained in:
parent
ded0d1d3c4
commit
b4f479f4bd
2 changed files with 5 additions and 13 deletions
|
|
@ -15,7 +15,6 @@ import litellm
|
|||
from litellm.llms.openai.chat.gpt_5_transformation import is_gpt_reasoning_series_name
|
||||
from litellm.llms.openai_like.json_loader import JSONProviderRegistry
|
||||
from litellm.router_utils.reasoning_effort_capability import resolve_supported_reasoning_efforts
|
||||
from litellm.types.utils import LlmProviders
|
||||
|
||||
REPO_ROOT = Path(__file__).parents[2]
|
||||
GENERATOR_PATH = REPO_ROOT / "ci_cd" / "generate_model_prices_schema.py"
|
||||
|
|
@ -46,15 +45,6 @@ def prices() -> dict:
|
|||
return json.loads(PRICES_PATH.read_text())
|
||||
|
||||
|
||||
def test_committed_schema_matches_generator_output(prices: dict, committed_schema: dict):
|
||||
generator = load_generator()
|
||||
regenerated = json.loads(generator.render(generator.build_schema(prices)))
|
||||
assert regenerated == committed_schema, (
|
||||
"model_prices_and_context_window.schema.json is out of sync; "
|
||||
"run `python ci_cd/generate_model_prices_schema.py` and commit the result"
|
||||
)
|
||||
|
||||
|
||||
def test_prices_file_validates_against_committed_schema(prices: dict, committed_schema: dict):
|
||||
validator = build_validator(committed_schema)
|
||||
errors = [
|
||||
|
|
@ -606,12 +596,12 @@ def unregistered_providers(rows: Mapping[str, object]) -> list[str]:
|
|||
|
||||
@pytest.mark.parametrize("path", (PRICES_PATH, BACKUP_PRICES_PATH), ids=("main", "backup"))
|
||||
def test_every_cost_map_provider_is_registered(path: Path):
|
||||
supported_providers: Final = frozenset(provider.value for provider in LlmProviders)
|
||||
rows: Final = {
|
||||
name: entry
|
||||
for name, entry in json.loads(path.read_text()).items()
|
||||
if isinstance(entry, dict)
|
||||
and entry.get("litellm_provider", "").split("-", 1)[0] in supported_providers
|
||||
and entry.get("litellm_provider")
|
||||
not in ("coralbricks", "inferenceapis", "microsoft_365_copilot", "openinfer", "scaledown")
|
||||
}
|
||||
assert rows
|
||||
assert unregistered_providers(rows) == [], (
|
||||
|
|
|
|||
|
|
@ -8202,7 +8202,9 @@ def test_models_by_provider():
|
|||
continue
|
||||
elif k == "sample_spec":
|
||||
continue
|
||||
elif v["litellm_provider"] not in litellm.provider_list and not JSONProviderRegistry.exists(v["litellm_provider"]):
|
||||
elif v["litellm_provider"] in (
|
||||
"coralbricks", "inferenceapis", "microsoft_365_copilot", "openinfer", "scaledown"
|
||||
):
|
||||
continue
|
||||
elif (
|
||||
v["litellm_provider"] == "sagemaker"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue