show_reg2.cjs 997 B

123456789101112131415161718192021
  1. const llm = require('/data/ai/audio/server/dist/services/llm');
  2. const registry = llm.llmRegistry || llm._llmRegistry || null;
  3. let reg = registry;
  4. if (!reg) {
  5. for (const k of Object.keys(llm)) {
  6. if (typeof llm[k] === 'function' && k.startsWith('getLlm')) {
  7. try { reg = llm[k](); if (reg && reg.getStatus) break; } catch {}
  8. }
  9. if (typeof llm[k] === 'object' && llm[k] && llm[k].getStatus) { reg = llm[k]; break; }
  10. }
  11. }
  12. if (!reg) { console.log('NO REGISTRY FOUND, exports:', Object.keys(llm)); process.exit(1); }
  13. console.log('=== Health Status ===');
  14. const statuses = reg.getStatus();
  15. for (const s of statuses) {
  16. console.log(' -', s.name, 'enabled=', s.enabled, 'healthy=', s.healthy, 'failures=', s.consecutiveFailures, 'circuit=', s.circuitState, 'models=', s.modelCount);
  17. }
  18. console.log('=== Available Nodes (textModels head) ===');
  19. for (const node of reg.listAvailable()) {
  20. console.log(' -', node.provider.displayName, 'models:', node.provider.textModels.slice(0, 8));
  21. }