Can't seem to execute commands with local models
I was curious about opencode and tried to run it with mistral:7b as well as qwencode3:8b, but it simply couldn't execute a single command.
It was necessary, I think, to be able to execute commands because it kept attempting to write to /home/user. So I told it to run pwd to find out where it was. That always failed.
Was j using a wrong model? Or is opencode just incapable of running commands?
6 replies
Those sound like old models which doesnt help. Generally the best model in my experience is qwen3.6-27b. Ornith 9b is the smallest model ive used that is decent at tool use.
The attempting to write to the wrong folder can be helped by denying a permission in your config. Dont have it off the top of my head.
I only have 8GB VRAM. So I'm limited, hence those smaller models.
What do you mean by deny a permission? Shouldn't it be allowing a permission? I didn't even know there were permissions beyond read write
Ok its the external_directory permission. You set it in you opencode config json file. It should be in your home folders/.config
https://opencode.ai/docs/permissions
I just set "external_directory": "false" and that took care of it
Older models may not know how to tool call which is required for read/write access, in general stay with models released this year.
Qwen3.6-35B-A3B works well for 24GB RAM + 8GB VRAM (I run it on 32+8 via llama.cpp).
Regarding permissions, opencode should have default write permissions by default to current folder and will ask for permission for read/write to external folders (such as /tmp) only when needed.
I'll have to wait another year or two before I can buy a new graphics card that can run this. Thanks for the info though.
A quick test to make sure opencode is working fine, first make sure you're in Build mode by pressing TAB until you see Build. Then prompt:
if it fails to run
datethen writing today.md correctly in current directory, then the model is most likely not able to do tool calling.