mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-27 01:22:18 +00:00
feat(providers): add DeepSeek V4.1 Flash to Prism
This commit is contained in:
parent
b87ffa2dc8
commit
40222e4815
4 changed files with 68 additions and 8 deletions
|
|
@ -74783,6 +74783,30 @@
|
|||
"supports_vision": false,
|
||||
"supports_web_search": false
|
||||
},
|
||||
"prism/deepseek-v4.1-flash": {
|
||||
"cache_read_input_token_cost": 7e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "prism",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 384000,
|
||||
"max_tokens": 384000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"source": "https://prisminference.com/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
"/v1/responses",
|
||||
"/v1/messages"
|
||||
],
|
||||
"supports_function_calling": true,
|
||||
"supports_native_streaming": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"prism/deepseek-v4-flash": {
|
||||
"cache_read_input_token_cost": 7e-08,
|
||||
"input_cost_per_token": 1.4e-07,
|
||||
|
|
|
|||
|
|
@ -2747,7 +2747,7 @@
|
|||
"default_value": null
|
||||
}
|
||||
],
|
||||
"default_model_placeholder": "prism/deepseek-v4-flash"
|
||||
"default_model_placeholder": "prism/deepseek-v4.1-flash"
|
||||
},
|
||||
{
|
||||
"provider": "RECRAFT",
|
||||
|
|
|
|||
|
|
@ -74783,6 +74783,30 @@
|
|||
"supports_vision": false,
|
||||
"supports_web_search": false
|
||||
},
|
||||
"prism/deepseek-v4.1-flash": {
|
||||
"cache_read_input_token_cost": 7e-08,
|
||||
"input_cost_per_token": 3e-07,
|
||||
"litellm_provider": "prism",
|
||||
"max_input_tokens": 1000000,
|
||||
"max_output_tokens": 384000,
|
||||
"max_tokens": 384000,
|
||||
"mode": "chat",
|
||||
"output_cost_per_token": 1.2e-06,
|
||||
"source": "https://prisminference.com/pricing",
|
||||
"supported_endpoints": [
|
||||
"/v1/chat/completions",
|
||||
"/v1/responses",
|
||||
"/v1/messages"
|
||||
],
|
||||
"supports_function_calling": true,
|
||||
"supports_native_streaming": true,
|
||||
"supports_parallel_function_calling": true,
|
||||
"supports_prompt_caching": true,
|
||||
"supports_reasoning": true,
|
||||
"supports_response_schema": true,
|
||||
"supports_system_messages": true,
|
||||
"supports_tool_choice": true
|
||||
},
|
||||
"prism/deepseek-v4-flash": {
|
||||
"cache_read_input_token_cost": 7e-08,
|
||||
"input_cost_per_token": 1.4e-07,
|
||||
|
|
|
|||
|
|
@ -41,22 +41,34 @@ def test_prism_provider_keeps_explicit_credentials(monkeypatch: pytest.MonkeyPat
|
|||
assert api_base == "https://prism.internal.example/v1"
|
||||
|
||||
|
||||
def test_prism_model_cost_and_capabilities():
|
||||
@pytest.mark.parametrize(
|
||||
("model", "input_cost", "output_cost", "max_output_tokens"),
|
||||
[
|
||||
("prism/deepseek-v4.1-flash", 0.30, 1.20, 384_000),
|
||||
("prism/deepseek-v4-flash", 0.14, 0.28, 393_216),
|
||||
],
|
||||
)
|
||||
def test_prism_model_cost_and_capabilities(
|
||||
model: str,
|
||||
input_cost: float,
|
||||
output_cost: float,
|
||||
max_output_tokens: int,
|
||||
):
|
||||
from litellm.cost_calculator import cost_per_token
|
||||
|
||||
prompt_cost, completion_cost = cost_per_token(
|
||||
model="prism/deepseek-v4-flash",
|
||||
model=model,
|
||||
prompt_tokens=1_000_000,
|
||||
completion_tokens=1_000_000,
|
||||
custom_llm_provider="prism",
|
||||
)
|
||||
model_info = litellm.get_model_info("prism/deepseek-v4-flash")
|
||||
model_info = litellm.get_model_info(model)
|
||||
|
||||
assert prompt_cost == pytest.approx(0.14)
|
||||
assert completion_cost == pytest.approx(0.28)
|
||||
assert prompt_cost == pytest.approx(input_cost)
|
||||
assert completion_cost == pytest.approx(output_cost)
|
||||
assert model_info["cache_read_input_token_cost"] == pytest.approx(7e-08)
|
||||
assert model_info["max_input_tokens"] == 1_000_000
|
||||
assert model_info["max_output_tokens"] == 393_216
|
||||
assert model_info["max_output_tokens"] == max_output_tokens
|
||||
assert model_info["supports_function_calling"] is True
|
||||
assert model_info["supports_native_streaming"] is True
|
||||
assert model_info["supports_reasoning"] is True
|
||||
|
|
@ -70,7 +82,7 @@ def test_prism_is_available_in_add_model_form():
|
|||
|
||||
assert prism["provider"] == "PRISM"
|
||||
assert prism["provider_display_name"] == "Prism"
|
||||
assert prism["default_model_placeholder"] == "prism/deepseek-v4-flash"
|
||||
assert prism["default_model_placeholder"] == "prism/deepseek-v4.1-flash"
|
||||
assert {field["key"]: field["required"] for field in prism["credential_fields"]} == {
|
||||
"api_base": False,
|
||||
"api_key": True,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue