Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions os/v3/puppy/embed/etc/init.d/10lemonade
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ start() {
# lives in RAM and says so, rather than pretending to persist.
if grep -q " /data " /proc/mounts 2> /dev/null; then
LEM=/data/lemonade
MODELS=/data/models
export GGML_HRX_JIT_CACHE_DIR=/data/cache/hrx-jit
else
LEM=/var/lib/lemonade
MODELS=$LEM/models
echo "10lemonade: no /data partition: Lemonade state is in RAM, nothing persists"
fi
mkdir -p "$LEM/cache" "$LEM/config"
mkdir -p "$LEM/cache" "$LEM/config" "$MODELS"
# Cycle 25, owner: "log verbose it all for proof". lemond's verbosity is a config.json key, NOT a flag and NOT an
# env var (measured on the pinned build: `lemond --help` has only -v/--version, and the accepted strings come from
# AixLog::to_severity in runtime_config.cpp: trace|debug|info|warning|error|fatal|none, default info).
Expand All @@ -81,8 +83,8 @@ start() {
# A level somebody set is never overwritten - it is theirs, and the console's menu is where they set it.
CONFJSON=$LEM/config/config.json
if [ ! -f "$CONFJSON" ]; then
printf '%s\n' '{"log_level": "debug", "log_max_file_size_mb": 8, "log_max_files": 3}' > "$CONFJSON" \
&& echo "10lemonade: seeded $CONFJSON (log_level=debug, 8 MB x 3 rotation)"
printf '%s\n' "{\"log_level\": \"debug\", \"log_max_file_size_mb\": 8, \"log_max_files\": 3, \"extra_models_dir\": \"$MODELS\"}" > "$CONFJSON" \
&& echo "10lemonade: seeded $CONFJSON (log_level=debug, 8 MB x 3 rotation, extra_models_dir=$MODELS)"
elif ! grep -q '"log_level"' "$CONFJSON" 2> /dev/null; then
if command -v python3 > /dev/null 2>&1; then
python3 - "$CONFJSON" <<'PY' && echo "10lemonade: added log_level=debug to $CONFJSON"
Expand All @@ -100,6 +102,24 @@ PY
else
echo "10lemonade: honouring the log_level already in $CONFJSON"
fi
# Cycle 26: lemond only scans a models directory when `extra_models_dir` is set - ScanCatalog::enumerate() returns
# nothing for an empty setting - so files staged in /data/models were invisible and the catalogue read "none
# downloaded" while they sat on the medium. Measured on the shipping payload: 213 rows without the key, 214 with it,
# the extra row `Qwen3-0.6B-Q8_0 | source: extra_models_dir`. Seeded on its own and only when absent, so a config that
# already carries the key (the stick writer stages one) keeps the value it has.
if ! grep -q '"extra_models_dir"' "$CONFJSON" 2> /dev/null; then
if command -v python3 > /dev/null 2>&1; then
python3 - "$CONFJSON" "$MODELS" <<'PY' && echo "10lemonade: added extra_models_dir=$MODELS to $CONFJSON"
import json, sys
p, models = sys.argv[1], sys.argv[2]
d = json.load(open(p))
d.setdefault("extra_models_dir", models)
json.dump(d, open(p, "w"), indent=2)
PY
else
echo "10lemonade: $CONFJSON has no extra_models_dir and python3 is missing - models in $MODELS stay invisible" >&2
fi
fi
# lemond's positionals are cache_dir config_dir (lemond --help); the rest are the runtime overrides.
# Blank mode is LAN-reachable on purpose: the appliance is a server, Lemonade's own web UI and Lemonade Mobile
# are the two clients the owner demos, and neither asks for a key on stock Lemonade. The console's CONNECT block
Expand Down
6 changes: 6 additions & 0 deletions os/v3/puppy/vm-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,12 @@ rows = [
("U3 catalogue", "k=$(sed -n 's/^LEMONADE_API_KEY=//p' /etc/1bit/lemond.conf 2>/dev/null | head -1); "
"curl -s ${k:+-H \"Authorization: Bearer $k\"} http://127.0.0.1:13305/api/v1/models "
"| grep -o onebit | wc -l", None),
# Cycle 26: the image shipped no models directory in lemond's config, so anything staged in /data/models was invisible
# even though the files were on the medium (measured on the shipping payload: 213 catalogue rows without the key, 214
# with it, the extra one `source: extra_models_dir`). This asks the booted appliance the two things that make that true.
("U3 models dir", "p=$(sed -n 's/.*\"extra_models_dir\": *\"\\([^\"]*\\)\".*/\\1/p' /data/lemonade/config/config.json 2>/dev/null | head -1); "
"echo \"path=${p:-<unset>}\"; "
"[ -n \"$p\" ] && [ -d \"$p\" ] && echo models-dir-seeded", "models-dir-seeded"),
("U3 api local", "k=$(sed -n 's/^LEMONADE_API_KEY=//p' /etc/1bit/lemond.conf 2>/dev/null | head -1); "
"curl -s -o /dev/null -w 'http=%{http_code}' ${k:+-H \"Authorization: Bearer $k\"} "
"http://127.0.0.1:13305/api/v1/models", "http=200"),
Expand Down
Loading