fa91b6a170
Add static quota display for Qwen OAuth provider (portal.qwen.ai). Qwen OAuth API does not return rate-limit headers, so this provides a static quota indicator based on known OAuth free-tier limits. Changes: - Add QwenQuotaExtractor in quota_adapter.rs - Parses rate-limit errors for retry backoff - Registered for all Qwen aliases (qwen, qwen-code, dashscope, etc.) - Add Qwen OAuth detection in quota_cli.rs - Auto-detects ~/.qwen/oauth_creds.json - Displays static quota: ?/1000 (unknown remaining, 1000/day total) - Improve quota display formatting - Shows "?/total" when only total limit is known - Add comprehensive test report and testing scripts - Full integration test report: docs/qwen-provider-test-report.md - Model availability, context window, and latency tests - Reusable test scripts in scripts/ directory Test results: - Available model: qwen3-coder-plus (verified) - Context window: ~32K tokens - Average latency: ~2.8s - All 15 quota tests passing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
49 lines
1018 B
Bash
Executable File
49 lines
1018 B
Bash
Executable File
#!/bin/bash
|
|
# Qwen Latency Benchmark
|
|
# Measures average response time for 10 requests
|
|
|
|
set -euo pipefail
|
|
|
|
ITERATIONS=10
|
|
PROVIDER="qwen-code"
|
|
MODEL="qwen3-coder-plus"
|
|
MESSAGE="test latency"
|
|
|
|
echo "=== Qwen Latency Benchmark ==="
|
|
echo "Provider: $PROVIDER"
|
|
echo "Model: $MODEL"
|
|
echo "Iterations: $ITERATIONS"
|
|
echo ""
|
|
|
|
total_time=0
|
|
|
|
for i in $(seq 1 $ITERATIONS); do
|
|
echo -n "Request $i ... "
|
|
|
|
start=$(date +%s.%N)
|
|
|
|
cargo run --release -- agent -p "$PROVIDER" --model "$MODEL" -m "$MESSAGE" > /dev/null 2>&1
|
|
|
|
end=$(date +%s.%N)
|
|
elapsed=$(echo "$end - $start" | bc)
|
|
total_time=$(echo "$total_time + $elapsed" | bc)
|
|
|
|
echo "${elapsed}s"
|
|
|
|
# Small delay to avoid rate limiting
|
|
sleep 0.5
|
|
done
|
|
|
|
echo ""
|
|
echo "=== Results ==="
|
|
avg_time=$(echo "scale=3; $total_time / $ITERATIONS" | bc)
|
|
echo "Total time: ${total_time}s"
|
|
echo "Average latency: ${avg_time}s"
|
|
echo ""
|
|
|
|
if (( $(echo "$avg_time < 5.0" | bc -l) )); then
|
|
echo "✅ PASS: Average latency < 5s"
|
|
else
|
|
echo "⚠️ WARNING: Average latency >= 5s"
|
|
fi
|