Repository navigation
fix(thinking): switch WebLLM thinking models with enable_thinking; release 0.0.21 - #19
Merged
Merged
Conversation
…lease 0.0.21 @browser-ai/web-llm ignores the AI SDK's portable `reasoning` level: a Qwen3 model in WebLLM is switched only by `extra_body.enable_thinking`, and thinks by default. So the thinking setting changed nothing for local models. resolveThinking now also returns providerOptions['web-llm'].extra_body .enable_thinking: false for 'none', true for any other level (models without thinking ignore it). Unset still sends nothing, leaving the provider default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
siarheidudko
marked this pull request as ready for review
October 3, 2026 01:47
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With a local model in the demo, the thinking setting did nothing.
Cause
@browser-ai/web-llmignores the AI SDK's portablereasoninglevel. WebLLM switches a thinking model (Qwen3) only throughextra_body.enable_thinking, which it reads fromproviderOptions['web-llm']. A thinking model thinks by default, so a local Qwen3.5 always thought, whatever the setting.Change
resolveThinkingnow also returnsproviderOptions['web-llm'].extra_body.enable_thinking:'none'sendsfalse, the only way to turn a thinking model off;true; models without thinking ignore it;falsestill sends nothing, so the provider default applies.The other providers are unchanged. Docs:
docs/capabilities.md→ Thinking. Version 0.0.21.Checks
typecheck, format:check, build,
npm test144/144.🤖 Generated with Claude Code
https://claude.ai/code/session_01A7jHa5Pim4ufrdgxg561G5
Generated by Claude Code