llama-swap: enable nomic-embed-text embedding model (hermes-skills#26) #49
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "llama-swap-nomic-embed"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Enables
nomic-ai/nomic-embed-text-v2-moe-GGUFas a llama-swap slot on chicken for the weekly-postmortem normalization similarity scoring requested in richardpickler.com/hermes-skills#26 (comment from rpickler: "I also need a PR over in nixos to enable the nomic-embed-text model. Pay special attention to the launch commands for llama-server. I got a little lazy and hard coded much of the command to qwen38").What changed
The
llama-servercommand was hard-coded to qwen38 as you said:--ctx-size 262144,--parallel 2,--cache-type-k/v q8_0,--mmproj, chat sampling flags and--flash-attn onwere interpolated into every model'scmd. The skeleton is now parameterized by launch kind —launchBase.chat/launchBase.embeddingper-model bases, withlaunch.extraArgs,launch.mmprojandlaunch.kindlayered on top — so each model fully defines its own command.--embedding,--batch-size 512 --ubatch-size 512 --ctx-size 512,--flash-attn off,--parallel 1, no--mmproj, no chat sampling flags. Output normalization stays at llama.cpp's default--embd-normalize 2(L2), which is what nomic recommends.modelsblock now respectsrpickler.llama-swap.models(it previously mapped the wholemodelsattrset, so the option was silently ignored).Launch command verification (no GPU here — eval/offline level)
Evaluated against the repo-pinned nixpkgs-unstable rev (
02c087f3fe67, llama.cpp 0.6.0). The nomic slot renders as:Two claims floating in the discussion were wrong for this file, both corrected here by decoding the GGUF metadata header of
nomic-embed-text-v2-moe.f16.ggufdirectly:nomic-bert-moe.pooling_type = 1= MEAN pooling, not CLS. llama-server without an explicit--poolinguses this metadata default, so no flag is needed — but the reason the default is correct is MEAN, not CLS.nomic-bert-moe.context_length = 512(the model card agrees: max sequence length 512 tokens) — not 8k.batch=ubatch=ctx=512matches the trained window; ubatch must never exceed ctx.Caller contract (postmortem scripts): prepend the task-instruction prefixes (
search_document:/search_query:) client-side and keep inputs within 512 tokens.nix-instantiate --parseclean; module function-eval'd against the pinned nixpkgs to render both commands as shown. Deploy to chicken once merged (nixos-rebuild switchon chicken picks it up via the flake input bump).Ref: richardpickler.com/hermes-skills#26