You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+40-9Lines changed: 40 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,21 @@
2
2
3
3
A reusable JavaScript library for interactive map applications with LLM-powered data analysis. MapLibre GL JS on the front end, agentic tool-use with MCP (Model Context Protocol) for SQL analytics via DuckDB.
4
4
5
-
**This repo is the core library.** Individual apps (different datasets, URLs, branding) import these modules from the CDN and provide their own configuration. See [`example/`](example/) for a complete client app template.
5
+
**This repo is the core library.** Individual apps (different datasets, URLs, branding) import these modules from the CDN and provide their own configuration.
@@ -110,6 +127,14 @@ Client apps provide `layers-input.json`:
110
127
-**Object** entries with `assets` cherry-pick specific STAC asset IDs for map layers
111
128
- Asset filtering only affects map toggles — all parquet/H3 data remains available for SQL
112
129
130
+
### LLM configuration
131
+
132
+
There are two ways to supply model credentials:
133
+
134
+
**Server-provided** (Kubernetes / managed deployments): omit the `llm` section from `layers-input.json` and provide a `config.json` on the same server with `llm_models` + API keys. The `k8s/` manifests in `example/` inject secrets this way at deploy time.
135
+
136
+
**User-provided** (static sites — GitHub Pages, Netlify, etc.): set `"user_provided": true` in the `llm` section. A ⚙ button appears in the chat footer; visitors enter their own API key (stored in `localStorage`, never sent to the hosting server). The `default_endpoint` is pre-filled — [OpenRouter](https://openrouter.ai) is a good default giving access to many models via a single key.
137
+
113
138
## Development
114
139
115
140
### Working on the core library
@@ -129,5 +154,11 @@ The `app/` directory includes its own `index.html`, `layers-input.json`, and `sy
129
154
130
155
## Deployment
131
156
132
-
The `k8s/` directory in this repo deploys the core library's own demo instance. See [`example/k8s/`](example/k8s/) for the client app deployment template.
157
+
| Option | Template | How secrets are handled |
158
+
|---|---|---|
159
+
|**GitHub Pages** (or any static host) |[`example-ghpages/`](example-ghpages/)| User enters their own API key in-browser |
160
+
|**Hugging Face Spaces**| Start from either example | Mount a `config.json` as a Space secret-file |
161
+
|**Kubernetes**|[`example/`](example/) with [`k8s/`](example/k8s/)| Secrets injected into `config.json` via ConfigMap + init container |
162
+
163
+
The `k8s/` directory in this repo deploys the core library's own demo instance on the [NRP](https://nrp-nautilus.io) cluster. See [`example/k8s/`](example/k8s/) for the client app deployment template, and [`example/README.md`](example/README.md) for a full walkthrough of all three options.
0 commit comments