feat(hub): UI to select the completeChat provider + OpenRouter in Integrations
Closes the gap where the chat lane (MCP summarize + Hub proposal LLM jobs) could only be chosen via the KNOWTATION_CHAT_PROVIDER env var. Adds an admin-only "AI model provider" control under Settings → Integrations (DeepInfra / OpenAI / Anthropic / OpenRouter / Ollama / auto-detect) and an OpenRouter integration tile + guide.
Resolution & persistence: - lib/llm-complete.mjs: provider precedence is now env KNOWTATION_CHAT_PROVIDER (operator lock, wins) → config.llm.provider (UI) → auto-detect. Adds an explicit `ollama` lane (forces local even when cloud keys exist) via an extracted ollamaChat(); error messages are source-agnostic. Fully backward compatible (env still wins; no config → unchanged). - lib/config.mjs: loadConfig exposes the top-level `llm` block from local.yaml; new loadLlmConfig + normalizeChatProviderInput strictly whitelist the provider (CHAT_PROVIDERS) so a malformed/hostile value can never reach completeChat or be persisted. - lib/daemon-llm.mjs: buildDelegateConfig pins llm.provider for the anthropic/ollama daemon lanes so consolidation is never hijacked by the global chat provider. - hub/server.mjs: GET /api/v1/settings exposes a `chat` block (provider, providers, env_locked, key_available); new admin-only POST /api/v1/settings/chat validates + persists llm.provider to config/local.yaml and 409s when the env lock is set.
UI: - web/hub: selector loads from settings, reflects env-lock + admin gating, saves via the API; OpenRouter tile/guide documents the BYO-key env wiring (key stays in server env, never the UI) and the no-managed-fallback privacy contract.
Tests: 7-tier coverage across resolution, config parsing, endpoint authz/validation/security, and the integration guide/UI wiring. Targeted regression 207/207 + config/daemon 105/105 green.
0 comments
muse hub commit comment sha256:7c3a895ff145e068015993d2e7299895b18e2d5ecf833c4268f042f90372b33c --body "your comment"
No comments yet. Be the first to start the discussion.