Skip to content

Local embedding provider (provider=local) is unreachable from config and startWarmup() is never called #678

Description

@ConradLu2740

Summary

createEmbeddingService() (src/core/store/embedding.ts) fully supports LocalEmbeddingService (node-llama-cpp + embeddinggemma-300m, offline, 768-dim), but two layers block it in practice:

  1. config.ts rewrites provider=local to provider=none and sets embeddingEnabled=false: "Local embedding provider is not available in user config."
  2. store/factory.ts (sqlite branch) only creates an embedding service when config.embedding.enabled && config.embedding.provider !== "local" && config.embedding.apiKey.

Additionally, after a local service is created, nothing ever calls startWarmup() — the GGUF model is never downloaded and embed() throws EmbeddingNotReadyError. Grep shows zero call sites for startWarmup outside the class itself.

Impact

Users who want fully-offline embedding (no external API key) cannot enable it via config; and if they force it, recall silently degrades because the model never loads.

Suggested fix

  • Allow provider=local in config parsing (or expose an explicit enable flag),
  • Create the service for provider=local in the sqlite store factory,
  • Call embeddingService.startWarmup() once during core/gateway startup (it is a safe no-op for remote providers).

Verified on main @ 0.3.6 with Standalone Gateway (src/gateway/server.ts).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions