diff --git a/README.md b/README.md index 858bcb1c68..1c4213f94b 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Every screenshot is RustGIS itself, rendered offscreen by `cargo run -p rustgis- | **Imagery** | Ortho and reality mapping, pixel classification (k-means, minimum distance, a trainable neural network), mensuration, hosted imagery tiles | | **Layouts and reports** | Page layouts with map frames, legends, scale bars, grids, bar and column charts and map series; publication sheets and figures in one command, format panes, guides, snapping and element locks; reports with groups, statistics, charts and subreports; vector PDF and SVG, and GeoPDF with [supported map frames](docs/user-guide/layouts.md#layouts) georeferenced; presentations (HTML slideshow, PDF); notebooks (Jupyter in and out) | | **Sharing** | PNG export at up to 600 DPI; PDF; web map pages, OGC API Features collections, MapLibre styles, glTF and STL scenes, vector and raster PMTiles, the map view as a GeoTIFF placed on the ground (desktop), locators; the web app embedded in a page (`?embed`); project, map and mobile map packages; offline areas with sync | -| **AI Assistant** | Ask about your data or tell the map what to do in plain language, attaching pictures and letting it look at the map and layouts, with Anthropic, OpenAI (a key, or your ChatGPT plan by signing in on the desktop or command line), Gemini, OpenRouter, Requesty, TrustedRouter, Opper, Ollama or any OpenAI-compatible model; also `rustgis-cli ask`, and an [MCP server](docs/mcp.md) (`rustgis-cli mcp`) for Claude Code, Cursor, VS Code and other agents; skills; on the desktop, agents such as Claude Code and Codex started from the app, and external AI clients driving the open app; keys optionally remembered in the system keychain on the desktop (in the web app, unencrypted in the browser's storage) | +| **AI Assistant** | Ask about your data or tell the map what to do in plain language, attaching pictures and letting it look at the map and layouts, with Anthropic, OpenAI (a key, or your ChatGPT plan by signing in on the desktop or command line), Gemini, OpenRouter, Requesty, TrustedRouter, Opper, LLMTR, Ollama or any OpenAI-compatible model; also `rustgis-cli ask`, and an [MCP server](docs/mcp.md) (`rustgis-cli mcp`) for Claude Code, Cursor, VS Code and other agents; skills; on the desktop, agents such as Claude Code and Codex started from the app, and external AI clients driving the open app; keys optionally remembered in the system keychain on the desktop (in the web app, unencrypted in the browser's storage) | | **Plugins** | Sandboxed WebAssembly [plugins](docs/plugins.md) add commands, tools and ribbon tabs; install them from [plugins.rustgis.app](https://plugins.rustgis.app) on the desktop, command line and web. Process plugins (desktop and command line) run as programs (with Python environments RustGIS makes), in the background or for the whole session; panels offer trees, dropdowns, date pickers and sliders | | **Python** | The [`rustgis` package](docs/python.md) on PyPI: the engine in-process, `rustgis.Map` in Jupyter and `rustgis.qt.MapWidget` in Qt applications | | **Interface** | Layers, Browser and Data Sources panes as tabs, command search (Ctrl+K), keyboard shortcuts, dark mode, custom themes (desktop) and an interface scale, a customizable ribbon and Quick Access Toolbar, linked side-by-side maps, a History pane of tool runs and the session log, autosave and crash recovery (desktop), Check for Updates (desktop), 22 languages | diff --git a/apps/rustgis-cli/src/main.rs b/apps/rustgis-cli/src/main.rs index f5c18234bb..628da63675 100644 --- a/apps/rustgis-cli/src/main.rs +++ b/apps/rustgis-cli/src/main.rs @@ -12,7 +12,7 @@ //! rustgis-cli run … --strict [--allow dropped.ring] # exit 3 when a command loses data (see the guide's loss codes) //! rustgis-cli run … --threads 4 # the most threads one piece of work uses (default: the cores, up to 16) //! rustgis-cli ask [--sample | --project p.rgis | --data f.geojson …] "Which cities have over 10 million people?" \ -//! [--provider anthropic|openai|chatgpt|gemini|openrouter|ollama|custom|requesty|trustedrouter|opper] [--model M] [--base-url URL] [--yes] [--save out.rgis] [--trace log.txt] +//! [--provider anthropic|openai|chatgpt|gemini|openrouter|ollama|custom|requesty|trustedrouter|opper|llmtr] [--model M] [--base-url URL] [--yes] [--save out.rgis] [--trace log.txt] //! rustgis-cli ask --sample "Style the countries like this map" --image reference.png # pictures go with the request (up to 4) //! rustgis-cli ask --models [--provider P] # list the provider's models //! rustgis-cli ask --accounts | --account CLIENT_ID # list or select a saved registration diff --git a/crates/assistant/src/provider.rs b/crates/assistant/src/provider.rs index 1946a8a3a6..cbc2c5f8e9 100644 --- a/crates/assistant/src/provider.rs +++ b/crates/assistant/src/provider.rs @@ -167,6 +167,18 @@ pub const PRESETS: &[Preset] = &[ key_url: "https://platform.opper.ai", login: false, }, + Preset { + id: "llmtr", + label: "LLMTR", + api: Api::OpenAi, + base_url: "https://llmtr.com/v1", + model: "qwen/qwen3.8-flash", + key_env: &["LLMTR_API_KEY"], + url_env: "", + keyless: false, + key_url: "https://llmtr.com/dashboard/keys", + login: false, + }, ]; /// The preset with this id. diff --git a/crates/assistant/src/tests.rs b/crates/assistant/src/tests.rs index d5839e6cef..4a9bdde72c 100644 --- a/crates/assistant/src/tests.rs +++ b/crates/assistant/src/tests.rs @@ -115,6 +115,9 @@ fn first_keyed_provider_is_the_first_key_provider_and_never_a_sign_in() { // Opper comes after Requesty, so its key never takes the place of another provider's either. assert_eq!(first_keyed(keyed(&["opper", "requesty"])), Some("requesty")); assert_eq!(first_keyed(keyed(&["opper"])), Some("opper")); + // LLMTR comes last, for the same reason. + assert_eq!(first_keyed(keyed(&["llmtr", "opper"])), Some("opper")); + assert_eq!(first_keyed(keyed(&["llmtr"])), Some("llmtr")); assert_eq!(first_keyed(keyed(&[])), None); } @@ -1025,6 +1028,17 @@ fn opper_lists_its_models_with_a_bearer_key() { assert!(req.headers.iter().any(|(k, v)| k == "Authorization" && v == "Bearer k")); } +#[test] +fn llmtr_lists_its_models_with_a_bearer_key() { + let p = preset("llmtr").expect("LLMTR preset"); + assert_eq!((p.api, p.keyless, p.login), (Api::OpenAi, false, false)); + assert_eq!(p.key_env, &["LLMTR_API_KEY"]); + assert_eq!(p.model, "qwen/qwen3.8-flash"); + let req = models_request(&cfg("llmtr")); + assert_eq!(req.url, "https://llmtr.com/v1/models"); + assert!(req.headers.iter().any(|(k, v)| k == "Authorization" && v == "Bearer k")); +} + #[test] fn empty_replies_are_reported() { let mut s = sample(); diff --git a/docs/cli.md b/docs/cli.md index 5861861639..930dd3dba5 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -181,7 +181,7 @@ rustgis-cli ask --login # sign in with ChatGPT to us rustgis-cli ask --sample --provider chatgpt "Zoom to Tokyo" ``` -The provider is `--provider` (`anthropic`, `openai`, `chatgpt`, `gemini`, `openrouter`, `ollama`, `custom`, `requesty`, `trustedrouter`, `opper`), +The provider is `--provider` (`anthropic`, `openai`, `chatgpt`, `gemini`, `openrouter`, `ollama`, `custom`, `requesty`, `trustedrouter`, `opper`, `llmtr`), else `RUSTGIS_ASSISTANT_PROVIDER`, else the first with a key in the environment, else the app's saved provider when `--use-saved-secrets` is set, else Ollama. ChatGPT sign-in is used only when that provider is selected. Account management and `--models` do not read saved API keys: diff --git a/docs/user-guide/assistant.md b/docs/user-guide/assistant.md index eb1f418920..3763552fb2 100644 --- a/docs/user-guide/assistant.md +++ b/docs/user-guide/assistant.md @@ -102,6 +102,7 @@ Click the model name or the gear to open the settings. The assistant works with: | Requesty | `anthropic/claude-sonnet-5-5` | [app.requesty.ai](https://app.requesty.ai/api-keys), or `REQUESTY_API_KEY`; for the EU, set the **Address** to `https://router.eu.requesty.ai/v1` | | TrustedRouter | `trustedrouter/auto` | [trustedrouter.com](https://trustedrouter.com), or `TRUSTEDROUTER_API_KEY` | | Opper | `claude-sonnet-5-5` | [platform.opper.ai](https://platform.opper.ai), or `OPPER_API_KEY` | +| LLMTR | `qwen/qwen3.8-flash` | [llmtr.com/dashboard/keys](https://llmtr.com/dashboard/keys), or `LLMTR_API_KEY` | The ↻ button lists the provider's models. The provider and model you last chose in the settings are used at start. Until you choose one, `RUSTGIS_ASSISTANT_PROVIDER` and