{"id":31644532,"url":"https://github.com/andrewdmaclean/cyc-tinysnake","last_synced_at":"2026-05-16T17:43:24.221Z","repository":{"id":316502997,"uuid":"1063654681","full_name":"andrewdmaclean/cyc-tinysnake","owner":"andrewdmaclean","description":"Companion repo for “Goodbye World, Hello Battlesnake” talk at the 2025 Commit Your Code Conference","archived":false,"fork":false,"pushed_at":"2025-09-25T00:16:08.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-25T02:32:41.531Z","etag":null,"topics":["javascript","ollama","qwen3","tinyhttp"],"latest_commit_sha":null,"homepage":"https://bit.ly/hello-battlesnake","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andrewdmaclean.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-24T23:59:54.000Z","updated_at":"2025-09-25T01:34:51.000Z","dependencies_parsed_at":"2025-09-25T02:34:11.875Z","dependency_job_id":"1469e8ac-b912-4cd4-91db-9fda19cc0e4e","html_url":"https://github.com/andrewdmaclean/cyc-tinysnake","commit_stats":null,"previous_names":["andrewdmaclean/cyc-tinysnake"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/andrewdmaclean/cyc-tinysnake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdmaclean%2Fcyc-tinysnake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdmaclean%2Fcyc-tinysnake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdmaclean%2Fcyc-tinysnake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdmaclean%2Fcyc-tinysnake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andrewdmaclean","download_url":"https://codeload.github.com/andrewdmaclean/cyc-tinysnake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andrewdmaclean%2Fcyc-tinysnake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278722768,"owners_count":26034461,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","ollama","qwen3","tinyhttp"],"created_at":"2025-10-07T04:53:45.355Z","updated_at":"2026-05-16T17:43:24.214Z","avatar_url":"https://github.com/andrewdmaclean.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Companion repo for **“Goodbye World, Hello Battlesnake”** (Commit Your Code Conference)\n\nThis project shows how to build a tiny [tinyhttp](https://github.com/tinyhttp/tinyhttp) Battlesnake server, then add **strategy control over WebSockets** using **Twilio Conversation Relay** and a **local LLM (Ollama)**.\n\n---\n\n## What you need\n\n- **Node.js 18+**\n- **pnpm** (preferred): `npm i -g pnpm`\n- **ngrok** (to expose `localhost:3000`)\n- **Twilio** (Programmable Voice + **Conversation Relay**)  \n  – a Twilio account and a voice-enabled phone number  \n- **Ollama** (for local LLM): \u003chttps://ollama.com/\u003e\n  – run `ollama serve` and pull the required model:\n  ```bash\n  ollama pull qwen2.5:1.5b\n  ```\n\nCreate a `.env` (based on `.env.example`):\n\n```env\nNGROK_URL=https://your-subdomain.ngrok.app\n```\n\n\u003e `NGROK_URL` is used to form public callback / WS URLs for Twilio \u0026 Battlesnake.\n\n---\n\n## Install\n\n```bash\npnpm install\n```\n\n---\n\n## Run the demos\n\nEach file in `demo/` is standalone and builds on the previous one:\n\n```bash\n# Demo 1: Hello Battlesnake (basic server)\nnpm run 1\n\n# Demo 2: LLM Move (creative strategy interpretation with qwen2.5:1.5b)\nnpm run 2\n\n# Demo 3: Voice Control (Twilio voice updates strategy)\nnpm run 3\n\n# Demo 4: Full Snake (voice + colors + streaming commentary)\nnpm run 4\n# or\nnpm start\n\n# Development mode (auto-reload)\nnpm run dev\n```\n\nServers listen on **http://localhost:3000**.\n\n---\n\n## Expose with ngrok\n\n```bash\nngrok http 3000\n```\n\nCopy the **https** URL into `.env` as `NGROK_URL`.\n\n---\n\n## Project structure\n\n```\n.\n├─ demo/\n│  ├─ 1-hello.js       - Basic Battlesnake server\n│  ├─ 2-llmmove.js     - LLM-powered movement\n│  ├─ 3-voicesnake.js  - Voice control via Twilio\n│  └─ 4-fullsnake.js   - Full implementation with streaming commentary\n├─ package.json\n├─ .env\n└─ README.md\n```\n\n## Features\n\n### Demo 4 (Full Snake) includes:\n- **Voice-controlled strategy**: Say \"go towards where the sun sets\" and the LLM interprets it\n- **Voice-controlled colors**: Say \"Color blue\" to change your snake's color\n- **Streaming commentary**: AI-generated sports commentary streamed in real-time after each game\n- **Educational logging**: Clean emoji-based logs showing what's happening\n\n## Model Used\n\n- **qwen2.5:1.5b**: Handles all tasks - movement strategy, color conversion, and sports commentary generation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewdmaclean%2Fcyc-tinysnake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandrewdmaclean%2Fcyc-tinysnake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandrewdmaclean%2Fcyc-tinysnake/lists"}