koishi-plugin-chatluna-channel-model-changer
v0.1.4
Published
Batch switch ChatLuna conversation models for Koishi
Maintainers
Readme
koishi-plugin-chatluna-channel-model-changer
Batch switch models used by ChatLuna conversations in Koishi (compatible with ChatLuna 1.3.x and 1.4.x alpha).
Features
- Read available model list from ChatLuna platform service.
- Show model usage statistics from
chatluna_conversation(new schema) orchathub_room(legacy schema). - Batch switch conversation model with filters:
- by old model
- by binding key / preset / creator
- include/exclude archived/deleted conversations
- Optional dry-run mode before applying changes.
- Optional runtime cache clear after updates.
- Supports command mode and Koishi Console panel mode.
- Includes
zh-CNlocalization on server command messages.
Install
npm i koishi-plugin-chatluna-channel-model-changerConfig
command: root command name, defaultchatluna-modelauthority: command authority, default4clearCacheAfterUpdate: clear ChatLuna runtime cache after each update, defaulttruemode:command/panel/both, defaultboth
Commands
chatluna-model.models- Show available models loaded by ChatLuna.
chatluna-model.stats [-a]- Show current model usage counts.
--all: include archived/deleted conversations.
chatluna-model.switch <targetModel> [options]- Batch switch matched conversations to
targetModel. -f, --from <model>: only replace a specific old model.-b, --binding <key>: only process conversations in a binding key.-p, --preset <name>: only process conversations in a preset.--created-by <id>: only process conversations created by this user.--all: include archived/deleted conversations.-n, --dry-run: preview only.--force: skip target-model existence validation.
- Batch switch matched conversations to
Example
# Preview: replace all openai/gpt-4o-mini with openai/gpt-4.1-mini
chatluna-model.switch openai/gpt-4.1-mini -f openai/gpt-4o-mini -n
# Execute
chatluna-model.switch openai/gpt-4.1-mini -f openai/gpt-4o-miniNotes
- This plugin requires ChatLuna to be loaded first.
- On newer schema it uses conversation service when available; otherwise it falls back to database-level updates.
- Panel mode requires
@koishijs/plugin-console.
