← 输入框|github.com|刷新
Skip to content

Offline AI: chat format for Qwen and LFM2 models, no texts in the log - #888

Merged
LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:feature/offline-ai-chat-format
Nov 22, 2026
Merged

LeanBitLab merged 1 commit into
LeanBitLab:mainfrom
4di-hello:feature/offline-ai-chat-format

Conversation

@4di-hello

Copy link
Copy Markdown
Contributor

Local chat models answer much better with their own chat format:

  • Qwen and LFM2 models (detected by the model file name) now get the instruction as system message and the text as user message (ChatML). With the plain "Instruction / Input / Output" prompt they often answered badly, took the few-shot examples as part of the text, and Qwen3 first "thought" and used up the available tokens.
  • For Qwen, an empty think block switches thinking off, unless "Show thinking" is enabled.
  • Other models get the prompt exactly as before.
  • A prompt without {text} and an empty field (e.g. a custom key working on the clipboard) is sent as the request itself.

Also, the log no longer contains the input and the generated text, only their lengths: the texts are private, and the system log can be read by other tools (like #825 for typed words).

Tested with Qwen3-4B-Instruct-2507 Q4_0 and LFM2; in daily use in my fork for some weeks.

🤖 Generated with Claude Code

Chat models expect their chat format. With the plain "Instruction/Input/Output"
prompt they answer badly, take the few-shot examples as part of the text, and
Qwen3 first "thinks" and uses up the available tokens. Qwen and LFM2 models
(detected by the model file name) now get the instruction as system message and
the text as user message; for Qwen an empty think block switches thinking off,
unless "show thinking" is enabled. Other models get the prompt as before.

The log now contains only the lengths of input and output: the texts are
private, and the system log can be read by other tools.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VuiaMhLXwhErf9shhrr1uD
@LeanBitLab
LeanBitLab merged commit 69fabce into LeanBitLab:main Nov 22, 2026
1 check passed
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