Turn GeoJSON into prose. A small FastAPI service that takes a GeoJSON description of a scene and asks an LLM to produce one of three things:
- A window view — natural-language description, as if you were standing there.
- An answer to a question — pass a
promptalong with the scene. - An image-generation prompt — text suitable for feeding to an image model.
geobard speaks the OpenAI chat-completions API, so it works with OpenAI directly, OpenRouter, Ollama, Groq, Together, or any other compatible backend. OpenRouter is the default.
docker run --rm -p 8000:8000 \
-e GEOBARD_OPENAI_API_KEY=sk-or-... \
-e GEOBARD_OPENAI_MODEL=anthropic/claude-haiku-4.5 \
ghcr.io/openfantasymap/geobard:latestcurl -sS http://localhost:8000/narrate/window \
-H "content-type: application/json" \
-d '{
"geojson": {
"type": "FeatureCollection",
"pov": {"lat": 44.49, "lng": 11.34},
"bearing": 90,
"time_of_day": "07:30",
"features": [
{"type":"Feature","properties":{"type":"buildings","name":"market hall"},"geometry":{"type":"Point","coordinates":[11.341,44.490]}}
]
},
"detail_level": "medium",
"system": ["You narrate a Forgotten Realms scene."]
}'Generic window view. Body:
{
"geojson": {<feature collection>},
"system": ["optional", "system", "prompt", "lines"],
"detail_level": "low | medium | high",
"model": "anthropic/claude-haiku-4.5", // optional override
"temperature": 0.7 // optional override
}Returns {"text": "...", "model": "..."}.
Custom question about the scene. Body:
{
"geojson": {<feature collection>},
"prompt": "What's the easiest way out of here on foot?",
"system": ["optional"],
"model": "...",
"temperature": 0.7
}Produces a prompt suitable for an image-generation model. Body:
{
"geojson": {<feature collection>},
"image_system": ["optional", "style", "hints"],
"detail_level": "medium",
"model": "...",
"temperature": 0.7
}Returns {"status": "ok"} once env is validated. Used by Docker healthcheck.
| Env | Required | Default | Purpose |
|---|---|---|---|
GEOBARD_OPENAI_API_KEY |
yes | — | OpenAI-compatible API key. |
GEOBARD_OPENAI_MODEL |
yes | — | Default model id (overridable per request). |
GEOBARD_OPENAI_BASE_URL |
no | https://openrouter.ai/api/v1 |
Override for any OpenAI-compatible endpoint. |
GEOBARD_TEMPERATURE |
no | 0.7 |
Default sampling temperature. |
GEOBARD_HOST |
no | 0.0.0.0 |
Bind address. |
GEOBARD_PORT |
no | 8000 |
Bind port. |
python -m venv .venv && . .venv/bin/activate
pip install -e .[test]
pytest
uvicorn geobard.app:app --reloadDual-licensed under either of MIT or Apache-2.0, at your option.