mirror of
https://github.com/invariantlabs-ai/invariant-gateway.git
synced 2026-02-12 14:32:45 +00:00
fix: removing gemini from litellm for now, it is breaking
This commit is contained in:
@@ -160,15 +160,11 @@ import random
|
||||
import os
|
||||
|
||||
base_url = "/api/v1/gateway/litellm/{add-your-dataset-name-here}"
|
||||
EXAMPLE_MODELS = ["openai/gpt-4o", "gemini/gemini-2.5-flash-preview-09-2025", "anthropic/claude-3-5-haiku-20241022"]
|
||||
EXAMPLE_MODELS = ["openai/gpt-4o", "anthropic/claude-3-5-haiku-20241022"]
|
||||
model = random.choice(SAMPLE_MODELS)
|
||||
|
||||
base_url += "/" + model.split("/")[0] # append /gemini /openai or /anthropic.
|
||||
|
||||
if model.split("/")[0] == "gemini":
|
||||
base_url += f"/v1beta/models/{model.split('/')[1]}" # gemini expects the model name in the url.
|
||||
|
||||
|
||||
chat_response = completion(
|
||||
model=model,
|
||||
messages=[{"role": "user", "content": "What is the capital of France?"}],
|
||||
|
||||
@@ -10,7 +10,6 @@ from litellm import completion
|
||||
|
||||
MODEL_API_KEYS = {
|
||||
"openai/gpt-4o": "OPENAI_API_KEY",
|
||||
"gemini/gemini-2.5-flash-preview-09-2025": "GEMINI_API_KEY",
|
||||
"anthropic/claude-3-5-haiku-20241022": "ANTHROPIC_API_KEY",
|
||||
}
|
||||
|
||||
@@ -46,8 +45,6 @@ async def test_chat_completion(
|
||||
)
|
||||
|
||||
base_url += "/" + litellm_model.split("/")[0] # add provider name
|
||||
if litellm_model.split("/")[0] == "gemini":
|
||||
base_url += f"/v1beta/models/{litellm_model.split('/')[1]}" # gemini expects the model name in the url
|
||||
|
||||
chat_response = completion(
|
||||
model=litellm_model,
|
||||
|
||||
Reference in New Issue
Block a user