Make embedding vector dimension configurable + add LM Studio recipe#1051
Open
vincedk-alt wants to merge 3 commits into
Open
Make embedding vector dimension configurable + add LM Studio recipe#1051vincedk-alt wants to merge 3 commits into
vincedk-alt wants to merge 3 commits into
Conversation
…ic-embed-text-v1.5
…io :1234) The ollama recipe template at the same port was misleading on inspection. LM Studio is not Ollama; the config now reads lmstudio:<model> truthfully. Recipe mirrors ollama.ts shape: openai-compat tier, no auth required, no static batch cap, default 768 dims for nomic-embed-text-v1.5. Verified end-to-end: gbrain doctor shows embedding_provider: lmstudio:text-embedding-nomic-embed-text-v1.5 OK 172ms, 768 dims, DB aligned. Operator config update separately at ~/.gbrain/config.json.
66993f1 to
1c55e9b
Compare
These dirs (media/x/, media/articles/, meetings/transcripts/) are populated at runtime by gbrain sync/ingest for db_only payloads and should never enter version control. Captured locally during the v0.33 -> v0.35 PGLite rebuild on 2026-05-15. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Two patches for non-OpenAI embedding workflows:
vector(N) schema parameterization — schema.sql had vector(1536) hardcoded for OpenAI's text-embedding-3-small dim. Changed to read embedding_dimensions from config (default 1536 for backwards compat), so users running local models like nomic-embed-text-v1.5 (768) or mxbai-embed-large (1024) don't have to fork.
LM Studio recipe — sibling of the ollama recipe at recipes/lmstudio.ts, points at http://localhost:1234/v1 by default. Cleanly separates LM Studio integration from the misleading "ollama at non-Ollama port" workaround pattern.
Why
Running gbrain on a personal fork to support a hybrid local+cloud setup (LM Studio MLX for embeddings, Anthropic Haiku for chat). Every upstream release requires manual rebase. These patches are generally useful — anyone running gbrain with a non-OpenAI embedding provider needs the dim parameterization.
Verified by operator
Test plan (not personally re-verified before opening this PR — operator's prior test run is the basis)
The original patches were validated in the operator's earlier work session (2026-05-14). The PR-opener (an agentic helper) is surfacing the patches upstream rather than re-running the test suite. Maintainer may wish to re-validate via:
Branch is 4 commits behind master at time of PR opening. Happy to rebase or iterate on the patch shape if a different abstraction is preferred.
Update 2026-05-16: This PR's branch now also carries commit
5d75545(gitignore the gbraindb_onlyauto-managed directoriesmedia/x/,media/articles/,meetings/transcripts/). Strictly additive; doesn't conflict with the schema parameterization above.Separately, see #1060 (closes #203) — the same operator's branch surfaced a config-first init bug while exercising the v0.35 → v0.35.0.1 rebuild path. That fix is independent of this PR; both can land in any order.