Files
macos-tools/ai/ai-cli/test_models.py
bruno 6ebfb24fd9 fix: Update runner Docker socket configuration and Gitea instance URL
- Changed docker-compose.yml to mount OrbStack Docker socket path (/Users/brunogao/.orbstack/run/docker.sock)
- Updated GITEA_INSTANCE_URL to use 192.168.1.83:33000 instead of gitea:3000 for proper DNS resolution
- Both runner-docker and runner-k8s now correctly point to OrbStack Docker daemon
- This resolves the 'Cannot connect to the Docker daemon' error and DNS resolution failures
2025-11-13 17:59:28 +08:00

42 lines
1.1 KiB
Python

import requests
import os
import json
def test_model_access(model_id):
api_key = os.getenv('OPENROUTER_API_KEY')
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
messages = [
{"role": "user", "content": "Test"}
]
payload = {
'model': model_id,
'messages': messages,
}
try:
response = requests.post("https://openrouter.ai/api/v1/chat/completions", headers=headers, json=payload)
print(f"Model {model_id}: Status {response.status_code}")
if response.status_code != 200:
print(f" Error: {response.text}")
else:
print(f" Success: Model accessible")
return response.status_code
except Exception as e:
print(f"Model {model_id}: Exception {str(e)}")
return None
# Test different models
test_models = [
"anthropic/claude-sonnet-4.5",
"anthropic/claude-haiku-4.5",
"anthropic/claude-3.5-sonnet",
"anthropic/claude-3.5-haiku"
]
for model in test_models:
test_model_access(model)