[GH-ISSUE #20771] feat: API endpoint to read/write workspace model system prompts #34812

Closed
opened 2026-04-25 08:59:44 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @4republic on GitHub (Jan 18, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/20771

Check Existing Issues

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

Summary

Add an admin-level API endpoint that allows reading and writing workspace model configurations, including params.system
(system prompts) and meta.suggestion_prompts (starter prompts).

Use Case: Self-Improving AI Models

I'm building an automation system that creates a "virtuous cycle" for workspace models:

  1. Analyze - Fetch recent chats via /api/v1/chats
  2. Identify friction - Use LLMs to find where models underperformed (incomplete responses, user frustration, repeated
    clarifications)
  3. Generate improvements - Propose targeted system prompt enhancements
  4. Apply changes - Update the workspace model's system prompt
  5. Repeat weekly - Continuous improvement loop

This enables workspace models to evolve based on real usage patterns rather than static configuration.

Current Limitation

The existing /api/v1/models endpoint sanitizes the response:

  • params.system returns empty string (even when system prompt exists)
  • No write capability for workspace model configuration

I confirmed this by:

  1. Exporting a model via Admin UI (system prompt present in JSON)
  2. Fetching same model via API (system prompt empty)
  3. Checking /openapi.json - no admin endpoint for workspace models

Desired Solution you'd like

Proposed Solution

Add an admin-only endpoint (one of these patterns):

GET /api/v1/admin/models/{id} # Full config including system prompt
PUT /api/v1/admin/models/{id} # Update model configuration

Or extend the existing endpoint with an admin flag:
GET /api/v1/models/{id}?include_system=true # Requires admin API key

Security Considerations

  • Endpoint should require admin-level API key permissions
  • Could be gated behind a new API key permission scope (e.g., "models:admin")
  • Audit logging for system prompt changes would be valuable

Why This Benefits the Community

  1. Automated prompt optimization - Teams can build feedback loops
  2. CI/CD for AI - Version control and deploy system prompts programmatically
  3. Multi-instance sync - Keep workspace models synchronized across environments
  4. Backup/restore - Programmatic backup of full model configurations

Alternatives Considered

Workaround (Current)

Manual copy-paste via Admin UI, which breaks the automation goal.

Additional Context

Environment

  • Open WebUI version: v0.7.2
  • Deployment: Docker
  • Using JWT API keys with these allowed endpoints: /api/v1/chat/completions, /api/v1/messages, /api/v1/chats,
    /api/v1/models, /api/v1/files, /api/v1/knowledge, /api/v1/images, /api/v1/audio

Thank you for considering this feature. Happy to provide more details or help test a PR.

Image
Originally created by @4republic on GitHub (Jan 18, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/20771 ### Check Existing Issues - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description ## Summary Add an admin-level API endpoint that allows reading and writing workspace model configurations, including `params.system` (system prompts) and `meta.suggestion_prompts` (starter prompts). ## Use Case: Self-Improving AI Models I'm building an automation system that creates a "virtuous cycle" for workspace models: 1. **Analyze** - Fetch recent chats via `/api/v1/chats` 2. **Identify friction** - Use LLMs to find where models underperformed (incomplete responses, user frustration, repeated clarifications) 3. **Generate improvements** - Propose targeted system prompt enhancements 4. **Apply changes** - Update the workspace model's system prompt 5. **Repeat weekly** - Continuous improvement loop This enables workspace models to evolve based on real usage patterns rather than static configuration. ## Current Limitation The existing `/api/v1/models` endpoint sanitizes the response: - `params.system` returns empty string (even when system prompt exists) - No write capability for workspace model configuration I confirmed this by: 1. Exporting a model via Admin UI (system prompt present in JSON) 2. Fetching same model via API (system prompt empty) 3. Checking `/openapi.json` - no admin endpoint for workspace models ### Desired Solution you'd like ## Proposed Solution Add an admin-only endpoint (one of these patterns): GET /api/v1/admin/models/{id} # Full config including system prompt PUT /api/v1/admin/models/{id} # Update model configuration Or extend the existing endpoint with an admin flag: GET /api/v1/models/{id}?include_system=true # Requires admin API key ## Security Considerations - Endpoint should require admin-level API key permissions - Could be gated behind a new API key permission scope (e.g., "models:admin") - Audit logging for system prompt changes would be valuable ## Why This Benefits the Community 1. **Automated prompt optimization** - Teams can build feedback loops 2. **CI/CD for AI** - Version control and deploy system prompts programmatically 3. **Multi-instance sync** - Keep workspace models synchronized across environments 4. **Backup/restore** - Programmatic backup of full model configurations ### Alternatives Considered ## Workaround (Current) Manual copy-paste via Admin UI, which breaks the automation goal. ### Additional Context ## Environment - Open WebUI version: v0.7.2 - Deployment: Docker - Using JWT API keys with these allowed endpoints: `/api/v1/chat/completions`, `/api/v1/messages`, `/api/v1/chats`, `/api/v1/models`, `/api/v1/files`, `/api/v1/knowledge`, `/api/v1/images`, `/api/v1/audio` Thank you for considering this feature. Happy to provide more details or help test a PR. <img width="745" height="526" alt="Image" src="https://github.com/user-attachments/assets/8857f469-8a83-49ad-a88b-f3266cbd31cc" />
Author
Owner

@tjbck commented on GitHub (Jan 22, 2026):

This endpoint already exists /api/v1/models/model

<!-- gh-comment-id:3786786187 --> @tjbck commented on GitHub (Jan 22, 2026): This endpoint already exists `/api/v1/models/model`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#34812