# Self-host the geolith router from a .glx file (in development)

> How the geolith router serves Valhalla-compatible /route, /sources-to-targets, /isochrone, /trace-route and /trace-attributes from one .glx file in R2 or on local disk, with no database. In development and not deployed; nothing to download yet.

---
title: Self-host the geolith router from a .glx file (in development)
description: 'How the geolith router serves Valhalla-compatible /route, /sources-to-targets, /isochrone, /trace-route and /trace-attributes from one .glx file in R2 or on local disk, with no database. In development and not deployed; nothing to download yet.'
date: '2026-11-08'
tags: [routing, self-hosting, cloudflare workers, r2, valhalla]
minutes: 8
product: routing
faqs:
  - q: Can I run the router today?
    a: Not yet. The router is a Rust library with a Cloudflare Worker app around it; neither is distributed. A test Worker runs on a geolith-built Berlin file, and it is not public.
  - q: How fast is it?
    a: No figures are published. Latency and cost will be measured on a deployed server before routing is offered.
---

**Status: routing is in development and not deployed.** There is no router to download, no hosted endpoint, and no routing plan, price or key. This guide describes how the router runs so you can plan a deployment.

The geolith router answers Valhalla-compatible routing requests from **one `.glx` file** with a routing part, and nothing else: no database, no graph to load into memory before the first request.

## What you need

1. A `.glx` file with a routing part, written by the builder: see [build a routing .glx file](/guides/build-a-routing-glx).
2. Somewhere to keep the file: an R2 bucket for a Cloudflare Worker, or local disk for a server.
3. The router. It is a Rust library with no I/O of its own: it asks for the bytes a request needs and the app around it fetches them.

## How the router reads the file

At start the router reads the file header, finds the routing part, and keeps the tile index and the zstd dictionary in memory. Each request then fetches only the 64 KiB blocks its search touches:

- **Cloudflare Worker:** the router compiled to WebAssembly; the file in R2; one range read per block. Decoded blocks are cached per isolate.
- **Server:** the same library next to a file on local disk; one file read per block. A packaged server binary is planned.

## The endpoints it serves

| Path                  | What it answers                                |
| --------------------- | ---------------------------------------------- |
| `/route`              | A route between two or more points             |
| `/sources-to-targets` | A time and distance matrix                     |
| `/isochrone`          | The area reachable within a time or a distance |
| `/trace-route`        | A GPS trace snapped to roads, as a route       |
| `/trace-attributes`   | The road attributes along a GPS trace          |

Bodies are Valhalla's; costing is `auto`, `pedestrian` or `bicycle`. Paths are kebab-case: a Valhalla client needs a new base URL and the path changes in [migrate a Valhalla client](/guides/migrate-valhalla-client-to-geolith-routing).

## Live speeds and closures

Live speeds and closures are not in the file. The program that runs the router supplies them beside it, so the `.glx` file stays immutable and cacheable. They apply to requests with a `date_time`. See [traffic and live data](/routing/traffic).


Routing is in development and not deployed; there is no endpoint to call yet, and no routing plan, price or key. Read the routing docs: https://docs.geolith.app/routing
