()
| 86 | |
| 87 | |
| 88 | def shutdown(): |
| 89 | # Stop system monitor |
| 90 | try: |
| 91 | get_monitor().stop() |
| 92 | except Exception: |
| 93 | pass |
| 94 | # If daemon is running, leave llama-server alive for it |
| 95 | if _daemon_is_running(): |
| 96 | return |
| 97 | # Unload model and kill llama-server on port 8080 |
| 98 | try: |
| 99 | from core.loader_v2 import get_loader |
| 100 | get_loader().unload() |
| 101 | except Exception: |
| 102 | pass |
| 103 | # SIGKILL any remaining llama-server |
| 104 | try: |
| 105 | import subprocess |
| 106 | subprocess.run(["pkill", "-9", "-f", "llama-server"], capture_output=True, timeout=5) |
| 107 | except Exception: |
| 108 | pass |
| 109 | |
| 110 | def run_init(): |
| 111 | from core.project import detect_project |
no test coverage detected