Yes, there are a few ways to automate it, depending on how hands-off you want it.
Push via the Open WebUI REST API. Open WebUI has an API (create an API key under Settings → Account). Models and prompts can be created and updated through it, so a small script can read
prompt.md, strip the front-matter or README part, and update the model’s system prompt. Run it by hand, from a git hook, or from a GitHub Actions workflow on every push tomain. The exact endpoints and payload shape vary between versions, so check your instance’s own API docs (the Swagger UI at/docs, if enabled) or inspect what the web UI sends in the browser dev tools when you save a model. Note that updating a model usually requires sending the full model object, not just the system prompt field, so the script should fetch the model first, changeparams.system, and send it back. If your instance isn’t reachable from GitHub’s runners, use a self-hosted runner or run the script locally.Have a Filter Function fetch the prompt at request time. Instead of storing the prompt in Open WebUI at all, write a filter whose
inlet()downloads the file from your repo (for example the raw URL) and injects it as the system message, ideally with a short cache so you don’t hit GitHub on every message. Then the repo is the single source of truth and there is nothing to sync. The trade-offs are an external dependency on every request (or cache refresh), a token if the repo is private, and the prompt no longer being visible in the model’s settings page.Import/export JSON. Open WebUI can export and import models and prompts as JSON files. This is still a manual step, but it’s less error-prone than copy-pasting text, and it works fine as a one-off bulk transfer.
If you want true “commit and it’s live,” option 1 with GitHub Actions is the most conventional. If you want it simple and are fine with the filter approach, option 2 is the least moving parts once it’s written.
🤖 created with help of ai