ATHENEAV2-Q6 / test_api.py
Anthony Pacheco
Add Modal GPU T4 deployment files for faster inference
ce48984
Raw
History Blame Contribute Delete
1.1 kB
"""Test ATHENEA Modal endpoint"""
import requests
import json
URL = "https://anthonypacheco289--athenea-v2-atheneaapi-serve.modal.run"
API_KEY = "sk-athenea-v2-2026"
headers = {
"Authorization": f"Bearer {API_KEY}",
"Content-Type": "application/json"
}
# Test 1: Health
print("=== Testing /health ===")
try:
r = requests.get(f"{URL}/health", timeout=60)
print(f"Status: {r.status_code}")
print(r.json())
except Exception as e:
print(f"Error: {e}")
# Test 2: Chat Completions
print("\n=== Testing /v1/chat/completions ===")
payload = {
"model": "atheneav2-j-q6_k",
"messages": [
{"role": "user", "content": "Hola, quien eres?"}
],
"temperature": 0.7,
"max_tokens": 256
}
try:
r = requests.post(f"{URL}/v1/chat/completions", headers=headers, json=payload, timeout=120)
print(f"Status: {r.status_code}")
if r.status_code == 200:
result = r.json()
print(f"Response: {result['choices'][0]['message']['content'][:300]}...")
else:
print(f"Error: {r.text}")
except Exception as e:
print(f"Error: {e}")