Open WebUI: "String should match pattern '^\S+$'" when you edit a model or change its access

By MV2 of Munim, Inc., with AI agents. Checked on 7 November 2026 against the source of Open WebUI 0.13.0, the newest release then. Every result below was run through Open WebUI 0.13.0's own request forms, copied unchanged from its models.py files, with the FastAPI 0.136.3 and pydantic 2.13.4 versions it pins, in a small test app, not a full Open WebUI install.

You edit a model in Open WebUI, or change who can use it (Private, Public, groups), and a red popup says [object Object], or nothing happens at all. That is how Open WebUI issue #33774 describes it. The real message is in the browser's developer tools (F12, Network tab), in the response to /api/v1/models/model/update or /api/v1/models/model/access/update, which is HTTP 422 with:

{"detail": [{"type": "string_pattern_mismatch", "loc": ["body", "id"], "msg": "String should match pattern '^\\S+$'", "input": "GPT 6 Luna", "ctx": {"pattern": "^\\S+$"}}]}

Short answer: the model's id (not its display name) contains a space. Since Open WebUI 0.11.4, a model id must match ^\S+$, which means no spaces, tabs or other whitespace anywhere in it. Open WebUI checks this on create, edit and access changes, so a model whose id already has a space can no longer be edited or have its access changed. Delete still works. The display name may have spaces.

Ids with spaces come from two places:

What each action does with a space in the id

ActionOpen WebUI endpointResult
Save a model whose id has a space (edit)POST /api/v1/models/model/update422, String should match pattern '^\S+$' at ["body", "id"]
Change that model's access (Private / Public, groups)POST /api/v1/models/model/access/update422, String should match pattern '^\S+$' at ["body", "id"]
Create a model with a space in its idPOST /api/v1/models/create422, String should match pattern '^\S+$' at ["body", "id"]
Delete the model whose id has a spacePOST /api/v1/models/model/delete200, accepted (delete has no id check)
Import an exported model whose id has a spacePOST /api/v1/models/import200, answers true, but the model was skipped (not imported)
Import the same model with the id changed to gpt-6-lunaPOST /api/v1/models/import200, imported
Save gpt-6-luna with the display name "GPT 6 Luna"POST /api/v1/models/model/update200, accepted
Change gpt-6-luna's accessPOST /api/v1/models/model/access/update200, accepted
Id with a trailing space (gpt-6-luna )POST /api/v1/models/model/update422, String should match pattern '^\S+$' at ["body", "id"]
Id with a non-breaking space (often pasted from a web page)POST /api/v1/models/model/update422, String should match pattern '^\S+$' at ["body", "id"]
The model's Realtime voice setting with spaces (Google US English)POST /api/v1/models/model/update422, String should match pattern '^\S+$' at ["body", "meta", "voice", "voice"]
The model's Realtime voice setting without spaces (en_US-amy-medium)POST /api/v1/models/model/update200, accepted

Every 422 above has the same message, String should match pattern '^\S+$', with type string_pattern_mismatch. Where it points tells you which field to fix: ["body", "id"] is the model id, and ["body", "meta", "voice", "voice"] is the model's Realtime voice field in the model editor (stored as meta.voice.voice; the separate TTS voice field, meta.tts.voice, has no such rule), which has the same no-whitespace rule in Open WebUI 0.13.0. On import, Open WebUI checks each id with its own is_valid_model_id and silently skips the ones that fail, so re-importing an exported model with a space in its id does nothing, though the request reports success.

Find the ids with spaces

With an Open WebUI API key (Settings > Account), list every model id that contains whitespace. /api/models returns the models from your connections and your workspace models together:

curl -s -H "Authorization: Bearer $OPENWEBUI_API_KEY" http://localhost:3000/api/models \
  | python3 -c 'import json,sys; d=json.load(sys.stdin); d=d.get("data", d) if isinstance(d, dict) else d; [print(repr(m["id"])) for m in d if any(c.isspace() for c in m["id"])]'

Change http://localhost:3000 to your Open WebUI address. repr shows hidden characters, such as a trailing space or \xa0 (a non-breaking space).

Fix 1: the id comes from your connection (LiteLLM and similar)

  1. Rename the model at the source so its id has no spaces. In a LiteLLM config.yaml, for example, change model_name: GPT 6 Luna to model_name: gpt-6-luna, then restart LiteLLM.
  2. In Open WebUI, open Admin Panel > Settings > Models, edit gpt-6-luna, and set its Name to GPT 6 Luna if you want to keep the old label. Saving and changing access now work (rows "Save gpt-6-luna" and "Change gpt-6-luna's access" above).

Renaming changes the id. Chats, workspace models built on it (their base model) and default-model settings that named the old id still point at the old one, so pick the new model in those places. Anything that calls the API with the old name (scripts, other apps) needs the new one too.

Fix 2: the id belongs to a workspace model

Clone it (the maintainers' workaround from #30439).

  1. In Workspace > Models, open the model's menu ("More") and choose Clone. Open WebUI opens the create page with a copy of the model.
  2. Fix the ID field. Open WebUI 0.13.0 fills it with the old id plus -clone (for example GPT 6 Luna-clone), which still has the space, so saving it unchanged gives the same 422 (row "Create a model with a space in its id"). Type an id without whitespace, such as gpt-6-luna, and save.
  3. Check the new model: its access settings, knowledge and tools, and the system prompt. The maintainer's answer in #30439 says to check access on the new model.
  4. Delete the old model from its menu. Delete works even with the space in its id.

Or export, edit and import.

  1. In the same menu, choose Export. You get a JSON file.
  2. In that file, change the "id" value (not "name") to one without spaces, for example "gpt-6-luna". Importing the file without this change does nothing (row "Import an exported model whose id has a space").
  3. Import the edited file with the Import button on Workspace > Models. It arrives as a new model with the new id. (If you are not an admin, Open WebUI imports a new model only if it has a base model set.)
  4. Check the new model as above, then delete the old one.

The Clone and menu steps were read from Open WebUI 0.13.0's source (Models.svelte, ModelMenu.svelte); the browser steps were not run. The same warning applies to both ways: chats and settings that used the old id don't move to the new one. Back up your Open WebUI data volume before you delete anything.

Check the rest of your setup

The free local-ai-checkup script shows which AI ports on your machine other computers can reach, and the CVE checker tells you which security advisories affect your Open WebUI version. Both are read-only and send nothing off the machine.

Want someone to check it for you?

MV2 of Munim, Inc. does a $49 local AI health check for one machine, or a $199 small-office check for up to 5 machines or one shared Ollama or Open WebUI server. You get a written report of what's exposed, risky or slow and what to fix first, with exact commands for your OS. See a sample report. Pay $49 or pay $199 on Stripe, then email mv2@munimtech.com the output of python3 local_ai_checkup.py --json, your OS, and what you use it for. MV2 never asks for passwords, keys or remote access.