77# Usage: select-model.sh [options]
88# --task-type=<research|coding|review|decision|default>
99# --cost-sensitive (flag - prefer free local models)
10- # --private (flag - sensitive data, must use local Ollama )
10+ # --private (flag - sensitive data, must use local MLX )
1111# --large-context (flag - need 1M+ context window)
1212# --analyze-complexity=<prompt|filepath> (optional complexity analysis)
1313#
@@ -132,9 +132,10 @@ select_model() {
132132
133133 # Step 1: Is the data sensitive or confidential?
134134 if [[ " $private " == " true" ]]; then
135- echo " Model: ollama"
136- echo " Selected: deepseek-r1:70b (local reasoning) or qwen3-next:80b (local general)"
137- echo " Command: ollama run deepseek-r1:70b"
135+ echo " Model: mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit"
136+ echo " Selected: mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit (local reasoning) or mlx-community/Qwen3-235B-A22B-4bit (local general)"
137+ # Use PAL MCP chat tool: pal chat --model mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit "<prompt>"
138+ echo " Command: pal chat --model mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit"
138139 echo " Rationale: Private/sensitive data must stay local. Never use cloud APIs."
139140 return 0
140141 fi
@@ -143,32 +144,37 @@ select_model() {
143144 if [[ " $cost_sensitive " == " true" ]]; then
144145 case " $task_type " in
145146 coding)
146- echo " Model: qwen3-coder:30b"
147- echo " Command: ollama run qwen3-coder:30b"
147+ echo " Model: mlx-community/Qwen3-Coder-30B-A3B-Instruct"
148+ # Use PAL MCP chat tool: pal chat --model mlx-community/Qwen3-Coder-30B-A3B-Instruct "<prompt>"
149+ echo " Command: pal chat --model mlx-community/Qwen3-Coder-30B-A3B-Instruct"
148150 echo " Rationale: Cost-sensitive coding task - using free local specialized model"
149151 return 0
150152 ;;
151153 review)
152- echo " Model: deepseek-r1:70b"
153- echo " Command: ollama run deepseek-r1:70b"
154+ echo " Model: mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit"
155+ # Use PAL MCP chat tool: pal chat --model mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit "<prompt>"
156+ echo " Command: pal chat --model mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit"
154157 echo " Rationale: Cost-sensitive code review - using free local reasoning model"
155158 return 0
156159 ;;
157160 research)
158- echo " Model: qwen3-next:80b"
159- echo " Command: ollama run qwen3-next:80b"
161+ echo " Model: mlx-community/Qwen3-235B-A22B-4bit"
162+ # Use PAL MCP chat tool: pal chat --model mlx-community/Qwen3-235B-A22B-4bit "<prompt>"
163+ echo " Command: pal chat --model mlx-community/Qwen3-235B-A22B-4bit"
160164 echo " Rationale: Cost-sensitive research/analysis - using free local general model"
161165 return 0
162166 ;;
163167 decision)
164- echo " Model: deepseek-r1:70b + qwen3-next:80b"
165- echo " Command: bash -c 'echo \" Model 1 (DeepSeek R1):\" && ollama run deepseek-r1:70b && echo -e \"\\ nModel 2 (Qwen):\" && ollama run qwen3-next:80b'"
168+ echo " Model: mlx-community/DeepSeek-R1-Distill-Llama-70B-4bit + mlx-community/Qwen3-235B-A22B-4bit"
169+ # Use PAL MCP clink tool for parallel multi-model: pal clink "<prompt>"
170+ echo " Command: pal clink"
166171 echo " Rationale: Cost-sensitive critical decision - using best-reasoning + general local models"
167172 return 0
168173 ;;
169174 default)
170- echo " Model: qwen3-next:80b"
171- echo " Command: ollama run qwen3-next:80b"
175+ echo " Model: mlx-community/Qwen3-235B-A22B-4bit"
176+ # Use PAL MCP chat tool: pal chat --model mlx-community/Qwen3-235B-A22B-4bit "<prompt>"
177+ echo " Command: pal chat --model mlx-community/Qwen3-235B-A22B-4bit"
172178 echo " Rationale: Cost-sensitive generic task - using free local model"
173179 return 0
174180 ;;
@@ -231,9 +237,11 @@ select_model() {
231237 fi
232238
233239 # Default: Start local, fall back to cloud
234- echo " Model: ollama-with-fallback"
235- echo " Selected: qwen3-next:80b (local) → gemini-3-pro (cloud fallback)"
236- echo " Command: ollama run qwen3-next:80b || gemini chat --model gemini-3-pro"
240+ echo " Model: mlx-with-fallback"
241+ echo " Selected: mlx-community/Qwen3-235B-A22B-4bit (local) → gemini-3-pro (cloud fallback)"
242+ # Use PAL MCP chat tool with local model first: pal chat --model mlx-community/Qwen3-235B-A22B-4bit "<prompt>"
243+ # Fall back to cloud: pal chat --model gemini-3-pro "<prompt>"
244+ echo " Command: pal chat --model mlx-community/Qwen3-235B-A22B-4bit"
237245 echo " Rationale: Default/general task - try local first for cost/privacy, fall back to cloud if needed"
238246 return 0
239247}
0 commit comments