Rencetly I've been trying to benchmark perplexity/r1-1776 model, but:
- In responses there's a ton of whitespace looking like this in front of the actual json text:
00000000 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 | .. |
00000010 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20 0a | .. .|
00000020 0a 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 |. .. |
00000030 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 20 | .. |
00000040 0a 0a 20 20 20 20 20 20 20 20 20 0a 0a 20 20 20 |.. .. |
00000050 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 20 | .. |
00000060 20 0a 0a 20 20 20 20 20 20 20 20 20 0a 0a 20 20 | .. .. |
00000070 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 20 | .. |
00000080 20 20 0a 0a 20 20 20 20 20 20 20 20 20 0a 0a 20 | .. .. |
00000090 20 20 20 20 20 20 20 20 0a 0a 20 20 20 20 20 20 | .. |
All are spaces and line feed characters. Example responses in attachments were saved with the code below (no processing at all after post() call):
response = requests.post(
url = "https://openrouter.ai/api/v1/chat/completions",
headers = { "Authorization": f"Bearer {api_key}" },
data=json.dumps(request_data),
)
if is_verbose:
with open(f"/tmp/{quiz_id}-response.txt", "w") as f:
f.write(response.text);
print(f"[{quiz_id}] Response: {response.text.strip()}", file=sys.stderr)
- For longer prompts sometimes all I get are the mentioned whitespace characters, there's no json in response (response.text.strip() is empty). Then I get json parse errors and of course my money still gets eaten.
Please fix this crap.