This repository was archived by the owner on Dec 20, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathtest_providers_summary.sh
More file actions
executable file
·75 lines (64 loc) · 1.98 KB
/
test_providers_summary.sh
File metadata and controls
executable file
·75 lines (64 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
# Test summary for all providers
source ~/.env
echo "ExLLM Provider Test Summary"
echo "==========================="
echo ""
# Test each provider with basic chat
providers=(
"openai"
"anthropic"
"groq"
"xai"
"gemini"
"openrouter"
"mistral"
"perplexity"
"ollama"
"lmstudio"
"mock"
)
# Track results
working=()
failed=()
for provider in "${providers[@]}"; do
echo -n "Testing $provider... "
# Run the test and capture output
output=$(PROVIDER=$provider timeout 15 elixir example_app.exs basic-chat "Hello! What's 2+2?" 2>&1)
if echo "$output" | grep -q "Response:"; then
echo "✅ WORKING"
working+=($provider)
# Extract key info
response=$(echo "$output" | grep "Response:" | sed 's/Response: //')
tokens=$(echo "$output" | grep "Total:" | head -1 | sed 's/.*Total: //')
cost=$(echo "$output" | grep "Cost:" -A1 | tail -1 | sed 's/.*Total: //')
echo " Response: $response"
echo " Tokens: $tokens"
echo " Cost: $cost"
elif echo "$output" | grep -q "Error:"; then
echo "❌ ERROR"
failed+=($provider)
error=$(echo "$output" | grep "Error:" | head -1)
echo " $error"
elif [ $? -eq 124 ]; then
echo "⏱️ TIMEOUT"
failed+=($provider)
else
echo "❌ FAILED"
failed+=($provider)
# Show first error line
echo "$output" | grep -E "(error|Error|failed)" | head -1 | sed 's/^/ /'
fi
echo ""
done
# Summary
echo "==========================="
echo "Summary:"
echo " Working: ${#working[@]} providers (${working[@]})"
echo " Failed: ${#failed[@]} providers (${failed[@]})"
echo ""
# Test streaming with a working provider
if [ ${#working[@]} -gt 0 ]; then
echo "Testing streaming with ${working[0]}..."
echo "Tell me a very short joke" | PROVIDER=${working[0]} timeout 15 elixir example_app.exs 2>&1 | grep -A5 "Streaming Chat" | tail -5
fi