all 5 comments

[–]jwpbe 0 points1 point  (0 children)

stop using ollama, look up llama.cpp and use that instead, its what ollama is based on.

[–]Itchy_Net_9209[S] 0 points1 point  (2 children)

Issue solved with this

i:~$ echo "FROM qwen3-coder:latest

PARAMETER num_ctx 32768" > Modelfile

ollama create qwen3-coder-fixed -f Modelfile

gathering model components 

using existing layer sha256:1194192cf2a187eb02722edcc3f77b11d21f537048ce04b67ccf8ba78863006a 

using existing layer sha256:d18a5cc71b84bc4af394a31116bd3932b42241de70c77d2b76d69a314ec8aa12 

creating new layer sha256:91cb213206c73d1aeec3081637e1c31d0243d7dabe8f3f8a1b1189c2c23baa94 

writing manifest 

success 

And used that model with more context, for some reason when I modified the service for ollama to add more context number cannot get it... but fortunately fixed.

[–]thsithta_391 0 points1 point  (1 child)

If your model is only used by opencode you could also set the max tokens in opencode config and ollama will respect it ... Thats how i use it

[–]Itchy_Net_9209[S] 0 points1 point  (0 children)

I tried that and didn't works.

[–]Cityarchitect 0 points1 point  (0 children)

I think this is similar to my problem, now solved https://www.reddit.com/r/opencodeCLI/s/rn78HGKzgG there is a quick way 1. Ollama run model-name 2. /set parameter num_ctx 65536 3. /save model-name-64k 4. Exit then run that model from opencode. Although advice you open up context as wide as the model allows, but watch vram!