mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
fix(constants): correct Azure and Clarifai defaults
This commit is contained in:
parent
be4481779e
commit
68d9afc313
2 changed files with 25 additions and 3 deletions
|
|
@ -476,10 +476,10 @@ AZURE_FILE_SEARCH_COST_PER_GB_PER_DAY: Final = float(
|
|||
os.getenv("AZURE_FILE_SEARCH_COST_PER_GB_PER_DAY", 0.1) # $0.1 USD per 1 GB/Day
|
||||
)
|
||||
AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS: Final = float(
|
||||
os.getenv("AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS", 3.0) # $0.003 USD per 1K Tokens
|
||||
os.getenv("AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS", 0.003) # $0.003 USD per 1K Tokens
|
||||
)
|
||||
AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS: Final = float(
|
||||
os.getenv("AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS", 12.0) # $0.012 USD per 1K Tokens
|
||||
os.getenv("AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS", 0.012) # $0.012 USD per 1K Tokens
|
||||
)
|
||||
AZURE_VECTOR_STORE_COST_PER_GB_PER_DAY: Final = float(
|
||||
os.getenv("AZURE_VECTOR_STORE_COST_PER_GB_PER_DAY", 0.1) # $0.1 USD per 1 GB/Day (same as file search)
|
||||
|
|
@ -1101,7 +1101,8 @@ clarifai_models: Final[set] = set(
|
|||
"clarifai/qwen.qwenLM.Qwen3-30B-A3B-Instruct-2507",
|
||||
"clarifai/qwen.qwen3.qwen3-next-80B-A3B-Thinking",
|
||||
"clarifai/openai.chat-completion.gpt-oss-120b",
|
||||
"clarifai/qwen.qwenLM.Qwen3-30B-A3B-Thinking-2507clarifai/openai.chat-completion.gpt-5-nano",
|
||||
"clarifai/qwen.qwenLM.Qwen3-30B-A3B-Thinking-2507",
|
||||
"clarifai/openai.chat-completion.gpt-5-nano",
|
||||
"clarifai/openai.chat-completion.gpt-4o",
|
||||
"clarifai/gcp.generate.gemini-2_5-pro",
|
||||
"clarifai/anthropic.completion.claude-sonnet-4",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import ast
|
||||
import inspect
|
||||
import json
|
||||
from typing import Final
|
||||
from unittest import mock
|
||||
|
||||
import httpx
|
||||
|
|
@ -15,6 +16,26 @@ import litellm
|
|||
from litellm import constants
|
||||
|
||||
|
||||
def test_azure_computer_use_default_costs(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
"""Match Azure pricing, verified 2026-10-04: https://azure.microsoft.com/en-us/pricing/details/openai/"""
|
||||
budget_notice_state: Final[bool] = constants.budget_reservation_disabled_info_emitted
|
||||
try:
|
||||
with monkeypatch.context() as clean_environment:
|
||||
clean_environment.delenv("AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS", raising=False)
|
||||
clean_environment.delenv("AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS", raising=False)
|
||||
default_constants: Final = importlib.reload(constants)
|
||||
assert default_constants.AZURE_COMPUTER_USE_INPUT_COST_PER_1K_TOKENS == 0.003
|
||||
assert default_constants.AZURE_COMPUTER_USE_OUTPUT_COST_PER_1K_TOKENS == 0.012
|
||||
finally:
|
||||
importlib.reload(constants)
|
||||
constants.budget_reservation_disabled_info_emitted = budget_notice_state
|
||||
|
||||
|
||||
def test_clarifai_models_are_distinct() -> None:
|
||||
assert "clarifai/qwen.qwenLM.Qwen3-30B-A3B-Thinking-2507" in constants.clarifai_models
|
||||
assert "clarifai/openai.chat-completion.gpt-5-nano" in constants.clarifai_models
|
||||
|
||||
|
||||
def _build_constant_env_var_map() -> dict[str, str]:
|
||||
"""
|
||||
Build a mapping of CONSTANT_NAME -> ENV_VAR_NAME by parsing constants.py.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue