/ quick_cnc_test.py
quick_cnc_test.py
1 #!/usr/bin/env python3 2 import subprocess 3 import sys 4 5 # Try different models 6 models = ["tinyllama", "mistral", "llama2", "codellama"] 7 8 for model in models: 9 print(f"\nš Testing {model}...") 10 try: 11 result = subprocess.run(["ollama", "list"], capture_output=True, text=True) 12 if model in result.stdout: 13 print(f"ā {model} is available!") 14 # Quick test 15 test = subprocess.run(["ollama", "run", model, "print('test')"], 16 capture_output=True, text=True, timeout=10) 17 if test.returncode == 0: 18 print(f" Response: {test.stdout[:50]}...") 19 print(f" ā {model} WORKS!") 20 sys.exit(0) 21 except: 22 continue 23 24 print("\nā No working models found. Please run: ollama pull mistral")