diff --git a/litellm/model_prices_and_context_window_backup.json b/litellm/model_prices_and_context_window_backup.json index 8803940fbb..2fc6a5771d 100644 --- a/litellm/model_prices_and_context_window_backup.json +++ b/litellm/model_prices_and_context_window_backup.json @@ -1820,6 +1820,26 @@ "supports_vision": true, "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" }, + "medlm-medium": { + "max_tokens": 8192, + "max_input_tokens": 32768, + "max_output_tokens": 8192, + "input_cost_per_character": 0.0000005, + "output_cost_per_character": 0.000001, + "litellm_provider": "vertex_ai-language-models", + "mode": "chat", + "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" + }, + "medlm-large": { + "max_tokens": 1024, + "max_input_tokens": 8192, + "max_output_tokens": 1024, + "input_cost_per_character": 0.000005, + "output_cost_per_character": 0.000015, + "litellm_provider": "vertex_ai-language-models", + "mode": "chat", + "source": "https://cloud.google.com/vertex-ai/generative-ai/docs/learn/models#foundation_models" + }, "vertex_ai/claude-3-sonnet@20240229": { "max_tokens": 4096, "max_input_tokens": 200000, diff --git a/litellm/tests/test_completion_cost.py b/litellm/tests/test_completion_cost.py index 1daf1531cd..761bd054c8 100644 --- a/litellm/tests/test_completion_cost.py +++ b/litellm/tests/test_completion_cost.py @@ -706,6 +706,18 @@ def test_vertex_ai_completion_cost(): print("calculated_input_cost: {}".format(calculated_input_cost)) +def test_vertex_ai_medlm_completion_cost(): + model="medlm-medium" + messages = [{"role": "user", "content": "Test MedLM completion cost."}] + predictive_cost = completion_cost(model=model, messages=messages) + assert predictive_cost > 0 + + model="medlm-large" + messages = [{"role": "user", "content": "Test MedLM completion cost."}] + predictive_cost = completion_cost(model=model, messages=messages) + assert predictive_cost > 0 + + def test_vertex_ai_claude_completion_cost(): from litellm import Choices, Message, ModelResponse from litellm.utils import Usage