104 lines
4.5 KiB
Markdown
104 lines
4.5 KiB
Markdown
# omniroute-plugin
|
|
|
|
OmniRoute gateway integration for the DeepSeek Harness (DSH): **model auto-import** (context window, max output, modalities, thinking levels) and **provider quota tracking** under the composer.
|
|
|
|
## Features
|
|
|
|
- **Model discovery / import**: pulls models and combos from your OmniRoute gateway into an `llm-pi-ai` provider (default id `omni`, created if missing), with context window, output limit, input modalities and supported thinking levels (`off/minimal/low/medium/high/xhigh/max`).
|
|
- **Periodic re-import** (`syncMin`, default 60 min; 0 = manual only) and an *update existing models only* mode.
|
|
- **Include / exclude filters**: comma-separated glob patterns (`*`, `?`) on model ids, e.g. `claude*, gemini-*`; exclude always wins.
|
|
- **Manage imported models**: search, select and prune models from the provider.
|
|
- **Quota tracking**: provider quotas (5-hour, weekly, monthly, …) shown in the composer dock, refreshed every `pollSec` seconds (default 120); requires a management-scoped API key.
|
|
- English and Chinese UI.
|
|
|
|
## Files
|
|
|
|
| File | Role |
|
|
| --- | --- |
|
|
| `index.js` | Host plugin. Injects `webServer`, `connection`, `credentials`, `settings`. |
|
|
| `client.js` | Web client: settings panel (`plugins.bundle.config`) and quota dock (`conversation.composer.dock`). |
|
|
| `locale/*.json` | Plugin title/description (en, zh). |
|
|
| `cordis.patch.yml` | Bundle patch inserting the `omniroute` row. |
|
|
|
|
### Host routes (relative to the Web origin, behind the connection trust fence)
|
|
|
|
| Route | Purpose |
|
|
| --- | --- |
|
|
| `GET /omniroute/status` | Effective settings, key presence, last import |
|
|
| `POST /omniroute/config` | Save settings (+ optional write-only API key) |
|
|
| `POST /omniroute/test` | Probe the gateway with given or saved credentials |
|
|
| `GET /omniroute/models` | Models currently imported |
|
|
| `POST /omniroute/prune` | Remove selected imported models |
|
|
| `POST /omniroute/import` | Import models/combos into the `llm-pi-ai` provider |
|
|
| `GET /omniroute/quotas` | Provider quotas (`?model=<id>` narrows to that model's provider) |
|
|
|
|
## Installation
|
|
|
|
Requirements: a working DeepSeek Harness (`dsh`) install with the **web** profile (or any profile that includes the Web UI).
|
|
|
|
### Option A — install from git (recommended)
|
|
|
|
```bash
|
|
dsh plugin --profile web add git+https://git.rizzy.dev/DSH-Plugins/omniroute-plugin.git
|
|
```
|
|
|
|
You can also paste `git+https://git.rizzy.dev/DSH-Plugins/omniroute-plugin.git` into **Settings → Plugins → Install** in the Web UI, or ask the agent to install it with its `plugin_manager` tool (`install_bundle`).
|
|
|
|
The plugin manager adds `@local/omniroute` to `dependencies` and to `dsh.profile.bundles` in `~/.dsh/profiles/web/package.json`.
|
|
|
|
### Option B — local checkout (for development)
|
|
|
|
```bash
|
|
git clone https://git.rizzy.dev/DSH-Plugins/omniroute-plugin.git ~/dsh-plugins/omniroute-plugin
|
|
dsh plugin --profile web add link:$HOME/dsh-plugins/omniroute-plugin
|
|
```
|
|
|
|
With a `link:` install, edits in the checkout are picked up directly (client changes reload on page refresh, Host changes after a DSH restart or HMR reload).
|
|
|
|
### Enable / verify
|
|
|
|
1. Make sure `@local/omniroute` is listed in `dsh.profile.bundles` of `~/.dsh/profiles/web/package.json` (the installer does this; add it by hand if you edited `package.json` manually).
|
|
2. Restart DSH (`dsh web`) or reload the page.
|
|
3. Check **Settings → Plugins**: the `@local/omniroute` bundle should be enabled.
|
|
|
|
### Uninstall
|
|
|
|
```bash
|
|
dsh plugin --profile web remove @local/omniroute
|
|
```
|
|
|
|
### Updating
|
|
|
|
Re-run the `add` command from Option A (or `git pull` in your Option B checkout).
|
|
|
|
## Setup after install
|
|
|
|
1. Open **Settings → Plugins → OmniRoute**.
|
|
2. Enter the **Gateway URL** (e.g. `https://omniroute.example.com`) and paste your **API key**.
|
|
- The key is stored in the DSH credential store under `OMNIROUTE_API_KEY` (`keyRef`) and never leaves the Host.
|
|
- Use a management-scoped key if you want quota tracking.
|
|
3. Press **Test**, then **Save**, then **Re-discover models**.
|
|
4. Pick an `omni/…` model in the model selector. Quotas appear under the composer.
|
|
|
|
### Configuration file
|
|
|
|
Non-secret settings live in `<profile>/omniroute.json` (`$DSH_PROFILE_DIR` or `~/.dsh/profiles/web/omniroute.json`):
|
|
|
|
```json
|
|
{
|
|
"url": "https://omniroute.example.com",
|
|
"keyRef": "OMNIROUTE_API_KEY",
|
|
"provider": "omni",
|
|
"discovery": true,
|
|
"updateOnly": false,
|
|
"include": "",
|
|
"exclude": "",
|
|
"discoverThinking": true,
|
|
"usage": true,
|
|
"pollSec": 120,
|
|
"syncMin": 60
|
|
}
|
|
```
|
|
|
|
All of these are editable from the settings panel; `imported` and `lastImport` are maintained by the plugin.
|