29 lines
1.1 KiB
PHP
29 lines
1.1 KiB
PHP
<?php
|
|
header("Content-Type: application/json");
|
|
$out = [];
|
|
// Find sovereign handler
|
|
$files = [
|
|
"/var/www/html/api/sovereign/v1/chat/completions.php",
|
|
"/var/www/html/api/sovereign/v1/chat/completions/index.php",
|
|
"/var/www/html/api/sovereign.php",
|
|
];
|
|
foreach ($files as $f) $out["file_exists"][basename($f)] = file_exists($f);
|
|
|
|
// nginx config for sovereign
|
|
$nginx = @shell_exec("grep -r 'sovereign' /etc/nginx/ 2>/dev/null | head -10");
|
|
$out["nginx_config"] = trim($nginx);
|
|
|
|
// cascade health
|
|
$ctx = stream_context_create(["http"=>["timeout"=>3]]);
|
|
$out["cascade_4000"] = @file_get_contents("http://127.0.0.1:4000/health", false, $ctx) ?: "DOWN";
|
|
|
|
// Test sovereign directly from server (bypass nginx)
|
|
$test = @file_get_contents("http://127.0.0.1:4000/v1/chat/completions", false, stream_context_create([
|
|
"http"=>["method"=>"POST","header"=>"Content-Type: application/json\r\n",
|
|
"content"=>json_encode(["model"=>"fast","messages"=>[["role"=>"user","content"=>"hi"]],"max_tokens"=>10]),
|
|
"timeout"=>10]
|
|
]));
|
|
$out["direct_cascade_test"] = substr($test ?: "FAILED", 0, 300);
|
|
|
|
echo json_encode($out, JSON_PRETTY_PRINT);
|