Skip to content

Pick a model by number in /models and /model; /context says why it stops at 256K - #142

Merged
nasser1941 merged 1 commit into
mainfrom
feat/model-picker
Oct 18, 2026
Merged

nasser1941 merged 1 commit into
mainfrom
feat/model-picker

Conversation

@nasser1941

Copy link
Copy Markdown
Owner

Why

The user wanted to pick a model straight from the /models list, and not have to type /model <name> afterwards. They also asked for 512K and 1M context options for qwen3.6-35b.

What changes

/models and /model (with no name)

  • Both show the models table with a # column and ask "Switch to which model? (number or name, Enter to keep …)".
  • The list holds the catalog first, then the other installed Ollama models that can chat and call tools.
  • /model 2 or /models 2 switches straight away. Names still work.
  • A catalog model that isn't installed says how to get it (lcode setup <key>).
  • Choosing the current model says "Already using …".
  • For OpenAI-compatible servers, the served models are numbered too.

Embedding models are left out. Ollama lists tools for qwen3-embedding:0.6b (it's in its template) but not completion, so lcode requires both.

/context says why the list stops where it does: "Not offered: 512K and 1M. lcode-qwen3.6-35b was trained on up to 256K tokens, and Ollama caps the window there whatever the memory…".

  • I checked the user's Ollama 0.35.1. It contains requested context size too large for model and caps num_ctx at n_ctx_train, and the GGUF has no RoPE-scaling (YaRN) keys.
  • So 512K would be capped back to 256K behind lcode's back. Its estimated 33 GB would fit that machine's 35 GB budget, but the model can't use it.
  • 512K and 1M stay available for models trained on them, such as nemotron-3.5-lightning.

lcode models in a shell keeps its table without numbers.

Checks

  • Unit tests: tests/test_model_picker.py (7 tests), plus a numbered served list in tests/test_backends.py. The full suite and the strict docs build pass.
  • Real terminal (pty) against the user's real Ollama model list, through a stand-in server that answers loads without loading anything (their model stayed loaded):
    • /models then 6 switched to qwen3.5:9b;
    • /model then Enter kept it;
    • /model 1 switched back at 256K;
    • /context showed the note.
  • Bug found in that run and fixed: the embedding model was listed.

🤖 Generated with Claude Code

…ops at 256K

/models and /model (with no name) show the models table numbered, catalog first,
then the other installed Ollama models that can chat and call tools, and ask
which to switch to: no second /model <name>. /model 2 switches straight away;
names still work; one that isn't installed says how to get it. Embedding
models are left out even when Ollama lists 'tools' for them.

/context explains the sizes it doesn't offer: Ollama caps the window at what
the model was trained on (256K for qwen3.6-35b) whatever the memory, so a 512K
or 1M setting would only look larger.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@nasser1941
nasser1941 merged commit 9b47bba into main Oct 18, 2026
12 checks passed
@nasser1941
nasser1941 deleted the feat/model-picker branch October 18, 2026 08:18
@nasser1941 nasser1941 mentioned this pull request Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant