A high-performance FastAPI-based vector tile server for PMTiles archives.
- Remote PMTiles Support: Serve tiles directly from PMTiles archives hosted anywhere (S3, HTTP, etc.)
- XYZ Tile API: Standard
/tiles/{z}/{x}/{y}endpoint compatible with any map client that supports MVT/PBF vector tiles - TileJSON Support: Automatic TileJSON generation for easy client integration
- Built-in Viewer: Simple viewer included for instant visualization
Requires Python 3.11 or higher.
-
Install with uv:
uv add fast-pmtiles
-
Or
pip:pip install fast-pmtiles
-
Run the server:
uvicorn fast_pmtiles.main:app
-
View interactive Swagger docs: https://localhost:8000/docs
-
View tiles in your browser:
http://localhost:8000/viewer?url=https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2026-01-21/places.pmtiles -
Get TileJSON description of the PMTiles source:
http://localhost:8000/tilejson.json?url=https://overturemaps-tiles-us-west-2-beta.s3.amazonaws.com/2026-01-21/places.pmtiles
from fast_pmtiles import app
@app.get("/my-new-route")
def my_new_route():
return {"status": "ok"}See .env.example. Settings are defined in settings.py.
-
Clone the repository:
git clone https://github.com/bmcandr/fast-pmtiles.git cd fast-pmtiles -
Install dependencies:
uv sync
-
Install pre-commit hooks:
pre-commit install
-
Run the server in development mode:
fastapi dev src/fast_pmtiles/main.py
uv run pytestThis project uses:
- Ruff for linting and formatting
- pre-commit for automated checks on commit
# Format code
ruff format
# Lint code
ruff checkThis project builds on the excellent work of:
- PMTiles - Cloud-optimized archive format for pyramids of map tiles
- async-pmtiles - Async Python reader for PMTiles
- obstore - Highest-throughput Python interface to S3, GCS & Azure Storage
- FastAPI - Modern, fast web framework for building APIs
- MapLibre GL JS - Open-source map rendering library