~/talk

Practical LLM Inference in Modern Java

Talkat Devoxx Belgium 2024 · 2024-10-07..10-11· [large-language-models, java]
links:none on file
slides:none on file

Shows a working local LLM inference engine written in a pure Java single-file engine (≈2,200 lines) that runs Llama 2/3 and other open models on CPU using Java 21+ features, the Vector API and GraalVM native-image. Demonstrates 32–48 tokens/sec on a 1B Llama 3.2 (earlier 7B run was ~1.5 tokens/sec), explains quantization tradeoffs (16-bit ~3.1 t/s, 8.5-bit ≈2×, 4.5-bit ≈3.5×) and human comfort at 5–8 tokens/sec. Output artifacts are tiny — 73 KB jar and 23 MB native exe — and the Java build sometimes outperforms llama.cpp while integrating with LangChain4j.

AI-written summary · about

  1. 0:00Introduction to project
  2. 0:28Speaker background
  3. 1:01Presentation overview
  4. 2:13Project history and origin
  5. 3:36Llama 3 Java project
  6. 4:46Small language models
  7. 6:19LLMs everywhere
  8. 7:55Initial chat demo
  9. 9:22Benefits of local Java
  10. 10:23LLM engine components
  11. 12:56Transformer architecture
  12. 15:27LLM weights explained
  13. 16:08Inference cost analysis
  14. 17:32Memory bandwidth importance
  15. 19:15Performance bottlenecks
  16. 20:10Java code implementation
  17. 21:59Code size and complexity
  18. 22:59Model quantization
  19. 25:14Performance metrics
  20. 27:30Why Java and GraalVM
  21. 28:34Vector API in GraalVM
  22. 30:14JIT and AOT performance
  23. 31:10Native Image advantages
  24. 32:12Native Image demo
  25. 34:09Native executable chat
  26. 35:10AOT model pre-loading
  27. 38:31LangChain4j integration
  28. 40:41Benchmark results
  29. 42:53Apples to apples comparison
  30. 44:27JVM outperforming native
  31. 45:47Supporting other models
  32. 47:38Future work and GPU
  33. 49:22Conclusion and Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.