I’m pretty new to this local LLM business and hoping to have some input from the experts. I have an AMD card with 12GB VRAM and 32GB system RAM, running Linux. Currently I have llama.cpp up and running, and I tried out models Qwen2.5-Coder-14B-Instruct-GGUF and Qwen-3-14B-GGUF. So far so good.

What I’d like help with is maximizing my context window. From what I understand, I probably have to move to MoE models, but I’m not sure about the llama.cpp config, and which model to pick; I plan to use it for coding and some light reverse engineering.

Let me emphasize something: I do not care about speed! I don’t care if I have to wait 2 minutes for a reply. All I care about is the largest context window I can achieve with my hardware.

Thanks in advance!

  • python
    link
    fedilink
    English
    arrow-up
    5
    ·
    2 days ago

    I’m on AMD, Linux and llama.cpp too, only difference being that I run 16GB VRAM and 16GB system RAM. I have really been enjoying Cyber-Tiel-Coder as It runs at like 120 t/s with a context of <100k when I need quick small stuff but is still super useable at like 300-500k context (Goes down to like 30-40 t/s)

    I don’t run any harnesses or extensions, just the barebone llama server with the standard WebUI that comes with it. Here’s my exact start script, it might be useful to you as a starting off point:

    llama-server \
        --device Vulkan0 \
        --model ~/models/Cyber-Tiel-Coder-35B-A3B-MTP-UD-IQ3_S.gguf \
        --alias ziti \
        --flash-attn on \
        --load-mode none \
        --n-cpu-moe 0 \
        --cache-type-k q8_0 \
        --cache-type-v q8_0 \
        --ctx-size 364000 \
        --context-shift \
        --host 0.0.0.0 \
        --port 8081 \
        --agent
    

    --n-cpu-moe could be useful if the model doesnt quite fully fit on your GPU. Adjust it up to offload MOE layers to your CPU. The speed hit from it is quite noticeable but a whole lot better than not being able to run a model at all.

    --cache-type-k q8_0 and --cache-type-v q8_0 are your context quantizations, putting them on like q4 makes your context go a looooot further but the quality loss is kinda noticeable.

    You could also play around with --no-reasoning-preserve. It does exactly what it says and frees up a whole lof of context inbetween steps. Personally I don’t think that it harms the quality of the output much to enable it, it’s just sometimes annoying then the model chews on the same questions whenever it goes to a new step.

    Oh, I also just remembered that I had this setup for a “small but fast & stupid” model in my setup scripts. Honestly I don’t remember what some of those parameters do anymore but maybe they’re interesting for you idk.

    llama-server \
        --device Vulkan0 \
        --model ~/models/Tiel-Coder-35B-A3B-MTP-UD-IQ3_S.gguf \
        --alias baba \
        --flash-attn on \
        --load-mode none \
        --n-cpu-moe 0 \
        --ctx-size 42000 \
        --cache-type-k q4_0 \
        --cache-type-v q4_0 \
        --n-predict 4096 \
        --context-shift \
        --keep -1 \
        --host 0.0.0.0 \
        --port 8081 \
        --no-reasoning-preserve \
        --agent