Skip to content

docs(selfhost): document OLLAMA_KV_CACHE_TYPE and recommend bge-m3#4404

Merged
JSONbored merged 1 commit into
mainfrom
worktree-gpu-tuning-docs
Jul 9, 2026
Merged

docs(selfhost): document OLLAMA_KV_CACHE_TYPE and recommend bge-m3#4404
JSONbored merged 1 commit into
mainfrom
worktree-gpu-tuning-docs

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

  • Documents OLLAMA_FLASH_ATTENTION + OLLAMA_KV_CACHE_TYPE in .env.example — an existing Ollama runtime capability that was never surfaced to self-host operators. q8_0 roughly halves per-context KV-cache VRAM with negligible quality impact; validated live (4608 MiB at f16 -> 2448 MiB at q8_0 for one loaded context, same generation speed, correct structured-output quality on a real request).
  • Updates the AI_EMBED_MODEL/QDRANT_DIM example to recommend bge-m3 (1024-d) over nomic-embed-text (768-d) — bge-m3 already matches the code's own DEFAULT_DIM assumption (see src/selfhost/qdrant-vectorize.ts), its longer native context window is a better fit for RAG's ~16k-char chunk budget, and it's now the validated production choice.

Documentation-only change; no code paths affected.

Scope

  • Stayed within wantedPaths (repo-root .env.example)
  • No secrets/wallets/trust-score/reward values anywhere
  • No changes to site/, CNAME, **/lovable/**, or CHANGELOG.md

Validation

  • npm run selfhost:env-reference:check — clean (no env.* source reads changed, comment-only edit)
  • git diff --check — clean

Safety

  • No secrets/tokens anywhere

Documents two GPU-tuning env vars that existed as an Ollama runtime
capability but were never surfaced to self-host operators:
OLLAMA_FLASH_ATTENTION (required alongside KV cache quantization for
it to take effect) and OLLAMA_KV_CACHE_TYPE=q8_0 (roughly halves
per-context KV-cache VRAM with negligible quality impact -- validated
live: 4608 MiB at f16 down to 2448 MiB at q8_0 for one loaded
context, same generation speed, correct output).

Also updates the AI_EMBED_MODEL/QDRANT_DIM example to recommend
bge-m3 (1024-d) over nomic-embed-text (768-d) as the default -- it
already matches the code's own DEFAULT_DIM assumption, its longer
native context window is a better fit for RAG's ~16k-char chunk
budget, and it's now the validated production choice.
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@JSONbored JSONbored self-assigned this Jul 9, 2026
@JSONbored
JSONbored merged commit 0a453dc into main Jul 9, 2026
8 checks passed
@JSONbored
JSONbored deleted the worktree-gpu-tuning-docs branch July 9, 2026 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant