← Back to Plugins
Tools

Jev Router

gowtham980 By gowtham980 👁 7 views ▲ 0 votes

Provider-neutral, quality-aware model routing for OpenClaw

GitHub

Install

npm install --ignore-scripts

README

# Jev Router

OpenClaw feature plugin tested through **2026.11.7**. Uses your existing TypeSafe/Jev (or OpenRouter)
credential to choose from an explicit, provider-neutral set of model profiles
with advisory thinking recommendations. Includes a native Control UI page and an
optional preview tool.

![Jev Router dashboard](docs/images/jev-router-dashboard.svg)

The default **Balanced** objective asks Jev to choose the lowest-relative-cost profile likely
to complete a task correctly in one pass. Administrators provide relative cost
and expected quality for their own models; the plugin does not hard-code providers,
model names, prices or subscription assumptions. These are routing heuristics, not
measured quality scores or a guarantee of savings.

Optional task continuity keeps the previous route for explicit short follow-ups
such as “continue” and “fix it”, avoiding another classifier call. The previous
run must have ended and its chosen model must have been observed. Routes expire
after two hours. Repeated distinct argument/structured-output failures in an
unsuccessful run can raise the next follow-up to the next available quality tier
on a different model. Network, permission, quota, unknown and recovered failures
do not trigger upgrades. Continuity is memory-only and stores no prompt text.

## Current support — read first

| Capability | Status |
|---|---|
| Jev model + thinking classification | Implemented, paired profile choice |
| Per-run provider/model override | Supported where before_model_resolve runs |
| Automatic thinking override | **Not supported by this host API; recommendation only** |
| Locked native Codex sessions | Host skips routing; never unlocked by this plugin |
| Actual model/thinking/token telemetry | Displayed only when reported by host |
| Subscription balance / exact cost | Not inferred; operator-supplied relative tiers |
| All providers | Explicit profiles; normal host auth and policy still apply |

This is NOT a universal automatic model-and-thinking switcher. Complete automatic
thinking requires a host-owned, per-run override API. We intentionally do not
patch installed OpenClaw files, spoof directives, mutate sessions from hooks,
replace provider credentials, or bypass native session locks.

The hook receives the current prompt and attachment metadata, not full conversation history. Long prompts are redacted, then excerpted from the beginning and end within the configured limit; the middle is omitted.
For contextual follow-ups, selection has less information than the answering agent.

## Use cases

### Keep routine work economical

A team has fast, standard and premium models on one Gateway. Jev Router sends
formatting, summaries and small edits to an approved lower-cost profile while
reserving stronger models for work likely to need them.

### Balance local and hosted models

A self-hosted Gateway exposes both local and cloud models. The operator describes
where each model performs well, sets relative cost and quality tiers, and lets the
router choose only among that allowlisted pool.

### Escalate difficult follow-ups safely

A coding task starts normally but produces repeated capability-related failures.
The next explicit follow-up can move up one configured quality tier, while network,
permission and quota failures do not cause an expensive escalation.

## Why not manual model selection?

Manual selection is simpler when every task uses one model. Jev Router is useful
when a shared Gateway has several approved models and operators want per-run
selection, conservative task continuity, readiness filtering and an auditable
decision history. It complements OpenClaw's host-owned fallback chain; it does not
replace provider authentication, retries or execution policy.

## Quick start

1. Install the v0.4.6 GitHub release archive. ClawHub installation is available only after a matching version is listed there.
2. Allow its conversation hooks and enable Custom plugin UI with the commands below, then restart the Gateway.
3. Open **Jev Router** in Control UI. Connect a Jev key, then choose models for **Simple tasks**, **Everyday work**, and **Difficult work** on the Models page. You can leave unused choices blank. Save the starter setup and preview a representative task.
4. Select **Enable automatic selection** beside the starter setup (or **Enable routing** on Overview). This switches the Gateway-wide routing mode; agent model policies still apply. Send a real message and check **Logs** for the model actually used. **Pause routing** returns to observation mode.

The dashboard requires administrator access for setup changes. Thinking recommendations do not change the host's thinking level. The dashboard mode control saves a plugin preference; once used, it takes precedence over the startup `mode` setting until changed again in the dashboard.

## Build and test

Node >=24.16.0 <25 or >=26.1.0, npm, OpenClaw 2026.11.7 for this build.

```sh
npm install --ignore-scripts
npm test
npm run build
npm run validate
npm run pack -- ./jev-router-0.4.8-release.tgz
```

The build dependency is pinned to the tested SDK, 2026.11.7. Use npm ci for
a clean dependency installation from the portable lockfile.
Runtime needs no new OpenAI API key.

## Installation and configuration

After v0.4.6 is listed on ClawHub, install it with:

```sh
openclaw plugins install clawhub:openclaw-plugin-jev-router --accept-capabilities
```

Or install the exact GitHub release artifact:

```sh
curl -LO https://github.com/gowtham980/jev-router/releases/download/v0.4.6/jev-router-0.4.6-release.tgz
openclaw plugins install ./jev-router-0.4.6-release.tgz --accept-capabilities --force
```

OpenClaw treats a downloaded local archive as an unreviewed source and requires `--force`. Verify the archive SHA-256 against the GitHub release notes before installing. This flag accepts the reviewed archive; it does not relax model or conversation-hook policy.

Then grant the explicit conversation-hook permission, enable native UI for
user-installed plugins, and restart the Gateway:

```sh
# Required for non-bundled plugins to receive routing and usage hooks:
openclaw config set plugins.entries.jev-router.hooks.allowConversationAccess true
# Required for the Jev Router page to appear in Control UI:
openclaw config set gateway.controlUi.experimental.customPlugins true
openclaw gateway restart
```

Open **Jev Router** in Control UI to connect Jev and choose models discovered
from the selected agent's Gateway. Start in observe mode, then use the dashboard
to enable routing after previewing a task. Route mode returns per-run
provider/model overrides.

Custom plugin UI is deliberately disabled by default on each Gateway. The
backend can be loaded while its page remains hidden until the setting above is
enabled. Open Control UI through HTTPS/Tailscale Serve or a browser-trusted
loopback URL such as `http://127.0.0.1:18789/`; authenticated native plugin UI
does not load over plain HTTP on a LAN address.

Conversation access is an explicit permission: it lets the plugin receive prompt-bearing hooks. The router forwards only its bounded, redacted prompt excerpt to Jev. Without this permission, previews can work while automatic routing hooks are blocked. Verify with `openclaw plugins inspect jev-router --runtime --json`: `before_model_resolve` must appear and diagnostics must not report blocked hooks.

The three-choice starter setup creates normal routing profiles with neutral cost and quality estimates; it never guesses provider prices or model quality. Existing custom pools remain in the Advanced editor and are not replaced by the starter form. The Suggested use control generates a starting description and recommended thinking level; it does not itself set a routing tier or change the host thinking level. Edit When Jev should use it to define the actual task boundary. Set relative cost and expected quality based on your own evaluation, then preview representative tasks.

The dashboard discovers the models shown by any compatible Gateway's normal model picker,
but the routing pool remains
an operator-managed allowlist. Administrators explicitly enable models and choose
routine, balanced or deep routing purposes, relative cost and expected output
quality. The optimization goal can be Quality, Balanced or Economy. Thinking is advisory. Host policy
is intersected with the saved profile list; no policy or credential settings are
broadened. The saved pool and optimization goal apply Gateway-wide, not only to
the selected agent. Eligibility is checked separately for every agent. The page
shows up to 500 catalog entries plus all saved profiles; unavailable and
duplicate-model profiles are preserved when saving. Identical cost/quality
estimates show guidance instead of implying meaningful cost differentiation.

Before classification, the router reads host auth state without refreshing or writing credentials. Profiles with no eligible stored credentials, provider/model cooldowns, disabled credentials, or quota blocks are excluded. Unknown readiness leaves the host selection unchanged; this is not an upstream health probe. Authless or external-only runtime routes are conservatively omitted unless represented by usable host profiles.

Each run is classified at most once. Subsequent retries/fallback attempts keep the host-selected candidate, preventing the hook from selecting the same failed model again. OpenClaw owns the configured fallback chain and execution policy.

Classifier failures retain the current model:
missing keys, service errors, low confidence, busy router, oversized responses,
and unsupported attachment types. Normal OpenClaw downstream auth/fallback
behavior remains unchanged. This plugin does not create API-key fallback.

## Dashboard

In the connected Gateway Control UI, enable **Settings → Labs → Custom plugin UI**
if not already enabled, then reload/restart as instructed by OpenClaw. Open
**Jev Router** in the sidebar. Use HTTPS or trusted

... (truncated)
tools

Comments

Sign in to leave a comment

Loading comments...