Skip to content

bug: synthesis provider reuses DEWEY_EMBEDDING_ENDPOINT instead of its own env var #71

Description

@yvonnedevlinrh

Summary

llm/config.go reuses the DEWEY_EMBEDDING_ENDPOINT environment variable to resolve the Ollama endpoint for the synthesis provider (used by dewey compile and knowledge curation). This conflates two independent concerns - embedding and text generation - and makes it impossible to point them at different Ollama instances via env vars.

Root Cause

llm/config.go reads DEWEY_EMBEDDING_ENDPOINT in two places:

  • ReadSynthesisConfig() line 84 (legacy DEWEY_COMPILE_MODEL path)
  • synthConfigFromEnv() line 116 (no-config-file fallback)

Both fall back to http://localhost:11434 when unset. There is no DEWEY_SYNTHESIS_ENDPOINT or equivalent - the synthesis provider silently shares whatever endpoint the embedding provider uses.

From llm/config.go:116-119:

endpoint := os.Getenv("DEWEY_EMBEDDING_ENDPOINT")
if endpoint == "" {
    endpoint = "http://localhost:11434"
}

Impact

  • Users running embedding and generation on separate Ollama instances (e.g., different GPUs, different machines) cannot configure them independently via env vars.
  • The shared env var name is misleading - setting DEWEY_EMBEDDING_ENDPOINT silently changes synthesis behavior with no indication.
  • If Bug: Dewey does not read OLLAMA_HOST and exits when embedding model is missing #61 adds OLLAMA_HOST fallback to the embedding path, the synthesis path should get the same treatment, but it also needs its own override to avoid permanently coupling the two.

Suggested Fix

Introduce a DEWEY_SYNTHESIS_ENDPOINT env var with the fallback chain:

  1. DEWEY_SYNTHESIS_ENDPOINT (app-specific override)
  2. OLLAMA_HOST (ecosystem standard, once Bug: Dewey does not read OLLAMA_HOST and exits when embedding model is missing #61 lands)
  3. http://localhost:11434 (default)

The config.yaml synthesis.endpoint field already exists and works correctly - this is only about the env var path.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions