Downloads · 30 days
0
flipbitsnotburgers/routegpt-copenhagen
routegpt-copenhagen is a text generation model from flipbitsnotburgers. Use it when you need the model to write or continue text. The card lists the license as mit.
GPT-2 trained to generate walking routes from coordinate token sequences. 8M parameters. Zero knowledge of roads.
Downloads · 30 days
0
Access
Public
Updated Apr 16, 2026
Repo size
51.8 MB
Likes
0
Public
Click a slice to open those files.
.onnx28.1 MB · 54%
From the Hugging Face model README
GPT-2 trained to generate walking routes from coordinate token sequences. 8M parameters. Zero knowledge of roads.
Blog post: We Replaced Our Routing Engine With a Neural Network That Has Never Seen a Map
Live demo: Try it in your browser (27MB ONNX model running via WebAssembly)
We discretized Copenhagen into a 2048x2048 grid (~7m per cell) and trained GPT-2 to autocomplete walking routes as token sequences. Each coordinate becomes two tokens (row, column). The model learns to generate plausible walking paths without any knowledge of the road network.
grid/ - Grid tokenization model (PyTorch, HuggingFace format)
config.json, model.safetensors, generation_config.jsongrid/onnx/model.onnx - ONNX export for browser inference (27MB)[BOS, start_lat, start_lng, end_lat, end_lng, SEP, wp1_lat, wp1_lng, wp2_lat, wp2_lng, ..., EOS]
from transformers import GPT2LMHeadModel, GPT2Config
import torch
config = GPT2Config.from_pretrained("flipbitsnotburgers/routegpt-copenhagen", subfolder="grid")
model = GPT2LMHeadModel.from_pretrained("flipbitsnotburgers/routegpt-copenhagen", subfolder="grid")
# Encode start/end coordinates
GRID_SIZE = 2048
LAT_MIN, LAT_MAX = 55.60, 55.75
LNG_MIN, LNG_MAX = 12.45, 12.70
BOS, EOS, SEP = 4096, 4097, 4098
def encode(lat, lng):
lat_bin = int((lat - LAT_MIN) / (LAT_MAX - LAT_MIN) * (GRID_SIZE - 1))
lng_bin = int((lng - LNG_MIN) / (LNG_MAX - LNG_MIN) * (GRID_SIZE - 1)) + GRID_SIZE
return lat_bin, lng_bin
s_lat, s_lng = encode(55.67, 12.57)
e_lat, e_lng = encode(55.68, 12.58)
prompt = torch.tensor([[BOS, s_lat, s_lng, e_lat, e_lng, SEP]])
output = model.generate(prompt, max_new_tokens=300, temperature=0.6, top_k=20, eos_token_id=EOS)
Shady Baby is a stroller-friendly walking app for Copenhagen. RouteGPT was an experiment in replacing traditional routing with neural sequence generation.