{"slug": "building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python", "title": "Building an Offline, Open-Weight AI Cycling Coach with Llama 3.2 and Python", "summary": "A developer built Touch Grass, an open-source Python utility that runs the open-weight Llama 3.2 3B model locally via Ollama to generate cycling trail routes, gear checklists and safety plans without an internet connection. The script prompts users for a riding location and goal, then queries the on-device model to produce a structured offline trail plan, with the code published on GitHub.", "body_md": "Hey everyone! 👋\n\nFor this year's Hacktoberfest \"Touch Grass\" challenge, I wanted to build something that bridges the gap between technology and the great outdoors—while keeping data privacy front and centre.\n\nMeetTouch Grass: Offline AI Cycling Coach: a lightweight Python utility that runs entirely on your local machine using an open-weight model to generate custom trail routes, gear checklists, and safety plans without needing an internet connection.\n\nWhy Build an Offline Cycling Coach?\n\nMost fitness and outdoor apps rely heavily on cloud APIs, constant connectivity, and tracking your location on remote servers. As a cyclist heading out onto remote trails where cell service drops, I wanted an assistant that:\n\nThe Tech Stack\n\nTo keep things fast, lightweight, and completely local, I used:\n\nPython (`py`) for the logic and terminal interface.\n\nOllama as the local inference engine.\n\nLlama 3.2 (3B) as the open-weight model running locally on-device.\n\nHow It Works\n\nThe script prompts you for your riding location and goals, constructs an expert outdoor coaching prompt, and queries your local Llama 3.2 instance via Ollama. \n\nHere is a sneak peek at the core script (`coach.py`):\n\npython\n\nimport ollama\n\ndef generate_cycling_plan():\n\n    print(\"TOUCH GRASS: LOCAL OFFLINE LLAMA 3.2 COACH \\n\")\n\n```\nlocation = input(\"Enter your trail or riding location: \")\ngoal = input(\"Enter your ride goal (e.g., 20km gravel ride): \")\n\nprompt = f\"\"\"\nAct as an expert outdoor cycling coach and trail mapper. The user is riding in: {location}. Their goal is: {goal}.\nProvide a structured response with:\n1. Terrain and route recommendations.\n2. Essential gear checklist.\n3. Wildlife and traffic safety tips.\n4. A screen-free outdoor encouragement tip.\n\"\"\"\n\nresponse = ollama.chat(model='llama3.2', messages=[\n    {'role': 'user', 'content': prompt}\n])\n\nprint(\"\\n YOUR OFFLINE TRAIL PLAN:\")\nprint(response.message.content)\n```\n\nif **name** == \"**main**\":\n\n    generate_cycling_plan()\n\nThe project is fully open-source. You can check out the complete repository, clone it, and run it locally on your own machine here:\n\n [[https://github.com/Nyateya/touch-grass-bike-couch](https://github.com/Nyateya/touch-grass-bike-couch)]\n\nLet me know what you think, and happy coding (and touching grass) this Hacktoberfest!", "url": "https://wpnews.pro/news/building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python", "canonical_source": "https://dev.to/nyateya/building-an-offline-open-weight-ai-cycling-coach-with-llama-32-and-python-2210", "published_at": "2026-10-08 19:09:30+00:00", "updated_at": "2026-10-08 19:20:10.513528+00:00", "lang": "en", "topics": ["large-language-models", "ai-tools", "developer-tools", "generative-ai"], "entities": ["Llama 3.2", "Ollama", "Python", "GitHub", "Hacktoberfest", "Touch Grass"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python", "markdown": "https://wpnews.pro/news/building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python.md", "text": "https://wpnews.pro/news/building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python.txt", "jsonld": "https://wpnews.pro/news/building-an-offline-open-weight-ai-cycling-coach-with-llama-3-2-and-python.jsonld"}}