Skip to content

feat(glyph): declarative Open WebUI model config via API sync#384

Merged
stackptr merged 3 commits intomainfrom
glyph/open-webui-model-config
Mar 18, 2026
Merged

feat(glyph): declarative Open WebUI model config via API sync#384
stackptr merged 3 commits intomainfrom
glyph/open-webui-model-config

Conversation

@stackptr
Copy link
Copy Markdown
Owner

@stackptr stackptr commented Mar 18, 2026

Summary

  • Adds a models attrset to open-webui.nix — listed models are activated with full config, all others are automatically deactivated
  • Active models get: all capabilities (vision, web search, citations, etc.), MCPJungle tool server (server:mcp:glyph), default features (web search + code interpreter), and all builtin tools
  • A oneshot systemd service (open-webui-model-sync) pushes config to Open WebUI via its API after deployment, triggered by a timer with config hash change detection
  • Adds open-webui-api-key.age to secrets for API authentication

Adding a new model

models = {
  "claude-sonnet-4-6" = {};
  "claude-opus-4-6" = {};
  "claude-haiku-4-5-20251001" = {};
  # just add another entry:
  "new-model-id" = {};
};

Per-model overrides are supported via name, meta, and params attrs.

Before deploying

  • Generate an API key in Open WebUI (Settings > Account > API Keys)
  • Create secret: agenix -e hosts/glyph/secrets/open-webui-api-key.age with the key as the only content (no KEY= prefix)

Test plan

  • Deploy to glyph
  • Check journalctl -u open-webui-model-sync for successful updates
  • Verify only the 3 listed models appear in the model picker
  • Verify active models have MCPJungle tools and web search enabled by default

🤖 Generated with Claude Code

stackptr and others added 3 commits March 17, 2026 17:03
Add a oneshot systemd service (open-webui-model-sync) that syncs model
configuration with Open WebUI via its API after deployment.

Models listed in the `models` attrset are activated with full config:
capabilities, tool servers (MCPJungle), default features (web search,
code interpreter), and builtin tools. All unlisted models from the API
provider are automatically deactivated.

The sync service:
- Runs 10s after activation via a systemd timer
- Re-triggers when the model config hash changes
- Waits for Open WebUI to be ready before syncing
- Uses POST /api/v1/models/model/update for active models
- Uses POST /api/v1/models/model/toggle for deactivation
- Checks current state before toggling to ensure idempotency

Requires an Open WebUI API key in open-webui-api-key.age.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Set params.function_calling to "native" for all active models, enabling
agentic web search where the model uses native tool calling to generate
search queries and process results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stackptr stackptr merged commit 5af1b3a into main Mar 18, 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