diff --git a/notebooks/ollama_nb.ipynb b/notebooks/ollama_nb.ipynb index 7bb57284..6a59530b 100644 --- a/notebooks/ollama_nb.ipynb +++ b/notebooks/ollama_nb.ipynb @@ -25,7 +25,7 @@ "\n", "The easiest way to get started is by getting set up with the Cua development repository.\n", "\n", - "Install [Docker](https://www.docker.com/products/docker-desktop/), [pdm](https://pdm-project.org/en/latest/#recommended-installation-method), and [Ollama](https://ollama.com/) (optional, but recommended for this notebook).\n", + "Install [Docker](https://www.docker.com/products/docker-desktop/) and [pdm](https://pdm-project.org/en/latest/#recommended-installation-method)\n", "\n", "Clone the Cua repository:\n", "\n", @@ -51,7 +51,7 @@ "\n", "- `OPENAI_API_KEY` (if composing with OpenAI)\n", "- `ANTHROPIC_API_KEY` (if composing with Anthropic)\n", - "- `OLLAMA_HOST` (defaults to `http://localhost:11434`)\n", + "- `OLLAMA_API_BASE` (defaults to `http://localhost:11434`)\n", "\n", "Note: For Cua Cloud computers, you would also set `CUA_API_KEY` and `CUA_CONTAINER_NAME`, but this notebook uses Docker for the computer.\n" ] @@ -69,7 +69,7 @@ "ANTHROPIC_API_KEY=\n", "\n", "# Ollama endpoint (default shown)\n", - "OLLAMA_HOST=http://localhost:11434\n", + "OLLAMA_API_BASE=http://localhost:11434\n", "\"\"\"\n", "\n", "from pathlib import Path\n", @@ -93,7 +93,7 @@ "load_dotenv(dotenv_path='.env', override=True)\n", "print('OPENAI_API_KEY set:', bool(os.getenv('OPENAI_API_KEY')))\n", "print('ANTHROPIC_API_KEY set:', bool(os.getenv('ANTHROPIC_API_KEY')))\n", - "print('OLLAMA_HOST:', os.getenv('OLLAMA_HOST', 'http://localhost:11434'))\n" + "print('OLLAMA_API_BASE:', os.getenv('OLLAMA_API_BASE', 'http://localhost:11434'))\n" ] }, { @@ -115,7 +115,7 @@ "\n", "```bash\n", "docker exec -it ollama ollama pull gemma3:4b\n", - "docker exec -it ollama ollama pull blaifa/InternVL3_5\n", + "docker exec -it ollama ollama pull blaifa/InternVL3_5:8b\n", "```\n", "\n", "Make sure your `OLLAMA_HOST` points to `http://localhost:11434`.\n" @@ -177,9 +177,12 @@ "import logging\n", "from pathlib import Path\n", "from agent import ComputerAgent\n", + "import os\n", + "\n", + "os.environ['OLLAMA_API_BASE'] = 'http://localhost:11434'\n", "\n", "agent_all_in_one = ComputerAgent(\n", - " model=\"ollama/blaifa/InternVL3_5\",\n", + " model=\"ollama/blaifa/InternVL3_5:8b\",\n", " tools=[computer],\n", " trajectory_dir=str(Path('trajectories')),\n", " only_n_most_recent_images=3,\n",