Skip to content

feat(config): support text-embedding-nomic-embed-code alias for LM Studio#101

Merged
aeneasr merged 3 commits intomainfrom
better-lms-support
Apr 6, 2026
Merged

feat(config): support text-embedding-nomic-embed-code alias for LM Studio#101
aeneasr merged 3 commits intomainfrom
better-lms-support

Conversation

@aeneasr
Copy link
Copy Markdown
Member

@aeneasr aeneasr commented Apr 6, 2026

Summary

  • Wires the existing ModelAliases map into config.Load() so LUMEN_EMBED_MODEL=text-embedding-nomic-embed-code resolves to the correct spec (dims=3584, ctx=8192) without requiring LUMEN_EMBED_DIMS
  • Config.Model retains the user-configured value so the correct identifier is sent to LM Studio's /v1/embeddings API
  • Adds TestLoadAliasResolution to pin the full resolution chain (Dims, CtxLength, Model field)
  • Adds TestModelAliases to enforce alias targets exist in KnownModels and catches chained/self aliases
  • Documents the LM Studio model misclassification bug (Qwen2-based models shown as LLMs) and the domain type override workaround

Test plan

  • go test ./internal/config/... -run TestLoadAliasResolution passes
  • go test ./internal/embedder/... -run TestModelAliases passes
  • go test ./... passes
  • Set LUMEN_BACKEND=lmstudio LUMEN_EMBED_MODEL=text-embedding-nomic-embed-code and verify lumen index starts without error (requires LM Studio running with nomic-embed-code loaded)

🤖 Generated with Claude Code

aeneasr and others added 3 commits April 6, 2026 15:43
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>
@aeneasr aeneasr merged commit 5e5b5ab into main Apr 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant