feat(glyph): declarative Open WebUI model config via API sync#384
Merged
feat(glyph): declarative Open WebUI model config via API sync#384
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modelsattrset toopen-webui.nix— listed models are activated with full config, all others are automatically deactivatedserver:mcp:glyph), default features (web search + code interpreter), and all builtin toolsopen-webui-model-sync) pushes config to Open WebUI via its API after deployment, triggered by a timer with config hash change detectionopen-webui-api-key.ageto secrets for API authenticationAdding a new model
Per-model overrides are supported via
name,meta, andparamsattrs.Before deploying
agenix -e hosts/glyph/secrets/open-webui-api-key.agewith the key as the only content (noKEY=prefix)Test plan
journalctl -u open-webui-model-syncfor successful updates🤖 Generated with Claude Code