LM Studio a local 7B model issue "Cannot truncate prompt with n_keep (15028) >= n_ctx (7424)" #7948

Open
opened 2026-02-16 18:08:45 -05:00 by yindo · 3 comments
Owner

Originally created by @abdulqadar on GitHub (Jan 29, 2026).

Originally assigned to: @rekram1-node on GitHub.

When I try to ask something to local LM studio LLM it gives below error.

Did some R&D to find where to adjust this but could not find the right place for this config.

"Cannot truncate prompt with n_keep (15028) >= n_ctx (7424)"

Image
Originally created by @abdulqadar on GitHub (Jan 29, 2026). Originally assigned to: @rekram1-node on GitHub. When I try to ask something to local LM studio LLM it gives below error. Did some R&D to find where to adjust this but could not find the right place for this config. "Cannot truncate prompt with n_keep (15028) >= n_ctx (7424)" <img width="972" height="480" alt="Image" src="https://github.com/user-attachments/assets/68e8d2b0-6d51-4671-8d30-2280aef8780d" />
Author
Owner

@github-actions[bot] commented on GitHub (Jan 29, 2026):

This issue might be a duplicate of existing issues. Please check:

  • #4255: OpenCode v1.0.25 Hangs Indefinitely with LM Studio + Qwen Models Due to Empty tool_calls Array
  • #8012: Function call auto-truncation (related to context window/prompt truncation)
  • #4385: Poor performance with local models
  • #7486: Only return tool_call parameters but can not run the tool with local LLM
  • #2047: LM Studio Failure to refresh models

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Jan 29, 2026): This issue might be a duplicate of existing issues. Please check: - #4255: OpenCode v1.0.25 Hangs Indefinitely with LM Studio + Qwen Models Due to Empty tool_calls Array - #8012: Function call auto-truncation (related to context window/prompt truncation) - #4385: Poor performance with local models - #7486: Only return tool_call parameters but can not run the tool with local LLM - #2047: LM Studio Failure to refresh models Feel free to ignore if none of these address your specific case.
Author
Owner

@mgonzalezlopezudc commented on GitHub (Feb 13, 2026):

Same behavior here with Qwen 0.6B running on LMstudio. However, setting in LMstudio the context for the model up to maximum, fixes the issue

@mgonzalezlopezudc commented on GitHub (Feb 13, 2026): Same behavior here with Qwen 0.6B running on LMstudio. However, setting in LMstudio the context for the model up to maximum, fixes the issue
Author
Owner

@KevinGimbel commented on GitHub (Feb 16, 2026):

Same with openai/gpt-oss-20b, setting context to max fixed it.

@KevinGimbel commented on GitHub (Feb 16, 2026): Same with `openai/gpt-oss-20b`, setting context to max fixed it.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#7948