Skip to content

Commit e36f631

Browse files
committed
docs: README + CLAUDE.md system-properties reference deep-scan
A complete sweep of src/main and src/test for every net.ladenthin.llama.* system property the library understands, with each property's default value and concrete consumer attached. The previous README table covered only 5 of the 9 properties (the 4 test-only nomic + vision properties were undocumented in user-facing docs) and described the 5 it did cover as "all resolved by LlamaSystemProperties" - which the scan showed to be incorrect. README changes: - Replaces the 5-row "System Properties Reference" table with a 9-row table covering every net.ladenthin.llama.* property the library understands. Columns added: Default value, Scope (runtime vs test), and Consumer (which production class or test class reads the property). Test-only properties (nomic.path, vision.model, vision.mmproj, vision.image) and the runtime-but-tests-also (test.ngl) are now visible to users without having to read CLAUDE.md or grep the source. - "All ... resolved by LlamaSystemProperties" claim corrected: only runtime properties go through the registry, and even there two inconsistencies exist (see CLAUDE.md TODO). - Adds the MultimodalIntegrationTest self-skip note so users understand a partial vision setup still loads. CLAUDE.md changes: - The "Optional models" mini-table now cross-links to the README reference instead of being the only place the 4 test-only properties are documented. Mini-table kept (model paths + the issue numbers it regresses) since that's deeper context than the README needs. - New TODO entry flags the two source-side inconsistencies the scan surfaced: (1) LlamaSystemProperties.getLibName() is declared but zero production callers reach it - either wire it into LlamaLoader's filename-resolution path or delete it as dead code; (2) OSInfo.java:390 reads "net.ladenthin.llama.osinfo.architecture" directly via the literal string, bypassing the registry's getOsinfoArchitecture() getter. Same single-source-of-truth smell as the recent BAF Radix.HEX consolidation; routing OSInfo through the registry getter is a small follow-up. Deep-scan inventory (9 properties total): Runtime (resolved via LlamaSystemProperties, with caveats above): net.ladenthin.llama.lib.path -> LlamaLoader:92 net.ladenthin.llama.lib.name -> (declared, zero callers) net.ladenthin.llama.tmpdir -> LlamaLoader:250 net.ladenthin.llama.osinfo.architecture -> OSInfo:390 (literal, bypasses registry) Test (declared in TestConstants): net.ladenthin.llama.test.ngl -> 8 test classes via Integer.getInteger net.ladenthin.llama.nomic.path -> LlamaEmbeddingsTest net.ladenthin.llama.vision.model -> MultimodalIntegrationTest net.ladenthin.llama.vision.mmproj -> MultimodalIntegrationTest net.ladenthin.llama.vision.image -> MultimodalIntegrationTest No source / test changes; doc-only commit.
1 parent e673471 commit e36f631

2 files changed

Lines changed: 24 additions & 10 deletions

File tree

CLAUDE.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,11 @@ mvn test -Dtest=LlamaModelTest#testGenerateAnswer
264264
```
265265

266266
**Optional models** referenced by individual tests are gated on a system
267-
property so CI can skip them cleanly when the GGUF is not downloaded:
267+
property so CI can skip them cleanly when the GGUF is not downloaded.
268+
The full property → consumer → default table for every `net.ladenthin.llama.*`
269+
property the library understands (runtime + test) is the user-facing
270+
**[System Properties Reference](README.md#system-properties-reference)** in
271+
the README. The summary below covers only the optional-model bindings:
268272

269273
| Property | Default test that uses it | Model |
270274
|----------|---------------------------|-------|
@@ -684,6 +688,10 @@ See [`../workspace/policies/jqwik-prompt-injection.md`](../workspace/policies/jq
684688
685689
- **Cross-repo code-quality TODOs** — see [`../workspace/policies/code-quality-todos.md`](../workspace/policies/code-quality-todos.md) for the canonical `@VisibleForTesting` design-fit review, package hierarchy review, and class/method naming review. This repo has no `@VisibleForTesting` usages today; package and naming reviews remain open.
686690
691+
- **`LlamaSystemProperties` registry cleanup (deep-scan finding).** The deep scan that produced the README [System Properties Reference](README.md#system-properties-reference) surfaced two small inconsistencies between the registry class and its actual consumers — worth a focused cleanup but low priority:
692+
- `LlamaSystemProperties.getLibName()` is **declared but has zero callers** in `src/main/java`. Either wire it into `LlamaLoader`'s filename-resolution path (so `-Dnet.ladenthin.llama.lib.name=…` actually does something), or delete the getter as dead code. The README table documents the property as "currently no production caller" so users are not misled in the meantime.
693+
- `OSInfo.java:390` reads `System.getProperty("net.ladenthin.llama.osinfo.architecture")` directly with the literal string, **bypassing** `LlamaSystemProperties.getOsinfoArchitecture()`. The duplication parallels the recent BAF `Radix.HEX` consolidation: the registry-side getter exists but is not the single source of truth. Route `OSInfo` through the registry getter so a future property rename only has to land in one place.
694+
687695
- ~~**Abstract the Java and test writing guidelines to a workspace-level shared layer.**~~ **DONE.** This repo is Java 8; follow the workspace version chain at [`../workspace/guides/src/CODE_WRITING_GUIDE-8.md`](../workspace/guides/src/CODE_WRITING_GUIDE-8.md) and [`../workspace/guides/test/TEST_WRITING_GUIDE-8.md`](../workspace/guides/test/TEST_WRITING_GUIDE-8.md). Canonical TDD skill at [`../workspace/.claude/skills/java-tdd-guide/SKILL.md`](../workspace/.claude/skills/java-tdd-guide/SKILL.md). This repo has no project-specific writing-guide supplements.
688696
689697
- **Feature backlog from similar projects.** See [`docs/feature-investigation-similar-projects.md`](docs/feature-investigation-similar-projects.md) for the consolidated investigation across the 5 pure-Java sibling runtimes ([llama3.java](https://github.com/mukel/llama3.java), [gemma4.java](https://github.com/mukel/gemma4.java), [gptoss.java](https://github.com/mukel/gptoss.java), [qwen35.java](https://github.com/mukel/qwen35.java), [nemotron3.java](https://github.com/mukel/nemotron3.java)) plus the dormant alternative JNI binding [llamacpp4j](https://github.com/sebicom/llamacpp4j). The doc captures 18 candidate items grouped into cross-cutting themes (UTF-8 streaming boundary safety, thinking-channel router, operator timing line, jbang single-file example, README system-properties table, etc.) and per-repo unique findings (Harmony channel decoder, Qwen empty-`<think>` injection, llama_state_* save/load, llama_adapter_lora_* hot-apply, etc.), each with effort sizing (XS / S / M / L) and a prioritised backlog. **Recommended first batch** (items 1, 3, 4, 5): UTF-8 boundary-safe streaming decoder + per-run timing line + one jbang-runnable example + a README system-properties table; ~1-2 days total, no JNI changes.

README.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,15 +249,21 @@ The application will search in the following order in the following locations:
249249

250250
#### System Properties Reference
251251

252-
All `net.ladenthin.llama.*` system properties are resolved by `LlamaSystemProperties`.
253-
254-
| Property | Description |
255-
|---|---|
256-
| `net.ladenthin.llama.lib.path` | Directory containing the native `jllama` shared library. Checked first, before `java.library.path`. |
257-
| `net.ladenthin.llama.lib.name` | Override the native library filename (default is platform-determined, e.g. `jllama.so`). |
258-
| `net.ladenthin.llama.tmpdir` | Custom temporary directory used when extracting the native library from the JAR. Falls back to `java.io.tmpdir`. |
259-
| `net.ladenthin.llama.osinfo.architecture` | Override the OS/architecture string used to locate the bundled library inside the JAR (e.g. `Linux/x86_64`). Useful for non-standard JVM environments. |
260-
| `net.ladenthin.llama.test.ngl` | Number of GPU layers used during testing. Parsed by the test suite; not relevant for production use. |
252+
Every `net.ladenthin.llama.*` system property recognised by the library, deep-scanned from the source. Runtime properties are resolved through `LlamaSystemProperties`; test-only properties are declared in the test sources (`TestConstants`) and consumed by individual test classes.
253+
254+
| Property | Default | Scope | Consumer | Description |
255+
|---|---|---|---|---|
256+
| `net.ladenthin.llama.lib.path` | unset (falls back to `java.library.path`) | runtime | `LlamaLoader` | Directory containing the native `jllama` shared library. Checked first, before `java.library.path`. Set with `-Dnet.ladenthin.llama.lib.path=/path/to/dir`. |
257+
| `net.ladenthin.llama.lib.name` | unset (platform-determined, e.g. `jllama.so`) | runtime | `LlamaSystemProperties.getLibName()` (declared, currently no production caller) | Override for the native library filename. |
258+
| `net.ladenthin.llama.tmpdir` | unset (falls back to `java.io.tmpdir`) | runtime | `LlamaLoader` | Custom temporary directory used when extracting the native library from the JAR. |
259+
| `net.ladenthin.llama.osinfo.architecture` | unset (uses `os.arch`) | runtime | `OSInfo` | Override for the architecture string used to locate the bundled library inside the JAR. Useful when `os.arch` reports an unexpected value (e.g. inside dockcross / chrooted environments). |
260+
| `net.ladenthin.llama.test.ngl` | `43` | test | `LlamaModelTest`, `RerankingModelTest`, `ChatScenarioTest`, `ChatAdvancedTest`, `ErrorHandlingTest`, `SessionConcurrencyTest`, `ConfigureParallelInferenceTest`, `MultimodalIntegrationTest` (via `Integer.getInteger(TestConstants.PROP_TEST_NGL, TestConstants.DEFAULT_TEST_NGL)`) | Number of GPU layers used during testing. Pin to `0` on CPU-only hosts: `mvn test -Dnet.ladenthin.llama.test.ngl=0`. |
261+
| `net.ladenthin.llama.nomic.path` | unset (test self-skips) | test | `LlamaEmbeddingsTest#testNomicEmbedLoads` | Path to a Nomic embedding model (`nomic-embed-text-v1.5.f16.gguf` or a compatible BERT-family encoder). Regression test for upstream issue #98 (BERT-encoder `result_output` assertion). |
262+
| `net.ladenthin.llama.vision.model` | unset (test self-skips) | test | `MultimodalIntegrationTest` (closes #103 / #34) | Path to a vision-capable model GGUF. Any vision-capable GGUF works; CI default is `SmolVLM-500M-Instruct-Q8_0.gguf`. |
263+
| `net.ladenthin.llama.vision.mmproj` | unset (test self-skips) | test | `MultimodalIntegrationTest` | Matching mmproj GGUF for the vision model. |
264+
| `net.ladenthin.llama.vision.image` | `src/test/resources/images/test-image.jpg` (a CC-BY-4.0 / MIT-granted photo committed to the repo) | test | `MultimodalIntegrationTest` | Visual prompt image. Any png/jpeg/webp/gif works; the extension drives MIME detection. |
265+
266+
`MultimodalIntegrationTest` self-skips when any of the three `vision.*` properties points at a missing path, so a partial setup (just the vision model + the committed image, no mmproj) lets the test class load without erroring.
261267

262268
## Documentation
263269

0 commit comments

Comments
 (0)