Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

Update fireworks ai pricing (#10425)

Krish Dholakiad783190e0475
diff --git a/litellm/constants.py b/litellm/constants.py
index f48ce97afe6..c04a0182601 100644
--- a/litellm/constants.py
+++ b/litellm/constants.py
@@ -94,6 +94,7 @@ STREAM_SSE_DONE_STRING: str = "[DONE]"
DEFAULT_REPLICATE_GPU_PRICE_PER_SECOND = 0.001400 # price per second for a100 80GB
FIREWORKS_AI_56_B_MOE = 56
FIREWORKS_AI_176_B_MOE = 176
+FIREWORKS_AI_4_B = 4
FIREWORKS_AI_16_B = 16
FIREWORKS_AI_80_B = 80
diff --git a/litellm/llms/fireworks_ai/cost_calculator.py b/litellm/llms/fireworks_ai/cost_calculator.py
index 31414625ab5..46026f266d6 100644
--- a/litellm/llms/fireworks_ai/cost_calculator.py
+++ b/litellm/llms/fireworks_ai/cost_calculator.py
@@ -5,9 +5,9 @@ For calculating cost of fireworks ai serverless inference models.
from typing import Tuple
from litellm.constants import (
+ FIREWORKS_AI_4_B,
FIREWORKS_AI_16_B,
FIREWORKS_AI_56_B_MOE,
- FIREWORKS_AI_80_B,
FIREWORKS_AI_176_B_MOE,
)
from litellm.types.utils import Usage
@@ -43,10 +43,12 @@ def get_base_model_for_pricing(model_name: str) -> str:
params_billion = float(params_match)
# Determine the category based on the number of parameters
- if params_billion <= FIREWORKS_AI_16_B:
- return "fireworks-ai-up-to-16b"
- elif params_billion <= FIREWORKS_AI_80_B:
- return "fireworks-ai-16b-80b"
+ if params_billion <= FIREWORKS_AI_4_B:
+ return "fireworks-ai-up-to-4b"
+ elif params_billion <= FIREWORKS_AI_16_B:
+ return "fireworks-ai-4.1b-to-16b"
+ elif params_billion > FIREWORKS_AI_16_B:
+ return "fireworks-ai-above-16b"
# If no matches, return the original model_name
return "fireworks-ai-default"
diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json
index 6e71a296f3e..cd9e4c484ec 100644
--- a/litellm/model_prices_and_context_window_backup.json
+++ b/litellm/model_prices_and_context_window_backup.json
@@ -11084,7 +11084,7 @@
"fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-instruct": {
"max_tokens": 65536,
"max_input_tokens": 65536,
- "max_output_tokens": 8192,
+ "max_output_tokens": 65536,
"input_cost_per_token": 0.0000012,
"output_cost_per_token": 0.0000012,
"litellm_provider": "fireworks_ai",
@@ -11106,7 +11106,66 @@
"source": "https://fireworks.ai/pricing",
"supports_tool_choice": true
},
-
+ "fireworks_ai/accounts/fireworks/models/deepseek-r1": {
+ "max_tokens": 20480,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 20480,
+ "input_cost_per_token": 3e-6,
+ "output_cost_per_token": 8e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/deepseek-r1-basic": {
+ "max_tokens": 20480,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 20480,
+ "input_cost_per_token": 0.55e-6,
+ "output_cost_per_token": 2.19e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama-v3p1-405b-instruct": {
+ "max_tokens": 16384,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 16384,
+ "input_cost_per_token": 3e-6,
+ "output_cost_per_token": 3e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama4-maverick-instruct-basic": {
+ "max_tokens": 131072,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "input_cost_per_token": 0.22e-6,
+ "output_cost_per_token": 0.88e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama4-scout-instruct-basic": {
+ "max_tokens": 131072,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "input_cost_per_token": 0.15e-6,
+ "output_cost_per_token": 0.60e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
"fireworks_ai/nomic-ai/nomic-embed-text-v1.5": {
"max_tokens": 8192,
"max_input_tokens": 8192,
@@ -11152,12 +11211,17 @@
"mode": "embedding",
"source": "https://fireworks.ai/pricing"
},
- "fireworks-ai-up-to-16b": {
+ "fireworks-ai-up-to-4b": {
+ "input_cost_per_token": 0.0000002,
+ "output_cost_per_token": 0.0000002,
+ "litellm_provider": "fireworks_ai"
+ },
+ "fireworks-ai-4.1b-to-16b": {
"input_cost_per_token": 0.0000002,
"output_cost_per_token": 0.0000002,
"litellm_provider": "fireworks_ai"
},
- "fireworks-ai-16.1b-to-80b": {
+ "fireworks-ai-above-16b": {
"input_cost_per_token": 0.0000009,
"output_cost_per_token": 0.0000009,
"litellm_provider": "fireworks_ai"
diff --git a/model_prices_and_context_window.json b/model_prices_and_context_window.json
index 6e71a296f3e..cd9e4c484ec 100644
--- a/model_prices_and_context_window.json
+++ b/model_prices_and_context_window.json
@@ -11084,7 +11084,7 @@
"fireworks_ai/accounts/fireworks/models/deepseek-coder-v2-instruct": {
"max_tokens": 65536,
"max_input_tokens": 65536,
- "max_output_tokens": 8192,
+ "max_output_tokens": 65536,
"input_cost_per_token": 0.0000012,
"output_cost_per_token": 0.0000012,
"litellm_provider": "fireworks_ai",
@@ -11106,7 +11106,66 @@
"source": "https://fireworks.ai/pricing",
"supports_tool_choice": true
},
-
+ "fireworks_ai/accounts/fireworks/models/deepseek-r1": {
+ "max_tokens": 20480,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 20480,
+ "input_cost_per_token": 3e-6,
+ "output_cost_per_token": 8e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/deepseek-r1-basic": {
+ "max_tokens": 20480,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 20480,
+ "input_cost_per_token": 0.55e-6,
+ "output_cost_per_token": 2.19e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama-v3p1-405b-instruct": {
+ "max_tokens": 16384,
+ "max_input_tokens": 128000,
+ "max_output_tokens": 16384,
+ "input_cost_per_token": 3e-6,
+ "output_cost_per_token": 3e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama4-maverick-instruct-basic": {
+ "max_tokens": 131072,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "input_cost_per_token": 0.22e-6,
+ "output_cost_per_token": 0.88e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
+ "fireworks_ai/accounts/fireworks/models/llama4-scout-instruct-basic": {
+ "max_tokens": 131072,
+ "max_input_tokens": 131072,
+ "max_output_tokens": 131072,
+ "input_cost_per_token": 0.15e-6,
+ "output_cost_per_token": 0.60e-6,
+ "litellm_provider": "fireworks_ai",
+ "mode": "chat",
+ "supports_response_schema": true,
+ "source": "https://fireworks.ai/pricing",
+ "supports_tool_choice": true
+ },
"fireworks_ai/nomic-ai/nomic-embed-text-v1.5": {
"max_tokens": 8192,
"max_input_tokens": 8192,
@@ -11152,12 +11211,17 @@
"mode": "embedding",
"source": "https://fireworks.ai/pricing"
},
- "fireworks-ai-up-to-16b": {
+ "fireworks-ai-up-to-4b": {
+ "input_cost_per_token": 0.0000002,
+ "output_cost_per_token": 0.0000002,
+ "litellm_provider": "fireworks_ai"
+ },
+ "fireworks-ai-4.1b-to-16b": {
"input_cost_per_token": 0.0000002,
"output_cost_per_token": 0.0000002,
"litellm_provider": "fireworks_ai"
},
- "fireworks-ai-16.1b-to-80b": {
+ "fireworks-ai-above-16b": {
"input_cost_per_token": 0.0000009,
"output_cost_per_token": 0.0000009,
"litellm_provider": "fireworks_ai"
diff --git a/tests/local_testing/test_completion.py b/tests/local_testing/test_completion.py
index 064fe7f7365..3f4204f7e81 100644
--- a/tests/local_testing/test_completion.py
+++ b/tests/local_testing/test_completion.py
@@ -2661,11 +2661,10 @@ def test_re_use_openaiClient():
def test_completion_azure():
try:
- print("azure chatgpt-v-3 test\n\n")
litellm.set_verbose = False
## Test azure call
response = completion(
- model="azure/chatgpt-v-3",
+ model="azure/gpt-4o-new-test",
messages=messages,
api_key="os.environ/AZURE_API_KEY",
)
diff --git a/tests/local_testing/test_completion_cost.py b/tests/local_testing/test_completion_cost.py
index 39a77d1adee..011672b04d3 100644
--- a/tests/local_testing/test_completion_cost.py
+++ b/tests/local_testing/test_completion_cost.py
@@ -1283,7 +1283,7 @@ from litellm.llms.fireworks_ai.cost_calculator import get_base_model_for_pricing
@pytest.mark.parametrize(
"model, base_model",
[
- ("fireworks_ai/llama-v3p1-405b-instruct", "fireworks-ai-default"),
+ ("fireworks_ai/llama-v3p1-405b-instruct", "fireworks-ai-above-16b"),
("fireworks_ai/llama4-maverick-instruct-basic", "fireworks-ai-default"),
],
)
diff --git a/tests/local_testing/test_custom_callback_input.py b/tests/local_testing/test_custom_callback_input.py
index 055ed821d0d..bb0a7ef4258 100644
--- a/tests/local_testing/test_custom_callback_input.py
+++ b/tests/local_testing/test_custom_callback_input.py
@@ -450,12 +450,12 @@ def test_chat_azure_stream():
customHandler = CompletionCustomHandler()
litellm.callbacks = [customHandler]
response = litellm.completion(
- model="azure/chatgpt-v-3",
+ model="azure/gpt-4o-new-test",
messages=[{"role": "user", "content": "Hi 👋 - i'm sync azure"}],
)
# test streaming
response = litellm.completion(
- model="azure/chatgpt-v-3",
+ model="azure/gpt-4o-new-test",
messages=[{"role": "user", "content": "Hi 👋 - i'm sync azure"}],
stream=True,
)
@@ -464,7 +464,7 @@ def test_chat_azure_stream():
# test failure callback
try:
response = litellm.completion(
- model="azure/chatgpt-v-3",
+ model="azure/gpt-4o-new-test",
messages=[{"role": "user", "content": "Hi 👋 - i'm sync azure"}],
api_key="my-bad-key",
stream=True,
diff --git a/tests/local_testing/test_timeout.py b/tests/local_testing/test_timeout.py
index 9342e789b4b..2299ab4409d 100644
--- a/tests/local_testing/test_timeout.py
+++ b/tests/local_testing/test_timeout.py
@@ -104,7 +104,7 @@ def test_hanging_request_azure():
{
"model_name": "azure-gpt",
"litellm_params": {
- "model": "azure/chatgpt-v-3",
+ "model": "azure/gpt-4o-new-test",
"api_base": os.environ["AZURE_API_BASE"],
"api_key": os.environ["AZURE_API_KEY"],
},