Poor performance with local models #2904

Open
opened 2026-02-16 17:37:44 -05:00 by yindo · 7 comments
Owner

Originally created by @JimmyBenHur on GitHub (Nov 16, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

I am using LM Studio with a local model, and responding in OpenCode takes much much longer (I would say 20x) than directly in LM Studio. I have also already tried with Ollama and the performance was poor as well. Is there a special reason for that, or could that be improved?

OpenCode version

1.0.67

Steps to reproduce

  1. Use Local model with LM Studio (Ollama the same)
  2. Wait for a response in OpenCode and compare to LM Studio directly

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Originally created by @JimmyBenHur on GitHub (Nov 16, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description I am using LM Studio with a local model, and responding in OpenCode takes much much longer (I would say 20x) than directly in LM Studio. I have also already tried with Ollama and the performance was poor as well. Is there a special reason for that, or could that be improved? ### OpenCode version 1.0.67 ### Steps to reproduce 1. Use Local model with LM Studio (Ollama the same) 2. Wait for a response in OpenCode and compare to LM Studio directly ### Screenshot and/or share link _No response_ ### Operating System Windows 11 ### Terminal Windows Terminal
Author
Owner

@github-actions[bot] commented on GitHub (Nov 16, 2025):

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

  • #4182: Poor Performance and High Resource Usage with Ollama Models - reports similar performance degradation when using Ollama through opencode (0.5 tokens/second vs 16 tokens/second directly)
  • #4255: OpenCode v1.0.25 Hangs Indefinitely with LM Studio + Qwen Models - detailed investigation of LM Studio performance issues, identifies root cause related to tool_calls handling
  • #4341: App is calling the wrong endpoint for the Ollama provider - reports incorrect API endpoint usage that could affect performance

The issues show a pattern of local model performance problems across both LM Studio and Ollama providers. Issue #4255 provides particularly detailed analysis suggesting the root cause may be related to empty tool_calls array handling.

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

@github-actions[bot] commented on GitHub (Nov 16, 2025): This issue might be a duplicate of existing issues. Please check: - #4182: Poor Performance and High Resource Usage with Ollama Models - reports similar performance degradation when using Ollama through opencode (0.5 tokens/second vs 16 tokens/second directly) - #4255: OpenCode v1.0.25 Hangs Indefinitely with LM Studio + Qwen Models - detailed investigation of LM Studio performance issues, identifies root cause related to tool_calls handling - #4341: App is calling the wrong endpoint for the Ollama provider - reports incorrect API endpoint usage that could affect performance The issues show a pattern of local model performance problems across both LM Studio and Ollama providers. Issue #4255 provides particularly detailed analysis suggesting the root cause may be related to empty tool_calls array handling. Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 16, 2025):

@JimmyBenHur I assume this is because opencode sends a lot more context right? tools + system prompt = ~10k tokens, add in your AGENTS.md files or mcp servers and it is even more

@rekram1-node commented on GitHub (Nov 16, 2025): @JimmyBenHur I assume this is because opencode sends a lot more context right? tools + system prompt = ~10k tokens, add in your AGENTS.md files or mcp servers and it is even more
Author
Owner

@JimmyBenHur commented on GitHub (Nov 16, 2025):

Definitely makes sense that it's slower because of the context, but this much? The issue seems to be similar to #4182, but I have no AGENTS.md and no mcp servers, I wouldn't except it to be that much slower. I have about 12 tokens per second in LM Studio and I would say less than half a token in OpenCode, when using Qwen3 Coder. Isn't there something to do to improve performance?

@JimmyBenHur commented on GitHub (Nov 16, 2025): Definitely makes sense that it's slower because of the context, but this much? The issue seems to be similar to #4182, but I have no AGENTS.md and no mcp servers, I wouldn't except it to be that much slower. I have about 12 tokens per second in LM Studio and I would say less than half a token in OpenCode, when using Qwen3 Coder. Isn't there something to do to improve performance?
Author
Owner

@rekram1-node commented on GitHub (Nov 16, 2025):

I just don't know how we could possibly be causing an issue for you? We send an http request and the results stream in

Here is a good way to test it, make an opencode.json file and add:

{
  "tools": {
     "*": false
  }
}

That should disable all tools, and then see if it is any faster

@rekram1-node commented on GitHub (Nov 16, 2025): I just don't know how we could possibly be causing an issue for you? We send an http request and the results stream in Here is a good way to test it, make an `opencode.json` file and add: ``` { "tools": { "*": false } } ``` That should disable all tools, and then see if it is any faster
Author
Owner

@JimmyBenHur commented on GitHub (Nov 16, 2025):

Yeah, it is actually much faster without the tools. Thing is I need the tools...

@JimmyBenHur commented on GitHub (Nov 16, 2025): Yeah, it is actually much faster without the tools. Thing is I need the tools...
Author
Owner

@rekram1-node commented on GitHub (Nov 17, 2025):

@JimmyBenHur yes the tools are the whole thing as you know, but that's proof that the context is slowing down your local model, it isn't an opencode issue right?

@rekram1-node commented on GitHub (Nov 17, 2025): @JimmyBenHur yes the tools are the whole thing as you know, but that's proof that the context is slowing down your local model, it isn't an opencode issue right?
Author
Owner

@akemmanuel commented on GitHub (Jan 7, 2026):

Looks like it isn't...

@akemmanuel commented on GitHub (Jan 7, 2026): Looks like it isn't...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2904