mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-06 02:48:13 -05:00
[GH-ISSUE #16538] feat: Model/Agent/Persona creation/modification/deletion via API #17947
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Sawrz on GitHub (Aug 12, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16538
Check Existing Issues
Problem Description
Today, I tried to create a workflow where I can automatically modify, add, or delete an agent/persona (in workspaces under models). However, the API only supports listing all models rather than creating and modifying them. Is that true, or am I missing something?
If true, it would be great to have that functionality. Although the interface makes it easy to create new agents/personas, I would like to have a more stable way of managing system prompts, descriptions, tags, etc., such as versioning via Git, so I can easily roll back.
Is that already somewhere on the roadmap, never thought of, or entirely out of scope for that project?
Desired Solution you'd like
What I imagine is an API call for creation, deletion, or modification. Something like
/api/models/add
/api/models/delete
/api/models/modify
Maybe the delete method might be better suited for deletion. Delete probably doesn't need more clarification, for add and modify, handing over a JSON string. For add, it should require all required fields in the UI, while for modify, only parameters up to change should/can be provided.
Alternatives Considered
Another, more straightforward solution would be to combine add and modify into one call, and if the slugs are equal, then it simply overwrites the persona.
Additional Context
Git seems to be a perfect solution to maintain and version agents/personas in the long run. Especially for rolling back states. Although the export and import feature is very much appreciated, it seems to be very basic in contrast to a Git Workflow that pushes changes of an agent/persona automatically.
Sharing personas might be easier that way as well.
I found that functionality here:
src/lib/apis/models/index.ts
However, if I try to access it, I get a Method not allowed (405) error. Accessing models via base_url/api/models works flawlessly.
@Sawrz commented on GitHub (Aug 12, 2025):
I close since the feature seemingly already exists, and it might be a bug.