Issue running local model #280

Closed
opened 2026-02-16 17:26:02 -05:00 by yindo · 7 comments
Owner

Originally created by @SaugatRai9 on GitHub (Jun 25, 2025).

Originally assigned to: @thdxr on GitHub.

Hi,
I am trying to run local llama models with opencode. When I run opencode with my local model (llama3.1:8b-instruct-q8_0, llama3.1), I dont get any response back, it shows waiting and goes to timeout.
This is my opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"ollama": {
"npm": "@ai-sdk/openai-compatible",
"options": {
"baseURL": "http://localhost:11434/v1"
},
"models": {
"llama3.1:8b-instruct-q8_0": {}
}
}
}
}

The models run fine in local before connecting to opencode but once I connect to opencode and then try to run the model, I cannot get a response back from the model. After waiting for 10-15mins, I can run the models again.

Originally created by @SaugatRai9 on GitHub (Jun 25, 2025). Originally assigned to: @thdxr on GitHub. Hi, I am trying to run local llama models with opencode. When I run opencode with my local model (llama3.1:8b-instruct-q8_0, llama3.1), I dont get any response back, it shows waiting and goes to timeout. This is my opencode.json: { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "llama3.1:8b-instruct-q8_0": {} } } } } The models run fine in local before connecting to opencode but once I connect to opencode and then try to run the model, I cannot get a response back from the model. After waiting for 10-15mins, I can run the models again.
yindo closed this issue 2026-02-16 17:26:02 -05:00
Author
Owner

@cravenceiling commented on GitHub (Jun 25, 2025):

Maybe you can find something in #227.

@cravenceiling commented on GitHub (Jun 25, 2025): Maybe you can find something in #227.
Author
Owner

@SaugatRai9 commented on GitHub (Jun 25, 2025):

I looked at #227, I could not resolve it. I have my oopencode.json file and it is valid. Is there something I am missing that I can try?

This is my log:
INFO 2025-06-25T15:06:49 +28ms service=default version=0.1.135 args= opencode
INFO 2025-06-25T15:06:49 +2ms service=app cwd=/home/saugat-rai/Personal/projects/ocode creating
INFO 2025-06-25T15:06:49 +0ms service=app git
INFO 2025-06-25T15:06:49 +1ms service=app name=provider registering service
INFO 2025-06-25T15:06:49 +0ms service=app name=config registering service
INFO 2025-06-25T15:06:49 +2ms service=config $schema=https://opencode.ai/config.json provider=[object Object] loaded
INFO 2025-06-25T15:06:49 +0ms service=models.dev refreshing
INFO 2025-06-25T15:06:49 +1ms service=provider init
INFO 2025-06-25T15:06:49 +45ms service=provider providerID=amazon-bedrock found
INFO 2025-06-25T15:06:49 +0ms service=provider providerID=ollama found
INFO 2025-06-25T15:06:49 +0ms service=app name=share registering service
INFO 2025-06-25T15:06:49 +0ms service=bus type=storage.write subscribing
INFO 2025-06-25T15:06:49 +0ms service=app name=bus registering service
INFO 2025-06-25T15:06:49 +26ms service=server method=POST path=/config_get request
INFO 2025-06-25T15:06:49 +0ms service=server duration=0 response
INFO 2025-06-25T15:06:49 +3ms service=server method=GET path=/event request
INFO 2025-06-25T15:06:49 +0ms service=server event connected
INFO 2025-06-25T15:06:49 +1ms service=bus type=* subscribing
INFO 2025-06-25T15:06:49 +1ms service=server duration=2 response
INFO 2025-06-25T15:06:49 +8ms service=server method=POST path=/provider_list request
INFO 2025-06-25T15:06:49 +1ms service=server duration=1 response
INFO 2025-06-25T15:06:55 +6348ms service=server method=POST path=/session_create request
INFO 2025-06-25T15:06:55 +0ms service=session id=ses_8585f4ecfffepDvSdWGGszpEYl version=0.1.135 title=New Session - 2025-06-25T15:06:55.664Z time=[object Object] created
INFO 2025-06-25T15:06:55 +0ms service=app name=session registering service
INFO 2025-06-25T15:06:55 +0ms service=app name=storage registering service
INFO 2025-06-25T15:06:55 +0ms service=storage path=/home/saugat-rai/.local/share/opencode/project/global/storage init
INFO 2025-06-25T15:06:55 +1ms service=bus type=storage.write publishing
INFO 2025-06-25T15:06:55 +0ms service=bus type=session.updated publishing
INFO 2025-06-25T15:06:55 +0ms service=server duration=1 response
INFO 2025-06-25T15:06:55 +4ms service=server method=POST path=/session_chat request
INFO 2025-06-25T15:06:55 +2ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl chatting
INFO 2025-06-25T15:06:55 +0ms service=provider providerID=ollama modelID=llama3.1:8b-instruct-q8_0 getModel
INFO 2025-06-25T15:06:55 +1ms service=provider status=started providerID=ollama getSDK
INFO 2025-06-25T15:06:55 +10ms service=provider status=completed duration=10 providerID=ollama getSDK
INFO 2025-06-25T15:06:55 +1ms service=provider providerID=ollama modelID=llama3.1:8b-instruct-q8_0 found
INFO 2025-06-25T15:06:55 +0ms service=session sessionID=ses_8585f4ecfffepDvSdWGGszpEYl locking
INFO 2025-06-25T15:06:55 +6ms service=server method=POST path=/session_messages request
INFO 2025-06-25T15:06:55 +0ms service=bus type=storage.write publishing
INFO 2025-06-25T15:06:55 +0ms service=bus type=message.updated publishing
INFO 2025-06-25T15:06:55 +2ms service=server duration=2 response
INFO 2025-06-25T15:06:55 +1ms service=bus type=storage.write publishing
INFO 2025-06-25T15:06:55 +0ms service=bus type=message.updated publishing
INFO 2025-06-25T15:06:55 +0ms service=app name=mcp registering service
INFO 2025-06-25T15:07:15 +20198ms service=installation method=npm target=0.1.136 stdout=
changed 2 packages in 26s
stderr= upgraded
INFO 2025-06-25T15:07:15 +0ms service=bus type=installation.updated publishing
INFO 2025-06-25T15:09:43 +147553ms service=bus type=storage.write publishing
INFO 2025-06-25T15:09:43 +0ms service=bus type=session.updated publishing
ERROR 2025-06-25T15:11:49 +125795ms service=session error=TimeoutError: The operation timed out. callback error
INFO 2025-06-25T15:11:49 +0ms service=bus type=session.error publishing
INFO 2025-06-25T15:11:49 +1ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl type=error part
INFO 2025-06-25T15:11:49 +0ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl type=error unhandled
INFO 2025-06-25T15:11:49 +2ms service=bus type=storage.write publishing
INFO 2025-06-25T15:11:49 +0ms service=bus type=message.updated publishing
INFO 2025-06-25T15:11:49 +1ms service=session sessionID=ses_8585f4ecfffepDvSdWGGszpEYl unlocking
INFO 2025-06-25T15:11:49 +0ms service=server duration=293573 response

Image

@SaugatRai9 commented on GitHub (Jun 25, 2025): I looked at #227, I could not resolve it. I have my oopencode.json file and it is valid. Is there something I am missing that I can try? This is my log: INFO 2025-06-25T15:06:49 +28ms service=default version=0.1.135 args= opencode INFO 2025-06-25T15:06:49 +2ms service=app cwd=/home/saugat-rai/Personal/projects/ocode creating INFO 2025-06-25T15:06:49 +0ms service=app git INFO 2025-06-25T15:06:49 +1ms service=app name=provider registering service INFO 2025-06-25T15:06:49 +0ms service=app name=config registering service INFO 2025-06-25T15:06:49 +2ms service=config $schema=https://opencode.ai/config.json provider=[object Object] loaded INFO 2025-06-25T15:06:49 +0ms service=models.dev refreshing INFO 2025-06-25T15:06:49 +1ms service=provider init INFO 2025-06-25T15:06:49 +45ms service=provider providerID=amazon-bedrock found INFO 2025-06-25T15:06:49 +0ms service=provider providerID=ollama found INFO 2025-06-25T15:06:49 +0ms service=app name=share registering service INFO 2025-06-25T15:06:49 +0ms service=bus type=storage.write subscribing INFO 2025-06-25T15:06:49 +0ms service=app name=bus registering service INFO 2025-06-25T15:06:49 +26ms service=server method=POST path=/config_get request INFO 2025-06-25T15:06:49 +0ms service=server duration=0 response INFO 2025-06-25T15:06:49 +3ms service=server method=GET path=/event request INFO 2025-06-25T15:06:49 +0ms service=server event connected INFO 2025-06-25T15:06:49 +1ms service=bus type=* subscribing INFO 2025-06-25T15:06:49 +1ms service=server duration=2 response INFO 2025-06-25T15:06:49 +8ms service=server method=POST path=/provider_list request INFO 2025-06-25T15:06:49 +1ms service=server duration=1 response INFO 2025-06-25T15:06:55 +6348ms service=server method=POST path=/session_create request INFO 2025-06-25T15:06:55 +0ms service=session id=ses_8585f4ecfffepDvSdWGGszpEYl version=0.1.135 title=New Session - 2025-06-25T15:06:55.664Z time=[object Object] created INFO 2025-06-25T15:06:55 +0ms service=app name=session registering service INFO 2025-06-25T15:06:55 +0ms service=app name=storage registering service INFO 2025-06-25T15:06:55 +0ms service=storage path=/home/saugat-rai/.local/share/opencode/project/global/storage init INFO 2025-06-25T15:06:55 +1ms service=bus type=storage.write publishing INFO 2025-06-25T15:06:55 +0ms service=bus type=session.updated publishing INFO 2025-06-25T15:06:55 +0ms service=server duration=1 response INFO 2025-06-25T15:06:55 +4ms service=server method=POST path=/session_chat request INFO 2025-06-25T15:06:55 +2ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl chatting INFO 2025-06-25T15:06:55 +0ms service=provider providerID=ollama modelID=llama3.1:8b-instruct-q8_0 getModel INFO 2025-06-25T15:06:55 +1ms service=provider status=started providerID=ollama getSDK INFO 2025-06-25T15:06:55 +10ms service=provider status=completed duration=10 providerID=ollama getSDK INFO 2025-06-25T15:06:55 +1ms service=provider providerID=ollama modelID=llama3.1:8b-instruct-q8_0 found INFO 2025-06-25T15:06:55 +0ms service=session sessionID=ses_8585f4ecfffepDvSdWGGszpEYl locking INFO 2025-06-25T15:06:55 +6ms service=server method=POST path=/session_messages request INFO 2025-06-25T15:06:55 +0ms service=bus type=storage.write publishing INFO 2025-06-25T15:06:55 +0ms service=bus type=message.updated publishing INFO 2025-06-25T15:06:55 +2ms service=server duration=2 response INFO 2025-06-25T15:06:55 +1ms service=bus type=storage.write publishing INFO 2025-06-25T15:06:55 +0ms service=bus type=message.updated publishing INFO 2025-06-25T15:06:55 +0ms service=app name=mcp registering service INFO 2025-06-25T15:07:15 +20198ms service=installation method=npm target=0.1.136 stdout= changed 2 packages in 26s stderr= upgraded INFO 2025-06-25T15:07:15 +0ms service=bus type=installation.updated publishing INFO 2025-06-25T15:09:43 +147553ms service=bus type=storage.write publishing INFO 2025-06-25T15:09:43 +0ms service=bus type=session.updated publishing ERROR 2025-06-25T15:11:49 +125795ms service=session error=TimeoutError: The operation timed out. callback error INFO 2025-06-25T15:11:49 +0ms service=bus type=session.error publishing INFO 2025-06-25T15:11:49 +1ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl type=error part INFO 2025-06-25T15:11:49 +0ms service=session session=ses_8585f4ecfffepDvSdWGGszpEYl type=error unhandled INFO 2025-06-25T15:11:49 +2ms service=bus type=storage.write publishing INFO 2025-06-25T15:11:49 +0ms service=bus type=message.updated publishing INFO 2025-06-25T15:11:49 +1ms service=session sessionID=ses_8585f4ecfffepDvSdWGGszpEYl unlocking INFO 2025-06-25T15:11:49 +0ms service=server duration=293573 response ![Image](https://github.com/user-attachments/assets/54cf5851-5a3d-4403-991f-62eaae030fd3)
Author
Owner

