Post

Configuring OpenCode with Unsloth Local AI

Today I configured OpenCode to use Qwen3.8-Flash-Next-GGUF served through Unsloth. I am not satisfied using OpenCode with unsloth start opencode command as it seems buggy. Hence I configured it manually.

After downloading the model, on the Model Hub tab I changed the Qwen3.8-Flash-Next-GGUF settings:

  • Context length: maximum
  • Extra arguments: --chat-template-kwargs '{"reasoning_effort":"xhigh"}'
  • Mmap/Mlock: changed from Auto to mmap (saves a lot of RAM, allowing bigger quant models for the Qwen3.8-Flash architecture)
  • Remember for this model: checked

Then Unsloth Settings → API → enabled Keyless API access.

Then I created the OpenCode config:

1
cat ~/.config/opencode/opencode.jsonc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "$schema": "https://opencode.ai/config.json",
  "model": "unsloth/unsloth/Qwen3.8-Flash-Next-GGUF",
  "provider": {
    "unsloth": {
      "name": "Unsloth Local",
      "npm": "@ai-sdk/openai-compatible",
      "options": {
        "baseURL": "http://127.0.0.1:8888/v1"
      },
      "models": {
        "unsloth/Qwen3.8-Flash-Next-GGUF": {
          "name": "Qwen3.8 Flash Next (UD-IQ3_XXS)",
          "tool_call": true,
          "reasoning": true
        }
      }
    }
  }
}

Unsloth Desktop can change reasoning effort to medium or low while the model stays loaded. I could not do the same from within OpenCode. I had to change the extra argument in Unsloth Desktop and then reload the model to make OpenCode use a different reasoning_effort.

With some work, OpenCode is ready for work.

This post is licensed under CC BY 4.0 by the author.