perf(backend): trim llama-server flags for the embedding-only workload#15
Merged
couragehong merged 1 commit intoJul 14, 2026
Merged
Conversation
llama-server's defaults are tuned for chat serving and cost an embedding daemon real memory: - prompt cache (default cap 8 GiB) saves ~14 MiB of state per request at a ~0% hit rate, since every embedded text is unique — measured growing 1.8 GB -> 3.6 GB during a bulk-capture run. --cache-ram 0 disables it. - CPU REPACK copies the mmap'd q8 weights (~640 MiB) into private anonymous memory on first use. --no-repack keeps them on the shared, reclaimable file mapping (~+20% embed latency on CPU). - n_parallel auto-selects 4 slots, quadrupling the KV cache (~940 MiB at ctx 2048) for concurrency a one-shot embed workload lacks. --parallel 1. - smaller physical batch + q8_0 KV shrink compute scratch and cache without changing results or the max input length. Measured on darwin-arm64 (qwen3-embedding-0.6b q8): steady physical footprint 2.8 GB (growing toward 8 GB) -> 1.0 GB flat. Embedding output parity vs stock flags verified: cosine 0.9986-0.9996 across short/long/ Korean/English/code inputs; over-ctx rejection behavior identical. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014oTj8KKuD2q3feKTaqh81Y
esifea
approved these changes
Jul 14, 2026
couragehong
added a commit
to couragehong/runed
that referenced
this pull request
Jul 14, 2026
…LabInc#15, approved) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014oTj8KKuD2q3feKTaqh81Y
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
문제
runed가 스폰하는 llama-server가 임베딩 전용 워크로드인데 chat 서빙 기본값으로 떠서 메모리를 크게 낭비합니다:
prompt_save로그 95건 × 14 MiB와 일치n_parallelauto=4 슬롯변경
startLocked스폰 인자에 추가:--cache-ram 0 --no-repack --parallel 1 --batch-size 256 --ubatch-size 256 --cache-type-k q8_0 --cache-type-v q8_0--ctx-size는 의도적으로 유지 — 최대 입력 토큰 의미(초과 시 HTTP 400)라 줄이면 동작 변경이 됩니다.실측 (darwin-arm64, qwen3-embedding-0.6b q8)