YT-Automation / scratch /test_models.py
Vinoth
feat: switch to Supabase cloud database and optimize for cloud deployment
9d8ff93
Raw History Blame Contribute Delete
815 Bytes
import asyncio
import aiohttp
import os
async def test():
headers = {
'Authorization': f"Bearer {os.getenv('OPENROUTER_API_KEY')}",
'Content-Type': 'application/json'
}
models = [
'meta-llama/llama-3-8b-instruct:free',
'google/gemma-2-9b-it:free',
'mistralai/mistral-7b-instruct:free',
'qwen/qwen-2-7b-instruct:free'
]
async with aiohttp.ClientSession() as s:
for m in models:
payload = {'model': m, 'messages': [{'role':'user','content':'hi'}]}
async with s.post('https://openrouter.ai/api/v1/chat/completions', headers=headers, json=payload) as r:
print(f"Model: {m}, Status: {r.status}")
if r.status != 200:
print(await r.text())
asyncio.run(test())