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]

test fixes for vertex mistral, this model was deprecated on vertex

Ishaan Jaff198922b26f50
diff --git a/tests/local_testing/test_text_completion.py b/tests/local_testing/test_text_completion.py
index 697c3fc7109..675f941b0e5 100644
--- a/tests/local_testing/test_text_completion.py
+++ b/tests/local_testing/test_text_completion.py
@@ -4112,98 +4112,6 @@ async def test_async_text_completion_chat_model_stream():
# asyncio.run(test_async_text_completion_chat_model_stream())
[email protected]("model", ["vertex_ai/mistral-nemo@2407"]) #
-async def test_completion_codestral_fim_api(model):
- try:
- from test_amazing_vertex_completion import (
- load_vertex_ai_credentials,
- )
-
- load_vertex_ai_credentials()
-
- litellm.set_verbose = True
- import logging
-
- from litellm._logging import verbose_logger
-
- verbose_logger.setLevel(level=logging.DEBUG)
- response = await litellm.atext_completion(
- model=model,
- prompt="def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
- suffix="return True",
- temperature=0,
- top_p=1,
- max_tokens=10,
- min_tokens=10,
- seed=10,
- stop=["return"],
- )
- # Add any assertions here to check the response
- print(response)
-
- assert response.choices[0].text is not None
-
- # cost = litellm.completion_cost(completion_response=response)
- # print("cost to make mistral completion=", cost)
- # assert cost > 0.0
- except litellm.ServiceUnavailableError:
- print("got ServiceUnavailableError")
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
- "model",
- ["vertex_ai/mistral-nemo@2407"],
-)
-async def test_completion_codestral_fim_api_stream(model):
- try:
- from test_amazing_vertex_completion import (
- load_vertex_ai_credentials,
- )
-
- load_vertex_ai_credentials()
- import logging
-
- from litellm._logging import verbose_logger
-
- litellm.set_verbose = False
-
- # verbose_logger.setLevel(level=logging.DEBUG)
- response = await litellm.atext_completion(
- model=model,
- prompt="def is_odd(n): \n return n % 2 == 1 \ndef test_is_odd():",
- suffix="return True",
- temperature=0,
- top_p=1,
- stream=True,
- seed=10,
- stop=["return"],
- )
-
- full_response = ""
- # Add any assertions here to check the response
- async for chunk in response:
- print(chunk)
- full_response += chunk.get("choices")[0].get("text") or ""
-
- print("full_response", full_response)
- # cost = litellm.completion_cost(completion_response=response)
- # print("cost to make mistral completion=", cost)
- # assert cost > 0.0
- except litellm.APIConnectionError as e:
- print(e)
- pass
- except litellm.ServiceUnavailableError as e:
- print(e)
- pass
- except Exception as e:
- pytest.fail(f"Error occurred: {e}")
-
-
def mock_post(*args, **kwargs):
mock_response = MagicMock()
mock_response.status_code = 200