|
52 | 52 | "source": [ |
53 | 53 | "## ⚙️ Prerequisites\n", |
54 | 54 | "\n", |
55 | | - "**Start vLLM teacher server in a separate terminal:**\n", |
| 55 | + "**Ensure Ollama teacher server is running:**\n", |
56 | 56 | "\n", |
57 | 57 | "```bash\n", |
58 | | - "pip install vllm\n", |
| 58 | + "# Check if Ollama is running\n", |
| 59 | + "sudo systemctl status ollama\n", |
59 | 60 | "\n", |
60 | | - "vllm serve unsloth/Meta-Llama-3.1-8B-Instruct \\\n", |
61 | | - " --dtype bfloat16 \\\n", |
62 | | - " --max-model-len 8192 \\\n", |
63 | | - " --port 8000\n", |
| 61 | + "# If not running, start it\n", |
| 62 | + "sudo systemctl start ollama\n", |
| 63 | + "\n", |
| 64 | + "# Pull Mixtral model if not already available\n", |
| 65 | + "ollama pull mixtral:8x22b\n", |
| 66 | + "\n", |
| 67 | + "# Verify it's available\n", |
| 68 | + "ollama list\n", |
64 | 69 | "```\n", |
65 | 70 | "\n", |
66 | | - "**Verify:**\n", |
| 71 | + "**Test the model:**\n", |
67 | 72 | "```bash\n", |
68 | | - "curl http://localhost:8000/v1/models\n", |
| 73 | + "curl http://localhost:11434/api/tags\n", |
69 | 74 | "```\n", |
70 | 75 | "\n", |
71 | | - "Expected: `{\"data\": [{\"id\": \"unsloth/Meta-Llama-3.1-8B-Instruct\", ...}]}`\n", |
| 76 | + "Expected: JSON response listing `mixtral:8x22b` in the models array.\n", |
72 | 77 | "\n", |
73 | 78 | "---" |
74 | 79 | ] |
|
310 | 315 | "id": "88bdad8b", |
311 | 316 | "metadata": {}, |
312 | 317 | "source": [ |
313 | | - "## 4️⃣ Verify vLLM Teacher Server" |
| 318 | + "## 4️⃣ Verify Ollama Teacher Server" |
314 | 319 | ] |
315 | 320 | }, |
316 | 321 | { |
|
332 | 337 | "source": [ |
333 | 338 | "import requests\n", |
334 | 339 | "\n", |
335 | | - "VLLM_API_URL = \"http://localhost:8001/v1/chat/completions\"\n", |
336 | | - "VLLM_MODELS_URL = \"http://localhost:8001/v1/models\"\n", |
| 340 | + "OLLAMA_API_URL = \"http://localhost:11434/api/chat\"\n", |
| 341 | + "OLLAMA_TAGS_URL = \"http://localhost:11434/api/tags\"\n", |
337 | 342 | "\n", |
338 | | - "print(\"Checking vLLM teacher server...\")\n", |
| 343 | + "print(\"Checking Ollama teacher server...\")\n", |
339 | 344 | "try:\n", |
340 | | - " response = requests.get(VLLM_MODELS_URL, timeout=5)\n", |
| 345 | + " response = requests.get(OLLAMA_TAGS_URL, timeout=5)\n", |
341 | 346 | " if response.status_code == 200:\n", |
342 | 347 | " models = response.json()\n", |
343 | | - " print(f\"✅ vLLM server running!\")\n", |
344 | | - " print(f\" Model: {[m['id'] for m in models.get('data', [])]}\")\n", |
| 348 | + " model_names = [m['name'] for m in models.get('models', [])]\n", |
| 349 | + " print(f\"✅ Ollama server running!\")\n", |
| 350 | + " print(f\" Available models: {model_names}\")\n", |
| 351 | + " \n", |
| 352 | + " if 'mixtral:8x22b' in model_names:\n", |
| 353 | + " print(f\" ✅ Mixtral model ready for training\")\n", |
| 354 | + " else:\n", |
| 355 | + " print(f\" ⚠️ Mixtral model not found!\")\n", |
| 356 | + " print(f\" Run: ollama pull mixtral:8x22b\")\n", |
345 | 357 | " else:\n", |
346 | 358 | " print(f\"⚠️ Server responded with status {response.status_code}\")\n", |
347 | 359 | "except requests.exceptions.RequestException as e:\n", |
348 | | - " print(f\"❌ vLLM server not reachable!\")\n", |
| 360 | + " print(f\"❌ Ollama server not reachable!\")\n", |
349 | 361 | " print(f\" Error: {e}\")\n", |
350 | | - " print(f\"\\n Start server in separate terminal:\")\n", |
351 | | - " print(f\" vllm serve unsloth/Meta-Llama-3.1-8B-Instruct --dtype bfloat16 --port 8001\")\n", |
| 362 | + " print(f\"\\n Start server:\")\n", |
| 363 | + " print(f\" sudo systemctl start ollama\")\n", |
| 364 | + " print(f\"\\n Pull model:\")\n", |
| 365 | + " print(f\" ollama pull mixtral:8x22b\")\n", |
352 | 366 | " raise SystemExit(\"Teacher server required for training\")\n" |
353 | 367 | ] |
354 | 368 | }, |
|
357 | 371 | "id": "2c07d318", |
358 | 372 | "metadata": {}, |
359 | 373 | "source": [ |
360 | | - "## 5️⃣ Test Teacher Validation" |
| 374 | + "## 5️⃣ Test Teacher Validation (Ollama Mixtral)" |
361 | 375 | ] |
362 | 376 | }, |
363 | 377 | { |
|
0 commit comments