SECURITY: fix 10 hardcoded API keys → secrets.env references
This commit is contained in:
2
api/$_IC
2
api/$_IC
@@ -1 +1 @@
|
||||
{"timestamp":"2026-04-05 16:36:30","scan_ms":8140,"servers":{"s204":{"ip":"204.168.152.13","label":"S204 Primary","services":[{"name":"nginx","status":"active","port":"80\/443"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql-16","status":"active","port":"5432"},{"name":"deerflow","status":"inactive","port":"2024"},{"name":"deerflow-gw","status":"inactive","port":"8001"},{"name":"deerflow-fe","status":"inactive","port":"3000"},{"name":"ollama","status":"active","port":"11434","info":"9 models"}],"docker":[{"name":"authentik-db","status":"Up 23 hours"},{"name":"authentik-redis","status":"Up 23 hours"},{"name":"authentik-server","status":"Up 23 hours (healthy)"},{"name":"authentik-worker","status":"Up 23 hours (healthy)"},{"name":"chatwoot-redis","status":"Up 20 hours"},{"name":"flowise","status":"Up 20 hours"},{"name":"langfuse","status":"Up 29 hours"},{"name":"loki","status":"Up 19 hours"},{"name":"mattermost","status":"Up 4 days (healthy)"},{"name":"mirofish","status":"Up 27 hours"},{"name":"n8n","status":"Up 4 days"},{"name":"nocodb","status":"Up 19 hours"},{"name":"node-exporter","status":"Up 2 days"},{"name":"open-webui","status":"Up 3 days (healthy)"},{"name":"plausible-db","status":"Up 3 days"},{"name":"plausible-events","status":"Up 3 days"},{"name":"plausible","status":"Up 19 hours"},{"name":"prometheus","status":"Up 22 hours"},{"name":"qdrant","status":"Up 4 days"},{"name":"searxng","status":"Up 3 hours"},{"name":"twenty-redis","status":"Up 4 days"},{"name":"twenty","status":"Up 4 days"},{"name":"uptime-kuma","status":"Up 3 days (healthy)"},{"name":"vaultwarden","status":"Up 4 days (healthy)"}]},"s95":{"ip":"95.216.167.89","label":"S95 WEVADS","services":[{"name":"kumomta","status":"inactive","port":"587"},{"name":"apache2","status":"active","port":"80"},{"name":"postgresql","status":"active","port":"5432"},{"name":"postfix","status":"active","port":"2525"},{"name":"pmta","status":"inactive","port":"25"},{"name":"sentinel","status":"active","port":"5890"},{"name":"adx","status":"active","port":"5821"},{"name":"arsenal","status":"active","port":"5822"}],"docker":[{"name":"listmonk_db","status":"Up 45 hours"},{"name":"listmonk","status":"Up 45 hours"}]},"s151":{"ip":"151.80.235.110","label":"S151 OVH","services":[{"name":"nginx","status":"active","port":"80"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql","status":"active","port":"5432"},{"name":"ollama","status":"active","port":"11434"}],"docker":[{"name":"ollama","status":"Up 11 days"}]},"blade":{"ip":"local","label":"Razer Blade","services":[{"name":"Sentinel Agent","status":"active","port":"\u2014","info":"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1"}],"docker":[]}},"crons":[{"server":"S95","user":"root","schedule":"*\/30 * * * *","command":"php \/opt\/wevads\/scripts\/ethica\/ethica-validator.php 500 >> \/opt\/wevads\/logs\/ethica-validator.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 *\/4 * * *","command":"php \/opt\/wevads\/scripts\/cron-bounces.php >> \/var\/log\/wevads\/bounces.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 3 * * *","command":"\/root\/backups\/daily_backup.sh","source":"crontab"},{"server":"S95","user":"root","schedule":"0 4 * * *","command":"\/opt\/wevads\/scripts\/auto-backup-github.sh >> \/var\/log\/wevads\/backup.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 0 * * *","command":"php \/opt\/wevads\/scripts\/daily-stats-aggregate.php >> \/var\/log\/wevads\/daily-stats.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 1 * * *","command":"php \/opt\/wevads\/scripts\/cron-engagement.php >> \/var\/log\/wevads\/engagement.log 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/5 * * * *","command":"curl -s -m 10 http:\/\/localhost:11434\/api\/generate -d {model:granite4,prompt:ok,stream:false,keep_alive:-1} > \/dev\/null 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/10 * * * *","command":"docker start openclaw 2>\/dev\/null","source":"crontab"},{"server":"S151","user":"root","schedule":"*\/5 * * * *","command":"\/opt\/tracking_monitor.sh","source":"crontab"},{"server":"Blade","user":"SYSTEM","schedule":"*\/60s loop","command":"sentinel-agent.ps1 (auto-sync S204)","source":"Task Scheduler"}],"stats":{"total_crons":10,"total_services":20,"total_docker":27}}
|
||||
{"timestamp":"2026-04-05 16:38:31","scan_ms":8712,"servers":{"s204":{"ip":"204.168.152.13","label":"S204 Primary","services":[{"name":"nginx","status":"active","port":"80\/443"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql-16","status":"active","port":"5432"},{"name":"deerflow","status":"inactive","port":"2024"},{"name":"deerflow-gw","status":"inactive","port":"8001"},{"name":"deerflow-fe","status":"inactive","port":"3000"},{"name":"ollama","status":"active","port":"11434","info":"9 models"}],"docker":[{"name":"authentik-db","status":"Up 23 hours"},{"name":"authentik-redis","status":"Up 23 hours"},{"name":"authentik-server","status":"Up 23 hours (healthy)"},{"name":"authentik-worker","status":"Up 23 hours (healthy)"},{"name":"chatwoot-redis","status":"Up 20 hours"},{"name":"flowise","status":"Up 20 hours"},{"name":"langfuse","status":"Up 29 hours"},{"name":"loki","status":"Up 19 hours"},{"name":"mattermost","status":"Up 4 days (healthy)"},{"name":"mirofish","status":"Up 27 hours"},{"name":"n8n","status":"Up 4 days"},{"name":"nocodb","status":"Up 19 hours"},{"name":"node-exporter","status":"Up 2 days"},{"name":"open-webui","status":"Up 3 days (healthy)"},{"name":"plausible-db","status":"Up 3 days"},{"name":"plausible-events","status":"Up 3 days"},{"name":"plausible","status":"Up 19 hours"},{"name":"prometheus","status":"Up 22 hours"},{"name":"qdrant","status":"Up 4 days"},{"name":"searxng","status":"Up 4 hours"},{"name":"twenty-redis","status":"Up 4 days"},{"name":"twenty","status":"Up 4 days"},{"name":"uptime-kuma","status":"Up 3 days (healthy)"},{"name":"vaultwarden","status":"Up 4 days (healthy)"}]},"s95":{"ip":"95.216.167.89","label":"S95 WEVADS","services":[{"name":"kumomta","status":"inactive","port":"587"},{"name":"apache2","status":"active","port":"80"},{"name":"postgresql","status":"active","port":"5432"},{"name":"postfix","status":"active","port":"2525"},{"name":"pmta","status":"inactive","port":"25"},{"name":"sentinel","status":"active","port":"5890"},{"name":"adx","status":"active","port":"5821"},{"name":"arsenal","status":"active","port":"5822"}],"docker":[{"name":"listmonk_db","status":"Up 45 hours"},{"name":"listmonk","status":"Up 45 hours"}]},"s151":{"ip":"151.80.235.110","label":"S151 OVH","services":[{"name":"nginx","status":"active","port":"80"},{"name":"php-fpm","status":"active","port":"9000"},{"name":"postgresql","status":"active","port":"5432"},{"name":"ollama","status":"active","port":"11434"}],"docker":[{"name":"ollama","status":"Up 11 days"}]},"blade":{"ip":"local","label":"Razer Blade","services":[{"name":"Sentinel Agent","status":"active","port":"\u2014","info":"C:\\ProgramData\\WEVAL\\sentinel-agent.ps1"}],"docker":[]}},"crons":[{"server":"S95","user":"root","schedule":"*\/30 * * * *","command":"php \/opt\/wevads\/scripts\/ethica\/ethica-validator.php 500 >> \/opt\/wevads\/logs\/ethica-validator.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 *\/4 * * *","command":"php \/opt\/wevads\/scripts\/cron-bounces.php >> \/var\/log\/wevads\/bounces.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"0 3 * * *","command":"\/root\/backups\/daily_backup.sh","source":"crontab"},{"server":"S95","user":"root","schedule":"0 4 * * *","command":"\/opt\/wevads\/scripts\/auto-backup-github.sh >> \/var\/log\/wevads\/backup.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 0 * * *","command":"php \/opt\/wevads\/scripts\/daily-stats-aggregate.php >> \/var\/log\/wevads\/daily-stats.log 2>&1","source":"crontab"},{"server":"S95","user":"root","schedule":"30 1 * * *","command":"php \/opt\/wevads\/scripts\/cron-engagement.php >> \/var\/log\/wevads\/engagement.log 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/5 * * * *","command":"curl -s -m 10 http:\/\/localhost:11434\/api\/generate -d {model:granite4,prompt:ok,stream:false,keep_alive:-1} > \/dev\/null 2>&1","source":"crontab"},{"server":"S151","user":"ubuntu","schedule":"*\/10 * * * *","command":"docker start openclaw 2>\/dev\/null","source":"crontab"},{"server":"S151","user":"root","schedule":"*\/5 * * * *","command":"\/opt\/tracking_monitor.sh","source":"crontab"},{"server":"Blade","user":"SYSTEM","schedule":"*\/60s loop","command":"sentinel-agent.ps1 (auto-sync S204)","source":"Task Scheduler"}],"stats":{"total_crons":10,"total_services":20,"total_docker":27}}
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
// /api/ai-benchmark-live.php — REAL dynamic benchmark
|
||||
header('Content-Type: application/json');
|
||||
header('Access-Control-Allow-Origin: *');
|
||||
@@ -49,7 +50,7 @@ $docker_count = (int)($docker_out[0] ?? 0);
|
||||
$providers_tested = [];
|
||||
$test_providers = [
|
||||
['name' => 'Cerebras', 'url' => 'https://api.cerebras.ai/v1/models', 'key' => 'csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh'],
|
||||
['name' => 'Groq', 'url' => 'https://api.groq.com/openai/v1/models', 'key' => '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'],
|
||||
['name' => 'Groq', 'url' => 'https://api.groq.com/openai/v1/models', 'key' => ($secrets["GROQ_KEY"]??"")],
|
||||
];
|
||||
foreach($test_providers as $prov) {
|
||||
$t0 = microtime(true);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
/**
|
||||
* BLADE AI AGENT LOOP — Pattern #18 (Claude Code Core)
|
||||
*
|
||||
@@ -32,7 +33,7 @@ if (!$goal) { echo json_encode(["error" => "no goal"]); exit; }
|
||||
function callAI($system, $messages, $timeout = 15) {
|
||||
$providers = [
|
||||
["url" => "https://api.cerebras.ai/v1/chat/completions", "key" => "csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh", "model" => "qwen-3-32b"],
|
||||
["url" => "https://api.groq.com/openai/v1/chat/completions", "key" => "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", "model" => "llama-3.3-70b-versatile"],
|
||||
["url" => "https://api.groq.com/openai/v1/chat/completions", "key" => ($secrets["GROQ_KEY"]??""), "model" => "llama-3.3-70b-versatile"],
|
||||
["url" => "https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions", "key" => "sk-34db1ad3152443cd86563d1bfc576c30", "model" => "qwen-plus"],
|
||||
];
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"ts": "2026-04-05T16:36:36+00:00",
|
||||
"ts": "2026-04-05T16:38:15+00:00",
|
||||
"hostname": "LAPTOP-VE75QUHF",
|
||||
"cpu": "90%",
|
||||
"ram": "97% (16GB)",
|
||||
"cpu": "100%",
|
||||
"ram": "94% (16GB)",
|
||||
"disk": "?",
|
||||
"uptime": "5d02h04m",
|
||||
"uptime": "5d02h06m",
|
||||
"user": "Yace",
|
||||
"ip": "41.248.238.98",
|
||||
"agent_version": "2.0"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
require_once __DIR__ . '/_secrets.php';
|
||||
/**
|
||||
* WEVAL AI Chat Proxy v3 — 18 providers + KB + Git + Tools + Ethica
|
||||
@@ -146,7 +147,7 @@ $model_map = [
|
||||
|
||||
// Cloud providers config
|
||||
$cloud_keys = [
|
||||
"groq" => ["https://api.groq.com/openai/v1/chat/completions", "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", "llama-3.3-70b-versatile"],
|
||||
"groq" => ["https://api.groq.com/openai/v1/chat/completions", ($secrets["GROQ_KEY"]??""), "llama-3.3-70b-versatile"],
|
||||
"cerebras" => ["https://api.cerebras.ai/v1/chat/completions", "csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh", "qwen-3-235b-a22b-instruct-2507"],
|
||||
"sambanova" => ["https://api.sambanova.ai/v1/chat/completions", "9541b2a0-6ddc-4e7d-a957-c348d6119c3f", "Meta-Llama-3.3-70B-Instruct"],
|
||||
"openrouter" => ["https://openrouter.ai/api/v1/chat/completions", "sk-or-v1-8b405a50e7dfb2e3cd2c65c94e8dbb92e0f60cb26cf9316f8dd5be69c5ff8e8", "meta-llama/llama-3.3-70b-instruct:free"],
|
||||
@@ -181,7 +182,7 @@ if (isset($cloud_keys[$provider])) {
|
||||
}
|
||||
if (!$response_text || strlen($response_text) < 10) {
|
||||
// Fallback to Groq if DeerFlow fails
|
||||
$response_text = cloud_call("https://api.groq.com/openai/v1/chat/completions", "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", "llama-3.3-70b-versatile", $system, $msg);
|
||||
$response_text = cloud_call("https://api.groq.com/openai/v1/chat/completions", ($secrets["GROQ_KEY"]??""), "llama-3.3-70b-versatile", $system, $msg);
|
||||
}
|
||||
} elseif ($provider === "sambanova") {
|
||||
$response_text = cloud_call("https://api.sambanova.ai/v1/chat/completions", "9541b2a0-6ddc-4e7d-a957-c348d6119c3f", "Meta-Llama-3.3-70B-Instruct", $system, $msg);
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"ts": "20260405_183419", "version": "3.2", "score": 100, "pass": 153, "fail": 0, "total": 153, "elapsed": 37.6, "categories": {"S204": {"pass": 9, "fail": 0}, "S95-WV": {"pass": 12, "fail": 0}, "S95-ARS": {"pass": 17, "fail": 0}, "S95-iR": {"pass": 1, "fail": 0}, "INFRA": {"pass": 5, "fail": 0}, "API": {"pass": 27, "fail": 0}, "SEC": {"pass": 4, "fail": 0}, "S95-BK": {"pass": 6, "fail": 0}, "C2-API": {"pass": 4, "fail": 0}, "C2-SPA": {"pass": 1, "fail": 0}, "C2-WV": {"pass": 3, "fail": 0}, "SSO": {"pass": 25, "fail": 0}, "DATA": {"pass": 5, "fail": 0}, "CRONS": {"pass": 2, "fail": 0}, "BLADE": {"pass": 7, "fail": 0}, "LIFE": {"pass": 3, "fail": 0}, "FUNC": {"pass": 7, "fail": 0}, "01AVR": {"pass": 10, "fail": 0}, "STRUCT": {"pass": 5, "fail": 0}}, "failures": []}
|
||||
{"ts": "20260405_183650", "version": "3.2", "score": 100, "pass": 153, "fail": 0, "total": 153, "elapsed": 41.0, "categories": {"S204": {"pass": 9, "fail": 0}, "S95-WV": {"pass": 12, "fail": 0}, "S95-ARS": {"pass": 17, "fail": 0}, "S95-iR": {"pass": 1, "fail": 0}, "INFRA": {"pass": 5, "fail": 0}, "API": {"pass": 27, "fail": 0}, "SEC": {"pass": 4, "fail": 0}, "S95-BK": {"pass": 6, "fail": 0}, "C2-API": {"pass": 4, "fail": 0}, "C2-SPA": {"pass": 1, "fail": 0}, "C2-WV": {"pass": 3, "fail": 0}, "SSO": {"pass": 25, "fail": 0}, "DATA": {"pass": 5, "fail": 0}, "CRONS": {"pass": 2, "fail": 0}, "BLADE": {"pass": 7, "fail": 0}, "LIFE": {"pass": 3, "fail": 0}, "FUNC": {"pass": 7, "fail": 0}, "01AVR": {"pass": 10, "fail": 0}, "STRUCT": {"pass": 5, "fail": 0}}, "failures": []}
|
||||
File diff suppressed because one or more lines are too long
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
header("Content-Type: application/json");
|
||||
$a=$_GET["action"]??"help";
|
||||
$P=["Groq"=>["u"=>"https://api.groq.com/openai/v1/chat/completions","k"=>"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","m"=>"llama-3.3-70b-versatile"],"Cerebras"=>["u"=>"https://api.cerebras.ai/v1/chat/completions","k"=>"csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh","m"=>"qwen-3-235b-a22b-instruct-2507"]];
|
||||
$P=["Groq"=>["u"=>"https://api.groq.com/openai/v1/chat/completions","k"=>($secrets["GROQ_KEY"]??""),"m"=>"llama-3.3-70b-versatile"],"Cerebras"=>["u"=>"https://api.cerebras.ai/v1/chat/completions","k"=>"csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh","m"=>"qwen-3-235b-a22b-instruct-2507"]];
|
||||
function callp($c,$p){$ch=curl_init($c["u"]);curl_setopt_array($ch,[CURLOPT_RETURNTRANSFER=>1,CURLOPT_TIMEOUT=>15,CURLOPT_POST=>1,CURLOPT_HTTPHEADER=>["Content-Type: application/json","Authorization: Bearer ".$c["k"]],CURLOPT_POSTFIELDS=>json_encode(["model"=>$c["m"],"messages"=>[["role"=>"user","content"=>$p]],"max_tokens"=>400,"temperature"=>0.3])]);$r=curl_exec($ch);$t=curl_getinfo($ch,CURLINFO_TOTAL_TIME);curl_close($ch);$d=json_decode($r,1);return["text"=>$d["choices"][0]["message"]["content"]??"","time"=>round($t,2)];}
|
||||
function score($text,$kws,$ml){$s=0;$t=strtolower($text);foreach($kws as $k){if(strpos($t,strtolower($k))!==false)$s+=round(60/count($kws));}if(strlen($text)>=$ml)$s+=20;elseif(strlen($text)>=$ml/2)$s+=10;if(strlen($text)>20)$s+=10;return min(100,$s);}
|
||||
$tests=["code"=>["p"=>"Write a Python function finding longest palindromic substring","kw"=>["def ","palindrome","return","for ","if "],"ml"=>150],"reasoning"=>["p"=>"A farmer has 17 sheep. All but 9 die. How many left? Step by step.","kw"=>["9","all but","remain","left"],"ml"=>50],"knowledge"=>["p"=>"Explain TCP vs UDP. When use each?","kw"=>["reliable","connection","UDP","packet","stream"],"ml"=>80],"multilingual"=>["p"=>"Translate to French: The quick brown fox jumps over the lazy dog","kw"=>["rapide","brun","renard","chien"],"ml"=>30],"pharma"=>["p"=>"Top 5 pharma companies in North Africa","kw"=>["Sanofi","Pfizer","Novartis","GSK"],"ml"=>80]];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
require_once __DIR__ . '/_secrets.php';
|
||||
/**
|
||||
* WEDROID Brain API v5 — Ollama-First Sovereign AI Agent
|
||||
@@ -42,7 +43,7 @@ $CEREBRAS_KEY = "csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh";
|
||||
$CEREBRAS_MODEL = "qwen-3-235b-a22b-instruct-2507";
|
||||
$CEREBRAS_URL = "https://api.cerebras.ai/v1/chat/completions";
|
||||
|
||||
$GROQ_KEY = "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";
|
||||
$GROQ_KEY = ($secrets["GROQ_KEY"]??"");
|
||||
$GROQ_MODEL = "llama-3.3-70b-versatile";
|
||||
$GROQ_URL = "https://api.groq.com/openai/v1/chat/completions";
|
||||
|
||||
@@ -51,7 +52,7 @@ $CEREBRAS_KEYS = [
|
||||
"csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh",
|
||||
];
|
||||
$GROQ_KEYS = [
|
||||
"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",
|
||||
($secrets["GROQ_KEY"]??""),
|
||||
];
|
||||
|
||||
// ADDITIONAL PROVIDERS
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$secrets=[];foreach(file("/etc/weval/secrets.env",2|4) as $l){if(strpos($l,"=")!==false){list($k,$v)=explode("=",$l,2);$secrets[trim($k)]=trim($v," \t\"'");}}
|
||||
require_once __DIR__ . '/_secrets.php';
|
||||
/**
|
||||
* WEVAL Manager v3 - Unified AI Brain (100% Opus Target)
|
||||
@@ -440,7 +441,7 @@ function select_provider($intent, $complexity) {
|
||||
"key"=>"9541b2a0-6ddc-4e7d-a957-c348d6119c3f","model"=>"Meta-Llama-3.3-70B-Instruct"];
|
||||
$groq = ["name"=>"Groq/LLaMA-70B","type"=>"cloud",
|
||||
"url"=>"https://api.groq.com/openai/v1/chat/completions",
|
||||
"key"=>"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","model"=>"llama-3.3-70b-versatile"];
|
||||
"key"=>($secrets["GROQ_KEY"]??""),"model"=>"llama-3.3-70b-versatile"];
|
||||
$meditron = ["name"=>"Ollama/Meditron","type"=>"local","model"=>"meditron:7b"];
|
||||
|
||||
if ($intent === "medical") return $meditron;
|
||||
@@ -621,7 +622,7 @@ function ollama_call($model, $system, $msg) {
|
||||
function cloud_call_chain($system, $msg) {
|
||||
// Fallback chain: Groq 8s -> Cerebras 6s -> SambaNova 6s -> Alibaba 10s
|
||||
$providers = [
|
||||
["https://api.groq.com/openai/v1/chat/completions", "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", "llama-3.3-70b-versatile", 8],
|
||||
["https://api.groq.com/openai/v1/chat/completions", ($secrets["GROQ_KEY"]??""), "llama-3.3-70b-versatile", 8],
|
||||
["https://api.cerebras.ai/v1/chat/completions", "csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh", "qwen-3-235b-a22b-instruct-2507", 6],
|
||||
["https://api.sambanova.ai/v1/chat/completions", "9541b2a0-6ddc-4e7d-a957-c348d6119c3f", "Meta-Llama-3.3-70B-Instruct", 6],
|
||||
["https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions", "sk-34db1ad3152443cd86563d1bfc576c30", "qwen-plus", 10],
|
||||
@@ -654,7 +655,7 @@ function consensus_ask($msg, $system) {
|
||||
$providers = [
|
||||
["n"=>"alibaba","u"=>"https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions","k"=>"sk-34db1ad3152443cd86563d1bfc576c30","m"=>"qwen-plus"],
|
||||
["n"=>"cerebras","u"=>"https://api.cerebras.ai/v1/chat/completions","k"=>"csk-4wrrhkpr568ry9xx49k9mcynwdx483nx53dd62yh5xedfckh","m"=>"qwen-3-235b-a22b-instruct-2507"],
|
||||
["n"=>"groq","u"=>"https://api.groq.com/openai/v1/chat/completions","k"=>"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","m"=>"llama-3.3-70b-versatile"]
|
||||
["n"=>"groq","u"=>"https://api.groq.com/openai/v1/chat/completions","k"=>($secrets["GROQ_KEY"]??""),"m"=>"llama-3.3-70b-versatile"]
|
||||
];
|
||||
$base = ["messages"=>[["role"=>"system","content"=>$system],["role"=>"user","content"=>$msg]],"max_tokens"=>3000,"stream"=>false];
|
||||
$mh = curl_multi_init();
|
||||
|
||||
Reference in New Issue
Block a user