Files
litellm-config/scripts/test.py
T

28 lines
964 B
Python

import httpx, json
# Test each provider
tests = [
("openrouter-1", "openai/gpt-4o-mini"),
("openrouter-2", "openai/gpt-4o-mini"),
("openrouter-3", "openai/gpt-4o-mini"),
("groq-1", "llama-3.3-70b-versatile"),
("groq-2", "llama-3.1-8b-instant"),
("groq-3", "llama-3.1-8b-instant"),
("gemini-1", "gemini-2.0-flash-exp"),
]
for provider, model in tests:
try:
r = httpx.post(
"http://localhost:4000/v1/chat/completions",
json={"model": model, "messages": [{"role": "user", "content": "hai"}], "max_tokens": 10},
timeout=30
)
if r.status_code == 200:
content = r.json().get("choices", [{}])[0].get("message", {}).get("content", "")
print(f"✅ {provider} ({model}): {content[:50]}")
else:
print(f"❌ {provider} ({model}): HTTP {r.status_code}")
except Exception as e:
print(f"❌ {provider} ({model}): {str(e)[:60]}")