Commit 8a1a68f
committed
server: make NativeServer the default fat-jar Main-Class (keep OpenAiCompatServer)
Two runnable server mains now exist. The fat jar's default Main-Class becomes
NativeServer, so `java -jar …-jar-with-dependencies.jar -m model.gguf --port 8080`
runs the full native llama.cpp server with its embedded WebUI, forwarding every
argument. OpenAiCompatServer is unchanged and still runnable via
`java -cp <jar> net.ladenthin.llama.server.OpenAiCompatServer …`.
- NativeServer.main(args): forwards argv, starts the server, registers a JVM
shutdown hook (the embedded server installs no signal handlers of its own — see
patches/0006 — so the hook is what stops it cleanly on Ctrl-C/SIGTERM), and
blocks until the native worker exits.
- llama/pom.xml assembly profile: Main-Class OpenAiCompatServer -> NativeServer.
- README + CLAUDE.md: document the two modes and how to select each.
Verified end-to-end (Linux x86_64, synthetic granitehybrid): `java -cp … NativeServer
-m model --port 8972` serves /health=ok after load; SIGTERM to the JVM fires the
shutdown hook -> clean "cleaning up before exit" -> port down. Javadoc + spotless
clean; 7 pure-Java NativeServer tests pass.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HL7d4uQ3cKR5HwYFPvZvv71 parent 3c8aeb8 commit 8a1a68f
4 files changed
Lines changed: 68 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
839 | | - | |
| 839 | + | |
840 | 840 | | |
841 | 841 | | |
842 | 842 | | |
| |||
853 | 853 | | |
854 | 854 | | |
855 | 855 | | |
856 | | - | |
857 | | - | |
| 856 | + | |
| 857 | + | |
858 | 858 | | |
859 | 859 | | |
860 | 860 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| |||
591 | 591 | | |
592 | 592 | | |
593 | 593 | | |
594 | | - | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
595 | 597 | | |
596 | 598 | | |
597 | 599 | | |
| |||
646 | 648 | | |
647 | 649 | | |
648 | 650 | | |
649 | | - | |
650 | | - | |
651 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
652 | 654 | | |
653 | 655 | | |
654 | | - | |
655 | | - | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
656 | 659 | | |
657 | 660 | | |
658 | | - | |
| 661 | + | |
659 | 662 | | |
660 | 663 | | |
661 | 664 | | |
| |||
716 | 719 | | |
717 | 720 | | |
718 | 721 | | |
719 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
720 | 733 | | |
721 | 734 | | |
722 | 735 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1296 | 1296 | | |
1297 | 1297 | | |
1298 | 1298 | | |
1299 | | - | |
1300 | | - | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
1301 | 1303 | | |
1302 | 1304 | | |
1303 | 1305 | | |
| |||
1314 | 1316 | | |
1315 | 1317 | | |
1316 | 1318 | | |
1317 | | - | |
| 1319 | + | |
1318 | 1320 | | |
1319 | 1321 | | |
1320 | 1322 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
183 | 221 | | |
184 | 222 | | |
185 | 223 | | |
| |||
0 commit comments