cd /news/ai-tools/leafpace-touch-grass Β· home β€Ί topics β€Ί ai-tools β€Ί article
[ARTICLE Β· art-148510] src=dev.to β†— pub= topic=ai-tools verified=true sentiment=↑ positive

LeafPace - Touch grass

A developer built LeafPace, a zero-backend progressive web app that generates running, walking, and hiking routes in under 30 seconds while keeping GPS coordinates entirely on-device. The app races three Overpass mirrors in parallel and hedges to Nominatim if none responds within 2.5 seconds, and runs the open-weight SmolLM2-360M-Instruct model natively on the phone's GPU via WebLLM and WebGPU, with no closed LLM API used at any point.

key takeaway

Racing three Overpass mirrors in parallel and hedging to Nominatim after a 2.5-second timeout keeps green-space lookup from stalling route generation, while a quantized SmolLM2-360M-Instruct (~250 MB cached) runs on-device via WebGPU and is swappable to Qwen2.5-0.5B/1.5B by changing one constant.

by read2 min views23 publishedOct 9, 2026

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass

The screen must be the shortest part of the experience. 30 seconds on your phone β†’ 45 minutes on the trail.

LeafPace is a zero-backend progressive web app that gets runners, walkers, and hikers off the screen and into the wild β€” in under 30 seconds:

Who it's for: anyone who wants their run or hike to happen outside the algorithm β€” and whose home address shouldn't be uploaded to a fitness social network to do it.

Privacy by architecture: there is no backend. Your GPS coordinates never leave your device β€” every network call LeafPace makes (OSM Overpass, Nominatim, OSRM/Valhalla) is a location-independent public API query, and the AI runs 100% on-device.

πŸ”— Live app: https://big0boy.github.io/LeafPace/ (GitHub Pages, zero hosting cost)

Try it on your phone: open the link, tap πŸƒ Synthesize Trail, then πŸ“± Lock Phone & Touch Grass.

πŸ“¦ Repo: https://github.com/Big0boy/LeafPace β€” every dependency is open source, every data source is an open commons.

Stack: React 18 + TypeScript + Vite + Tailwind, Leaflet, @mlc-ai/web-llm (lazy-loaded), SunCalc, Vitest, plus a dependency-free CDP smoke-test harness (scripts/smoke.mjs) that drives the real app in headless Chromium β€” fake GPS lock, route synthesis, GPX download and XML validation included.

The part I'm proudest of is the green-space lookup, because public open infrastructure is flaky and the app must never fail β€” it races three Overpass mirrors in parallel, hedges to Nominatim (a completely separate OSM service) if none answers in 2.5 s, retries, and only then falls back to synthetic parks:

// First usable answer wins; a broken mirror can never stall route generation.
const winner = await firstSuccess<GreenSpaceLookup>([overpassWave, nominatimWave]);
if (winner) {
  console.info(`${winner.source === 'overpass' ? 'Overpass' : 'Nominatim'} green-space lookup succeeded (${winner.spaces.length} results)`);
  return winner.spaces;
}

The AI core is open-weight models running natively on the phone's GPU via WebLLM (WebGPU):

SmolLM2-360M-Instruct (quantized, ~250 MB cached in the browser) β€” swappable to Qwen2.5-0.5B/1.5B-Instruct by changing one constant in src/services/webgpu-llm.ts. Around the model sits the open geospatial pipeline: Overpass API + Nominatim (green-space discovery), OSRM foot + Valhalla (pedestrian snapping), SunCalc (solar geometry), and a hand-rolled GPX 1.1 serializer. All of it is a static PWA with a service worker β€” deployable anywhere, free forever.

Testing: 29 vitest unit tests (loop geometry, polyline decoding, GPX, mirror-race fallbacks) plus the headless-browser smoke test, both run in CI on every push.

Because both halves of LeafPace only exist because of open infrastructure, and each has a closed-API twin that would be worse for the user:

Entering every category this touches β€” please verify final category names against the challenge page:

AI was used to create this project. The on-device briefing model (SmolLM2-360M-Instruct) is an open-weight model distributed by its creators β€” no closed or proprietary LLM API was used at any point, since the app's premise is that location data must never leave the device.

── more in #ai-tools 4 stories Β· sorted by recency
── more on @leafpace 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/leafpace-touch-grass] indexed:0 read:2min 2026-10-09 Β· β€”