Newer
Older
navi-1 / deploy / ollama / Modelfile.qwen-128k
FROM qwen3.6:35b

# The local fallback for the `default` route (see llm.json). Its window matches
# the cloud primary's 131072 tokens so a failover never changes the window the
# compressor and the prompt budget are accounted against.

PARAMETER num_ctx 131072

# Ollama's own memory fit cannot place this model at 128k: it reports
# "need to reduce device memory by 1875 MiB", keeps the user's context anyway,
# and the first real prompt dies mid-prefill with `CUDA error: out of memory`
# (measured 02.11.2026, 24 GiB card, ~1.7 GiB already used by the desktop).
# Pinning the layer count does fit: 40 of 42 layers on the GPU leaves ~400 MiB
# and decodes at ~77 tok/s (7.7k-token prompt: 2369 tok/s prefill). 38 layers
# collapses to 48 tok/s, and 39 OOMs, so do not "optimise" this number down
# without re-measuring both. 41 (auto) is the crashing case.
PARAMETER num_gpu 40

# The model ships an MTP head (nextn) that Ollama enables by default. Measured
# on this host it is slower at every context: 152 -> 129 tok/s at 32k,
# 70 -> 63 tok/s at 86k, and it forces -b 512, costing a third of prefill
# throughput. The head predicts well (70% acceptance at position 1); the MoE
# decode is memory-bound, so verifying extra tokens fetches extra experts and
# eats the gain. Off.
PARAMETER draft_num_predict 0

# The base Modelfile ships presence_penalty 1.5, which penalises repeated tool
# names, paths and field names in agentic turns. Off.
PARAMETER presence_penalty 0

# Qwen3.5/3.6 thinking-mode recommendation. Navi passes its own temperature
# per profile, which wins over these; they apply to direct `ollama run` use.
PARAMETER temperature 0.6
PARAMETER top_p 0.95
PARAMETER top_k 20
PARAMETER min_p 0
PARAMETER repeat_penalty 1