Skip to content

feat: agent, knowledge base, and tool workflows support default model… - #6796

Merged
shaohuzhang1 merged 1 commit into
1Panel-dev:v2from
shenkaibo:pr@v2@feat/workflow‑global‑model‑switch
Aug 28, 2026

Hidden character warning

The head ref may contain hidden characters: "pr@v2@feat/workflow\u2011global\u2011model\u2011switch"
Merged

feat: agent, knowledge base, and tool workflows support default model…#6796
shaohuzhang1 merged 1 commit into
1Panel-dev:v2from
shenkaibo:pr@v2@feat/workflow‑global‑model‑switch

Conversation

@shenkaibo

@shenkaibo shenkaibo commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

… configuration and switching

What this PR does / why we need it?

Adds support for configuring and switching default models across agent, knowledge base, and tool workflows. Users can now set category-level default models (LLM, embedding, reranker, STT/TTS, etc.) from the workflow dropdown menu, and any node can run in "default model" mode to automatically use the configured default for its category. This removes the need to pick a model on every node and makes large-scale model switching much easier.

Highlights:

  • New "default model settings" panel from the workflow dropdown menu, styled and positioned consistently with the "Add component" dialog.
  • "Apply to all nodes" action to bulk-set default model usage across the workflow.
  • Node-level "default model" mode that displays the resolved default model name (grayed out, read-only).
  • Model resource mapping includes custom models on base nodes and distinguishes between "not configured" and "unavailable" states.
  • Publish-time validation (frontend + backend) blocks publishing when a node in "default model" mode has no default model configured for its category, with i18n-friendly messages referencing the actual node name.
  • Default model panel changes are synced to the workflow detail in real time and used by the latest publish validation.

Summary of your change

Backend

  • Added default_model_setting to application / knowledge workflow / tool workflow models with DB migrations (0015, 0011, 0008).
  • Adapted workflow node implementations (ai_chat, reranker, image/text/video, STT/TTS, intent, parameter extraction, question, knowledge, tool workflow lib, etc.) to resolve category default models.
  • Updated serializers to accept/return default model settings.
  • Aligned publish validation between backend and frontend.

Frontend

  • New default-model-setting panel component and DefaultModelDisplay component.
  • Base-node and per-node UI support "default model" mode with a grayed read-only model name.
  • Publish-time pre-validation intercepts nodes that select "default model" when the category default is not configured.
  • i18n updates for zh-CN, en-US, and zh-Hant.

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.

@shaohuzhang1
shaohuzhang1 merged commit 44fb27f into 1Panel-dev:v2 Aug 28, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants