Skip to content

Local llama.cpp models are extremely slow when session title generation is enabled #33126

Closed as not planned

Description

@rexkimj

Description

Environment

  • OpenCode: 1.17.8
  • Provider: llama.cpp (OpenAI-compatible)
  • Model: Qwen3-14B-Q4_K_M
  • OS: macOS (Apple Silicon)
  • OpenCode installed via Homebrew

Problem

When using a local llama.cpp model, OpenCode is significantly slower than direct API calls.

Direct llama.cpp API

time curl -s http://127.0.0.1:8080/v1/chat/completions
-H "Content-Type: application/json"
-d '{"model":"q14","messages":[{"role":"user","content":"2+2=?"}}'

Result:

~2.5 seconds

OpenCode

time opencode run "2+2=?" --model llamacpp/q14

Result:

~22 seconds

OpenCode with fixed title

time opencode run "2+2=?" --model llamacpp/q14 --title test

Result:

~4.6 to 5.1 seconds

Additional findings

Debug logs show:

agent=title small=true
agent=build small=false

When --title is not provided, OpenCode appears to invoke an additional title-generation pipeline.

The performance difference is much larger than expected:

Direct API: ~2.5s
OpenCode + fixed title: ~5s
OpenCode auto title: ~22s

The title-generation path adds roughly 15~18 seconds.

Separate issue

I also found a large startup delay caused by external skill scanning.

Before disabling external skills:

init count=235

After disabling:

init count=1

Runtime improved from:

176s -> 29s

There may be an opportunity to lazy-load skills or avoid scanning duplicate skills.

Expected behavior

  • Session title generation should not add 15~18 seconds for local models.
  • Title generation should ideally use a lightweight path or be disabled automatically for local providers.
  • Duplicate skill scanning should not significantly impact startup latency.

opencode --version
1.17.8
brew list opencode
/opt/homebrew/Cellar/opencode/1.17.8/bin/opencode

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. Necmttn commented on Jun 21, 2026

    @Necmttn

    This needs a latency breakdown per session start. Split timings for config load, external skill scan, first model call, title generation, and final response. Then local-model users can see whether the 20s delay came from title generation, skill inventory, or provider latency.

    The observed --title test speedup is strong evidence title generation belongs behind a skip/defer policy. A regression can assert local llama.cpp with explicit title avoids the title agent path entirely.


    Generated with ax.

  2. kevincox commented on Jul 2, 2026

    @kevincox

    I also don't have hard numbers, but I notice that title generation usually generates thousands of tokens which seems very overkill for a title. Maybe reasoning is being enabled or something for title generation which is probably unnecessary? Ticket #25456 seems to think so. I agree that this is probably undesirable by default.

    I wouldn't mind nearly as much if it was just ~550 prompt tokens and ~20 output tokens. But 2k output tokens can take a long time on some models or providers. The actual output surely depends on the model but it seems very common for them to be chatty.

    I also noticed that setting your own title while it is running:

    1. Doesn't cancel the automatic title generation request.
    2. Overwrites your title when it completes.

    Getting more off-topic I wonder if title generation could also be handled differently. Like what if there was a tool to set the title. The system prompt tells the model to set the title near the start and whenever there are significant changes in direction. The tool starts returning errors once the user has explicitly edited the title and telling the model to stop calling it. (Probably a bad idea, IDK if I want my sessions changing title as they progress, but worth considering).

  3. github-actions commented on Sep 1, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions