#!/usr/bin/env bash # doctor on a server provider: model ids against the catalogue, and Ollama's # server-side context window. . "$(dirname "$0")/../lib.sh" start_fake ready_preset ollama "$OLLAMA_URL" set_state ollama ollama run_cm doctor expect_out "Ollama reachable at $OLLAMA_URL" 'the server is found' expect_out 'opus qwen3-coder [30.5B Q4_K_M]' 'a bare name matches its :latest tag' expect_no_out 'NOT available' 'no model is reported missing' expect_out 'loaded with a 4096-token context, below the declared 65536' 'the short server context is caught' expect_out 'OLLAMA_CONTEXT_LENGTH=65536' 'and the fix is named' ready_preset lmstudio "$LMSTUDIO_URL" python3 "$J" set-all "$P/lmstudio.json" gemma-small >/dev/null set_state lmstudio lmstudio run_cm doctor expect_out 'gemma-small [not-loaded, ctx 8192]' 'lm studio models show their state' expect_out 'below the declared 262144 - this tier can overflow' 'a small model window is warned about' python3 "$J" set-url "$P/lmstudio.json" http://127.0.0.1:1 >/dev/null run_cm doctor expect_out 'LM Studio not reachable' 'a dead server is a failure' finish