mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
fix(model_prices): bill muse spark web search grounding per query
This commit is contained in:
parent
1369b3e6f3
commit
39a5ede2d9
3 changed files with 45 additions and 0 deletions
|
|
@ -27473,6 +27473,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4.25e-06,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -27509,6 +27514,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4.25e-06,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -27545,6 +27555,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 2e-07,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
|
|||
|
|
@ -27473,6 +27473,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4.25e-06,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -27509,6 +27514,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 4.25e-06,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
@ -27545,6 +27555,11 @@
|
|||
"max_tokens": 131072,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 2e-07,
|
||||
"search_context_cost_per_query": {
|
||||
"search_context_size_high": 0.0025,
|
||||
"search_context_size_low": 0.0025,
|
||||
"search_context_size_medium": 0.0025
|
||||
},
|
||||
"source": "https://dev.meta.ai/docs/getting-started/pricing-rate-limits",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
|
|
|
|||
|
|
@ -6,9 +6,11 @@ import pytest
|
|||
import litellm
|
||||
from litellm.cost_calculator import cost_per_token
|
||||
from litellm.litellm_core_utils.get_llm_provider_logic import get_llm_provider
|
||||
from litellm.litellm_core_utils.llm_cost_calc.tool_call_cost_tracking import StandardBuiltInToolCostTracking
|
||||
|
||||
MUSE_SPARK_STANDARD = "meta/muse-spark-1.2"
|
||||
MUSE_SPARK_CONTRIBUTOR = "meta/muse-spark-1.2-contributor"
|
||||
WEB_SEARCH_COST_PER_QUERY = 0.0025
|
||||
|
||||
PRICING = (
|
||||
(MUSE_SPARK_STANDARD, 1.25e-06, 1.5e-07, 4.25e-06),
|
||||
|
|
@ -68,6 +70,12 @@ def test_muse_spark_1_2_model_info(model: str, input_cost: float, cached_cost: f
|
|||
assert info["supported_modalities"] == ["text", "image", "video"]
|
||||
assert info["supported_output_modalities"] == ["text"]
|
||||
|
||||
assert info["search_context_cost_per_query"] == {
|
||||
"search_context_size_high": WEB_SEARCH_COST_PER_QUERY,
|
||||
"search_context_size_low": WEB_SEARCH_COST_PER_QUERY,
|
||||
"search_context_size_medium": WEB_SEARCH_COST_PER_QUERY,
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model, input_cost, cached_cost, output_cost", PRICING)
|
||||
def test_muse_spark_1_2_cost_per_token(
|
||||
|
|
@ -88,6 +96,13 @@ def test_muse_spark_1_2_routes_to_meta_model_api(model: str):
|
|||
assert api_base == "https://api.meta.ai/v1"
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", (MUSE_SPARK_STANDARD, MUSE_SPARK_CONTRIBUTOR))
|
||||
def test_muse_spark_1_2_web_search_cost_per_query(local_model_cost_map, model: str):
|
||||
info = litellm.get_model_info(model=model)
|
||||
|
||||
assert StandardBuiltInToolCostTracking.get_cost_for_web_search(model_info=info) == WEB_SEARCH_COST_PER_QUERY
|
||||
|
||||
|
||||
@pytest.mark.parametrize("model", (MUSE_SPARK_STANDARD, MUSE_SPARK_CONTRIBUTOR))
|
||||
def test_muse_spark_1_2_backup_matches_main(model: str):
|
||||
"""Ensure the bundled model cost map stays in sync with the canonical file."""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue