v1.8.0
[1.8.0] - 2026-09-03
Fixed — Android native inference is now real end-to-end
The Android stack previously stopped at placeholder JNI calls and stubbed
HTTP responses. The full chain now runs real tokens:
HTTP → LocalApiServer → LlamaCppBridge → JNI → llama.cpp → GGUF.
platforms/android/app/src/main/cpp/llama_jni.cpp— rewritten against
the pinned llama.cpp (b10795) C API:llama_model_load_from_file/
llama_init_from_modelsession creation, vocab-based
llama_tokenize/llama_token_to_piece,llama_decodebatching via
llama_batch_get_one, and a proper sampler chain
(penalties → top_k → top_p → temp → dist) sampled with
llama_sampler_sample. Per-session state (ShugoSession: model, context,
vocab, KV position, pending-UTF-8 buffer) replaces the previous mutable
globals;nativeDrainflushes partial multi-byte characters at
end-of-generation so streamed text is never corrupted mid-codepoint.CMakeLists.txt— rewritten: valid CMake syntax, static llama/ggml
linked intolibllama_jni.so, optional Vulkan GPU offload
(-DSHUGOCORE_VULKAN=ON), no-march=native(broke NDK + emulator
builds), and dual-target support — Android NDK builds and host CI
validation builds (-DSHUGOCORE_JNI_INCLUDE=...).LocalApiServer.kt— replaced JDK-internalcom.sun.net.httpserver
(absent on Android) with a minimal HTTP/1.1 implementation on
ServerSocket, loopback-only./api/generateand/api/chatnow parse
JSON bodies, apply sampling options (temperature,top_k,top_p,
repeat_penalty,seed,num_predict), stream NDJSON chunks when
stream: true, and return Ollama-shaped responses (response/
message.content,done,eval_count,total_duration) so ShugoCore's
OllamaBackend/AndroidBackendwork unmodified.
Verified
- Host build of
libllama_jni.dylib(full llama.cpp + JNI bridge) compiles
and links with zero warnings against the pinned headers; all 8 JNI symbols
(nativeInit,nativeFree,nativeTokenize,nativeDetokenize,
nativeDrain,nativeEvalPrompt,nativeGenerateToken,nativeReset)
exported with names exactly matching the Kotlinexternal fun
declarations. - Version metadata aligned at 1.8.0 across
version.py,pyproject.toml,
andbuild.gradle.