DEV Community

Shaurya Srivastava
Shaurya Srivastava

Posted on

I Built StrideWise: Describe a Walk in One Sentence, and a Local AI Plans the Route

Hacktoberfest Open-Source AI Challenge Week 1: Touch Grass Submission 🌿

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

What I Built

StrideWise is a route planner for walkers and runners. You describe the walk you want in plain English, such as "5 km, shaded, low traffic, finishing near a park," and it generates real routes you can compare on a map.

I wanted to make route planning simpler. Instead of manually checking roads and adjusting filters, you describe what matters to you and let the app find possible routes.

The goal is simple: spend less time planning your walk and more time actually taking it.

Demo

The demo shows how a natural-language request is converted into constraints and used to generate alternative walking or running routes.

Code

GitHub repository:

GitHub logo shauryasri14 / StrideWise

Privacy-first, local-first route planner that uses Ollama, Valhalla, and OpenStreetMap to generate and score walking/running routes based on distance, traffic, shade, surface, elevation, and air quality.

StrideWise

Describe a walk or run in plain English and get a real route you can follow.

"5 km, shaded, low traffic, finishing near a park"

A small language model running on your own machine turns that sentence into structured constraints. A real routing engine builds several candidate routes. OpenStreetMap data is used to estimate traffic, shade and surface. Optional air-quality data is added. The routes are scored with transparent weights, and the top three are shown on a map. Then you close the laptop and go outside.

Built for the Hacktoberfest "Touch Grass" challenge: open-source AI that gets people off the screen.


How it works

Your sentence
   -> Ollama (local LLM)  -> structured JSON constraints (distance, shade, traffic, ...)
   -> Valhalla (routing)  -> about 8 real candidate routes (loops, out-and-back, point-to-point)
   -> OpenStreetMap       -> traffic / shade / surface estimates along each route
   -> Open-Meteo (opt.)   -> air-quality along
…

StrideWise is a local-first route planner built with Ollama, Valhalla, and OpenStreetMap. It generates and ranks routes based on distance, traffic, shade, surface, elevation, and air quality.

How I Built It

The pipeline is straightforward: understand the request, generate routes, analyse them, score them, and display the best options.

  • Ollama with Qwen2.5 3B: A local language model converts the user's request into structured JSON constraints, such as distance, shade, traffic preferences, and destination. It does not generate the route itself.
  • Valhalla: Generates candidate routes using real map data, including loops, out-and-back routes, and point-to-point routes.
  • OpenStreetMap: Provides geographic data used to estimate traffic levels, shade, and surface conditions. These are estimates, not live traffic measurements.
  • Open-Meteo: Supplies optional model-based air-quality data for route evaluation.
  • Scoring system: Ranks the candidate routes using configurable weights and returns three alternatives: Best match, Lowest pollution, and Quietest. Each route includes its metrics and an explanation of why it was ranked that way.
  • Application stack: FastAPI, React, TypeScript, Leaflet, and Docker Compose.

One design decision was to keep the language model's job narrow. It converts the request into constraints, while the routing engine handles the actual geography. This makes the results easier to test and prevents the model from inventing roads or coordinates.

If Ollama is unavailable, the app can fall back to a built-in keyword parser and indicates that fallback in the interface.

Why Does Open Innovation Matter?

Open-source tools made it possible to build the entire routing pipeline without depending on a paid AI or hosted routing API.

  • Local inference: Ollama runs the language model on the user's machine.
  • Real routing: Valhalla generates routes from map data rather than relying on an LLM to invent directions.
  • Customisable ranking: The scoring weights are ordinary code, so the route preferences can be changed without retraining a model.
  • Replaceable components: The language model, routing engine, and scoring logic are separated, making it easier to experiment with alternatives.

There are trade-offs. The user must download a map region, and some geographic data requests still go to external services such as Overpass and Open-Meteo. Traffic and shade depend on available map data, while air-quality estimates have limited street-level resolution.

These limitations are documented in the repository rather than hidden behind a general claim of privacy.

Top comments (0)