@thdxr commented on GitHub (Jun 26, 2025):

are you sure the base url is right? the request is going out it's just failing

@thdxr commented on GitHub (Jun 26, 2025): are you sure the base url is right? the request is going out it's just failing
Author
Owner

@SaugatRai9 commented on GitHub (Jun 27, 2025):

Image

I can curl and get the response.
When I use the baseURL as http://localhost:11434/v1 the model is unresponsive in open code and If I use http://localhost:11434 I get

Image

@SaugatRai9 commented on GitHub (Jun 27, 2025): ![Image](https://github.com/user-attachments/assets/272366ee-d14e-492e-b0d2-6bbae57d6cf6) I can curl and get the response. When I use the baseURL as http://localhost:11434/v1 the model is unresponsive in open code and If I use http://localhost:11434 I get ![Image](https://github.com/user-attachments/assets/744b5f0b-692d-435e-840f-5ec42e131d44)
Author
Owner

@Vitmark97 commented on GitHub (Jul 1, 2025):

I suspect the issue might be that the local model is taking too long to process a large prompt.
When running models like qwen3:30b-a3b-q4_K_M, I also experience timeouts.
However, smaller models such as qwen3:1.7b run quickly enough that I don't encounter this problem.
Perhaps this could be solved by adding a configuration option to customize the request timeout for a provider?

@Vitmark97 commented on GitHub (Jul 1, 2025): I suspect the issue might be that the local model is taking too long to process a large prompt. When running models like `qwen3:30b-a3b-q4_K_M`, I also experience timeouts. However, smaller models such as `qwen3:1.7b` run quickly enough that I don't encounter this problem. Perhaps this could be solved by adding a configuration option to customize the request timeout for a provider?
Author
Owner

@SaugatRai9 commented on GitHub (Jul 2, 2025):

Thank you @Vitmark97 . The problem was with model being slow. I tried with qwen3:1.7b and it is working now.

@SaugatRai9 commented on GitHub (Jul 2, 2025): Thank you @Vitmark97 . The problem was with model being slow. I tried with qwen3:1.7b and it is working now.
Author
Owner

@joelachance commented on GitHub (Jul 9, 2025):

Also having this issue. Here's my config, and I had to enter a fake API key using opencode auth login to get to this point.

Config:

{
  "$schema": "https://opencode.ai/config.json",
  "provider": {
    "ollama": {
      "npm": "@ai-sdk/deepseek",
      "options": {
        "baseURL": "http://localhost:11434"
      },
      "models": {
        "deepseek-coder:1.3b": {}
      }
    }
  }
}

opencode auth login --> ollama --> abc

If you include the /v1 in the localhost URL, it errors and wants an API Key. If you remove the /v1, you'll get:

Image
@joelachance commented on GitHub (Jul 9, 2025): Also having this issue. Here's my config, and I had to enter a fake API key using `opencode auth login` to get to this point. Config: ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/deepseek", "options": { "baseURL": "http://localhost:11434" }, "models": { "deepseek-coder:1.3b": {} } } } } ``` `opencode auth login` --> `ollama` --> `abc` If you include the `/v1` in the localhost URL, it errors and wants an API Key. If you remove the `/v1`, you'll get: <img width="664" height="531" alt="Image" src="https://github.com/user-attachments/assets/0d762604-0285-4785-a261-241ed60f6556" />
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#280