feat(config): support text-embedding-nomic-embed-code alias for LM Studio#101
Merged
feat(config): support text-embedding-nomic-embed-code alias for LM Studio#101
Conversation
LM Studio exposes nomic-embed-code as 'text-embedding-nomic-embed-code' via its /v1/embeddings API, which differs from the HuggingFace registry path 'nomic-ai/nomic-embed-code-GGUF' used as the KnownModels key. ModelAliases already had the mapping but config.Load() never consulted it. Wire alias resolution into the spec lookup so that LUMEN_EMBED_MODEL=text-embedding-nomic-embed-code works without requiring LUMEN_EMBED_DIMS. Config.Model retains the user-configured value so the correct name is sent to the LM Studio API. Also add TestModelAliases to enforce that every alias target exists in KnownModels. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Alias targets that are themselves aliases would silently fail at runtime with a confusing "unknown model" error. Add an assertion to catch this at test time. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
LM Studio misclassifies Qwen2-based embedding models (including nomic-embed-code) as LLMs. Document the domain type override fix and the MLX limitation on Apple Silicon. Co-Authored-By: Claude Sonnet 4.6 <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
ModelAliasesmap intoconfig.Load()soLUMEN_EMBED_MODEL=text-embedding-nomic-embed-coderesolves to the correct spec (dims=3584, ctx=8192) without requiringLUMEN_EMBED_DIMSConfig.Modelretains the user-configured value so the correct identifier is sent to LM Studio's/v1/embeddingsAPITestLoadAliasResolutionto pin the full resolution chain (Dims, CtxLength, Model field)TestModelAliasesto enforce alias targets exist inKnownModelsand catches chained/self aliasesTest plan
go test ./internal/config/... -run TestLoadAliasResolutionpassesgo test ./internal/embedder/... -run TestModelAliasespassesgo test ./...passesLUMEN_BACKEND=lmstudio LUMEN_EMBED_MODEL=text-embedding-nomic-embed-codeand verifylumen indexstarts without error (requires LM Studio running with nomic-embed-code loaded)🤖 Generated with Claude Code