mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-11-19 04:41:03 +00:00
Compare commits
5 Commits
fix/plugin
...
fix/cli-li
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ee7ddb512 | ||
|
|
4b9062d5eb | ||
|
|
60e1f5e8d0 | ||
|
|
3f7b20170f | ||
|
|
ad6fe67161 |
@@ -275,7 +275,7 @@ ENV DATA_DIR=/app/data
|
||||
RUN mkdir -p /app/data && chown node:node /app /app/data
|
||||
|
||||
# #13679: default the PUBLISHED image to requiring an API key. A bare
|
||||
# `docker run -p 20128:20128 … diegosouzapw/omniroute` (README/QUICK-START
|
||||
# `docker run -p 20128:20128 … cheaperinference/omniroute` (README/QUICK-START
|
||||
# one-liners) does not pass `--env-file .env`, so without this default the
|
||||
# anonymous /v1 LLM proxy would be both keyless AND world-reachable on the
|
||||
# published container. This does NOT change the npm/CLI local-dev default
|
||||
|
||||
10
README.md
10
README.md
@@ -87,7 +87,7 @@
|
||||
|
||||
[](https://www.npmjs.com/package/omniroute)
|
||||

|
||||
[](https://hub.docker.com/r/diegosouzapw/omniroute)
|
||||
[](https://hub.docker.com/r/cheaperinference/omniroute)
|
||||
[](LICENSE)
|
||||

|
||||

|
||||
@@ -781,7 +781,7 @@ of your shell history. → [CLI Integrations](docs/guides/CLI-INTEGRATIONS.md)
|
||||
<tr><th align="left">Platform</th><th align="left">Install</th><th align="left">Highlights</th></tr>
|
||||
<tr><td align="left" nowrap>📦 <b>npm (global)</b></td><td align="left" nowrap><code>npm install -g omniroute</code></td><td align="left">One command, any OS</td></tr>
|
||||
<tr><td align="left" nowrap>⚡ <b>Bun (global)</b></td><td align="left" nowrap><code>bun add -g omniroute</code></td><td align="left">Same registry tarball, faster installs</td></tr>
|
||||
<tr><td align="left" nowrap>🐳 <b>Docker</b></td><td align="left" nowrap><code>docker run … diegosouzapw/omniroute</code></td><td align="left">Multi-arch <b>AMD64 + ARM64</b></td></tr>
|
||||
<tr><td align="left" nowrap>🐳 <b>Docker</b></td><td align="left" nowrap><code>docker run … cheaperinference/omniroute</code></td><td align="left">Multi-arch <b>AMD64 + ARM64</b></td></tr>
|
||||
<tr><td align="left" nowrap>🖥️ <b>Desktop (Electron)</b></td><td align="left" nowrap><code>npm run electron:build</code></td><td align="left">Native window + system tray — <b>Windows / macOS / Linux</b></td></tr>
|
||||
<tr><td align="left" nowrap>🎩 <b>Menu-bar (OmniRouteTray)</b></td><td align="left" nowrap><code>brew install --cask zoispag/tap/omniroute-tray</code></td><td align="left">Supervises & auto-updates the server — <b>macOS</b></td></tr>
|
||||
<tr><td align="left" nowrap>💪 <b>ARM</b></td><td align="left" nowrap>native <code>arm64</code></td><td align="left">Raspberry Pi, ARM servers, Apple Silicon</td></tr>
|
||||
@@ -1105,7 +1105,7 @@ Use these only for clients that cannot attach `Authorization: Bearer ...`. Heade
|
||||
|
||||
```bash
|
||||
docker run -d --name omniroute --restart unless-stopped --stop-timeout 40 \
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data diegosouzapw/omniroute:latest
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
`:latest` follows the highest **published** stable SemVer. It does not track git `main`. Pin `:X.Y.Z` for GitOps. See [Docker Release Channels](docs/guides/DOCKER_GUIDE.md#release-channels).The image pins **`OMNIROUTE_MEMORY_MB=1024`**. That is enough for the dashboard and a light chat. **Coding agents** (`POST /v1/responses` from Claude Code, Codex, Grok, …) need a much larger V8 heap or the process `FATAL ERROR`s at ~12 GiB under two overlapping long contexts. Size the container above the heap (native buffers sit outside V8):
|
||||
@@ -1119,7 +1119,7 @@ docker run -d --name omniroute --restart unless-stopped --stop-timeout 40 \
|
||||
```bash
|
||||
docker run -d --name omniroute --restart unless-stopped --stop-timeout 40 \
|
||||
-e OMNIROUTE_MEMORY_MB=8192 --memory=10g \
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data diegosouzapw/omniroute:latest
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
Full table: [Docker Guide — runtime RAM](docs/guides/DOCKER_GUIDE.md#runtime-ram-for-coding-agents).
|
||||
@@ -1338,7 +1338,7 @@ Métricas canônicas em 2026-10-18: **1.976 vídeos únicos** · **20.220.289 vi
|
||||
<tr><td nowrap><b>Testing</b></td><td>Node.js test runner + Vitest — <b>60,000+ static test declarations</b> across 8,400+ tracked test files (unit, integration, E2E, security, ecosystem)</td></tr>
|
||||
<tr><td nowrap><b>Platforms</b></td><td>Desktop (Electron) · Android (Termux) · PWA (any browser)</td></tr>
|
||||
<tr><td nowrap><b>CI/CD</b></td><td>GitHub Actions — auto npm publish + Docker Hub on release</td></tr>
|
||||
<tr><td nowrap><b>Links</b></td><td><a href="https://omniroute.online">Website</a> · <a href="https://www.npmjs.com/package/omniroute">npm</a> · <a href="https://hub.docker.com/r/diegosouzapw/omniroute">Docker Hub</a></td></tr>
|
||||
<tr><td nowrap><b>Links</b></td><td><a href="https://omniroute.online">Website</a> · <a href="https://www.npmjs.com/package/omniroute">npm</a> · <a href="https://hub.docker.com/r/cheaperinference/omniroute">Docker Hub</a></td></tr>
|
||||
</table>
|
||||
|
||||
<div align="center">
|
||||
|
||||
@@ -207,7 +207,7 @@ docker run -d \
|
||||
-e JWT_SECRET="$(openssl rand -base64 48)" \
|
||||
-e API_KEY_SECRET="$(openssl rand -hex 32)" \
|
||||
-e STORAGE_ENCRYPTION_KEY="$(openssl rand -hex 32)" \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
@@ -4,6 +4,7 @@ import { setTimeout as sleep } from "node:timers/promises";
|
||||
import { apiFetch, getBaseUrl } from "../api.mjs";
|
||||
import { emit } from "../output.mjs";
|
||||
import { t } from "../i18n.mjs";
|
||||
import { parsePositiveInt } from "../utils/positiveInteger.mjs";
|
||||
|
||||
function fmtTs(v) {
|
||||
if (!v) return "-";
|
||||
@@ -97,7 +98,7 @@ export function registerBatches(program) {
|
||||
batches
|
||||
.command("list")
|
||||
.option("--status <s>", t("batches.list.status"))
|
||||
.option("--limit <n>", t("batches.list.limit"), parseInt, 50)
|
||||
.option("--limit <n>", t("batches.list.limit"), parsePositiveInt, 50)
|
||||
.action(async (opts, cmd) => {
|
||||
const params = new URLSearchParams({ limit: String(opts.limit) });
|
||||
if (opts.status) params.set("status", opts.status);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createInterface } from "node:readline";
|
||||
import { apiFetch, getBaseUrl } from "../api.mjs";
|
||||
import { emit } from "../output.mjs";
|
||||
import { t } from "../i18n.mjs";
|
||||
import { parsePositiveInt } from "../utils/positiveInteger.mjs";
|
||||
|
||||
function fmtTs(v) {
|
||||
if (!v) return "-";
|
||||
@@ -49,7 +50,7 @@ export function registerFiles(program) {
|
||||
files
|
||||
.command("list")
|
||||
.option("--purpose <p>", t("files.list.purpose"))
|
||||
.option("--limit <n>", t("files.list.limit"), parseInt, 100)
|
||||
.option("--limit <n>", t("files.list.limit"), parsePositiveInt, 100)
|
||||
.action(async (opts, cmd) => {
|
||||
const params = new URLSearchParams({ limit: String(opts.limit) });
|
||||
if (opts.purpose) params.set("purpose", opts.purpose);
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
import { encryptCredential } from "../encryption.mjs";
|
||||
import { openOmniRouteDb } from "../sqlite.mjs";
|
||||
import { t } from "../i18n.mjs";
|
||||
import { parsePositiveInt } from "../utils/positiveInteger.mjs";
|
||||
import { registerProviderCrud } from "./provider-crud.mjs";
|
||||
|
||||
function publicConnection(connection) {
|
||||
@@ -824,7 +825,7 @@ export function extendProvidersMetrics(providers) {
|
||||
.option("--period <p>", t("providers.metrics.period"), "24h")
|
||||
.option("--metric <m>", t("providers.metrics.metric"))
|
||||
.option("--sort-by <field>", t("providers.metrics.sort"))
|
||||
.option("--limit <n>", t("providers.metrics.limit"), parseInt, 50)
|
||||
.option("--limit <n>", t("providers.metrics.limit"), parsePositiveInt, 50)
|
||||
.option("--watch", t("providers.metrics.watch"))
|
||||
.option("--compare <list>", t("providers.metrics.compare"))
|
||||
.action(runProvidersMetrics);
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
"dryRun": "[dry-run] would {action}",
|
||||
"cancelled": "Cancelled.",
|
||||
"jsonOpt": "Output as JSON",
|
||||
"yesOpt": "Skip confirmation prompt"
|
||||
"yesOpt": "Skip confirmation prompt",
|
||||
"positiveIntegerRequired": "Limit must be a positive integer."
|
||||
},
|
||||
"setup": {
|
||||
"title": "OmniRoute Setup",
|
||||
|
||||
18
bin/cli/utils/positiveInteger.mjs
Normal file
18
bin/cli/utils/positiveInteger.mjs
Normal file
@@ -0,0 +1,18 @@
|
||||
import { z } from "zod";
|
||||
import { InvalidArgumentError } from "commander";
|
||||
import { t } from "../i18n.mjs";
|
||||
|
||||
const positiveIntSchema = z
|
||||
.string()
|
||||
.trim()
|
||||
.regex(/^[0-9]+$/)
|
||||
.transform(Number)
|
||||
.pipe(z.number().int().positive().max(Number.MAX_SAFE_INTEGER));
|
||||
|
||||
export function parsePositiveInt(value) {
|
||||
const result = positiveIntSchema.safeParse(String(value ?? ""));
|
||||
if (!result.success) {
|
||||
throw new InvalidArgumentError(t("common.positiveIntegerRequired"));
|
||||
}
|
||||
return result.data;
|
||||
}
|
||||
1
changelog.d/fixes/18263-cli-limit-validation.md
Normal file
1
changelog.d/fixes/18263-cli-limit-validation.md
Normal file
@@ -0,0 +1 @@
|
||||
- **fix(cli):** Parse positive safe integer `--limit` values correctly for provider metrics, batch lists, and file lists instead of passing Commander's previous value to `parseInt` as a radix ([#18263](https://github.com/cheaper-inference/OmniRoute/pull/18263)) — thanks @mcspanky802.
|
||||
@@ -0,0 +1 @@
|
||||
- **chore(docker):** new installs use the Cheaper Inference Docker Hub repository `cheaperinference/omniroute` (Helm chart 0.1.2, the base Kubernetes manifest, the manifest generator, compose, Podman and the docs); `diegosouzapw/omniroute` keeps every release and its pull history, and stays the home of the `:next` channel ([#20490](https://github.com/cheaper-inference/OmniRoute/pull/20490))
|
||||
@@ -191,7 +191,7 @@ podman run -d --name omniroute \
|
||||
-e DATA_DIR=/app/data \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
docker.io/diegosouzapw/omniroute:latest
|
||||
docker.io/cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
For a bind mount that still fails, inspect or repair the shared path from the
|
||||
|
||||
@@ -9,7 +9,7 @@ After=omniroute-redis.service
|
||||
# Use this image after building locally
|
||||
Image=localhost/omniroute:base
|
||||
# Or use the fully qualified published image (there is no published :base tag)
|
||||
# Image=docker.io/diegosouzapw/omniroute:latest
|
||||
# Image=docker.io/cheaperinference/omniroute:latest
|
||||
|
||||
ContainerName=omniroute
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ name: omniroute
|
||||
description: OmniRoute — unified AI proxy/router. One endpoint, many LLM providers, auto-fallback.
|
||||
type: application
|
||||
# Chart version — bump on every chart change.
|
||||
version: 0.1.1
|
||||
version: 0.1.2
|
||||
# Default image tag. Overridable with image.tag.
|
||||
appVersion: "latest"
|
||||
home: https://github.com/cheaper-inference/OmniRoute
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: diegosouzapw/omniroute
|
||||
repository: cheaperinference/omniroute
|
||||
# Pin a real SemVer (or a digest) for anything you care about. `latest` only
|
||||
# moves when a stable release promotes it, so it silently lags merged fixes.
|
||||
tag: "latest"
|
||||
|
||||
@@ -43,7 +43,7 @@ spec:
|
||||
type: RuntimeDefault
|
||||
containers:
|
||||
- name: omniroute
|
||||
image: diegosouzapw/omniroute:latest
|
||||
image: cheaperinference/omniroute:latest
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
services:
|
||||
omniroute:
|
||||
image: diegosouzapw/omniroute:latest
|
||||
image: cheaperinference/omniroute:latest
|
||||
container_name: omniroute
|
||||
environment:
|
||||
- OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS=${OMNIROUTE_DIRECT_HEADERS_TIMEOUT_MS:-300000}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
# open http://127.0.0.1:20128
|
||||
#
|
||||
# No profiles, no build step, no multi-tenant anything.
|
||||
# Pulls the published image `diegosouzapw/omniroute:latest`.
|
||||
# Pulls the published image `cheaperinference/omniroute:latest`.
|
||||
#
|
||||
# All app ports bind to 127.0.0.1 ONLY by default (REQUIRE_API_KEY ships
|
||||
# as false). Set APP_BIND_HOST=0.0.0.0 in .env ONLY after you have set
|
||||
@@ -35,7 +35,7 @@ services:
|
||||
retries: 3
|
||||
|
||||
omniroute:
|
||||
image: diegosouzapw/omniroute:latest
|
||||
image: cheaperinference/omniroute:latest
|
||||
container_name: omniroute
|
||||
restart: unless-stopped
|
||||
stop_grace_period: 40s
|
||||
|
||||
@@ -23,10 +23,10 @@ npm install -g omniroute
|
||||
### Option B: Docker
|
||||
|
||||
```bash
|
||||
docker run -d --name omniroute -p 20128:20128 diegosouzapw/omniroute:latest
|
||||
docker run -d --name omniroute -p 20128:20128 cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
`:latest` is the highest **published** stable SemVer. It does **not** track git `main`. Pin `diegosouzapw/omniroute:X.Y.Z` for GitOps. See [Image Tags / Release Channels](../guides/DOCKER_GUIDE.md#release-channels).
|
||||
`:latest` is the highest **published** stable SemVer. It does **not** track git `main`. Pin `cheaperinference/omniroute:X.Y.Z` for GitOps. See [Image Tags / Release Channels](../guides/DOCKER_GUIDE.md#release-channels).
|
||||
|
||||
### Option C: From Source
|
||||
|
||||
|
||||
@@ -117,7 +117,7 @@ you need to change them.
|
||||
docker compose -f docker-compose.selfhost.yml up -d
|
||||
```
|
||||
|
||||
Pulls `diegosouzapw/omniroute:latest` (multi-arch AMD64 + ARM64, ~250 MB) and
|
||||
Pulls `cheaperinference/omniroute:latest` (multi-arch AMD64 + ARM64, ~250 MB) and
|
||||
`redis:8.6.5-alpine`, starts both, and waits for Redis to be healthy before
|
||||
the app boots.
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ docker run -d \
|
||||
--stop-timeout 40 \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
## With Environment File
|
||||
@@ -60,7 +60,7 @@ docker run -d \
|
||||
--env-file .env \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
## Docker Compose
|
||||
@@ -342,7 +342,7 @@ Size **cgroup `--memory` above the heap** — native buffers, SQLite, and compre
|
||||
```bash
|
||||
docker run -d --name omniroute --restart unless-stopped --stop-timeout 40 \
|
||||
-e OMNIROUTE_MEMORY_MB=8192 --memory=10g \
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data diegosouzapw/omniroute:latest
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
## Critical Environment Variables
|
||||
@@ -398,14 +398,14 @@ runtime environment variable.
|
||||
|
||||
### Pre-built root image + runtime subpath
|
||||
|
||||
Published `diegosouzapw/omniroute:*` images are built for the domain root. You can still
|
||||
Published `cheaperinference/omniroute:*` images are built for the domain root. You can still
|
||||
set `OMNIROUTE_BASE_PATH` at runtime; the container patches the bundle once on startup.
|
||||
Pair it with the matching public origin:
|
||||
|
||||
```yaml
|
||||
services:
|
||||
omniroute:
|
||||
image: diegosouzapw/omniroute:latest
|
||||
image: cheaperinference/omniroute:latest
|
||||
environment:
|
||||
OMNIROUTE_BASE_PATH: /omniroute
|
||||
NEXT_PUBLIC_BASE_URL: https://myhostname.example.com/omniroute
|
||||
@@ -446,7 +446,7 @@ OmniRoute can be securely exposed using Caddy's automatic SSL provisioning. Ensu
|
||||
```yaml
|
||||
services:
|
||||
omniroute:
|
||||
image: diegosouzapw/omniroute:latest
|
||||
image: cheaperinference/omniroute:latest
|
||||
container_name: omniroute
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
@@ -496,10 +496,17 @@ Endpoint tunnel panels (Cloudflare, Tailscale, ngrok) can be shown or hidden fro
|
||||
|
||||
## Image Tags
|
||||
|
||||
| Image | Tag | Size | Description |
|
||||
| ------------------------ | -------- | ------ | ---------------------------------------------------- |
|
||||
| `diegosouzapw/omniroute` | `latest` | ~250MB | Highest **published** stable SemVer (not git `main`) |
|
||||
| `diegosouzapw/omniroute` | `3.8.0` | ~250MB | Pin this class of tag for GitOps |
|
||||
| Image | Tag | Size | Description |
|
||||
| ---------------------------- | -------- | ------ | ---------------------------------------------------- |
|
||||
| `cheaperinference/omniroute` | `latest` | ~250MB | Highest **published** stable SemVer (not git `main`) |
|
||||
| `cheaperinference/omniroute` | `3.8.54` | ~250MB | Pin this class of tag for GitOps |
|
||||
|
||||
The same images are published to three repositories, with the same per-architecture digests:
|
||||
`cheaperinference/omniroute` (Docker Hub, the Cheaper Inference organization, from 3.8.53 on),
|
||||
`ghcr.io/cheaper-inference/omniroute` and the legacy `diegosouzapw/omniroute`, which keeps its
|
||||
pull history and still receives every release. Existing `diegosouzapw/omniroute` deployments
|
||||
keep updating; switching the image name is optional. The `:next` / `:next-web` pre-release
|
||||
channel below is published to `diegosouzapw/omniroute` and GHCR only.
|
||||
|
||||
Multi-platform manifest: `linux/amd64` + `linux/arm64` native (Apple Silicon, AWS Graviton, Raspberry Pi). Docker selects the matching architecture automatically; pass `--platform linux/amd64` if you need to force AMD64 emulation on ARM hosts.
|
||||
|
||||
@@ -561,7 +568,7 @@ docker image inspect diegosouzapw/omniroute:next --format '{{index .RepoDigests
|
||||
Before testing, back up the OmniRoute data volume or bind-mounted data directory. To roll back, restore the previously used stable version or digest and recreate the container:
|
||||
|
||||
```bash
|
||||
docker pull diegosouzapw/omniroute:<stable-version>
|
||||
docker pull cheaperinference/omniroute:<stable-version>
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
|
||||
@@ -472,7 +472,7 @@ see [`docs/guides/KIRO_SETUP.md`](./KIRO_SETUP.md).
|
||||
2. **Permanent fix:** Bind to IPv4 explicitly by using `-p 127.0.0.1:20128:20128` in your `docker run` command:
|
||||
```bash
|
||||
docker run -d --name omniroute --restart unless-stopped --stop-timeout 40 \
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data diegosouzapw/omniroute:latest
|
||||
-p 127.0.0.1:20128:20128 -v omniroute-data:/app/data cheaperinference/omniroute:latest
|
||||
```
|
||||
This forces the IPv4 bind and also avoids exposing the proxy on all host interfaces.
|
||||
|
||||
|
||||
@@ -72,6 +72,8 @@ docker rm omniroute
|
||||
docker volume rm omniroute-data
|
||||
|
||||
# (Optional) Remove the image
|
||||
docker rmi cheaperinference/omniroute:latest
|
||||
# Older installs pulled the legacy name:
|
||||
docker rmi diegosouzapw/omniroute:latest
|
||||
```
|
||||
|
||||
|
||||
@@ -354,7 +354,7 @@ Helm:
|
||||
|
||||
```bash
|
||||
# Kustomize: pin a real tag rather than relying on :latest
|
||||
kubectl -n omniroute set image deploy/omniroute omniroute=diegosouzapw/omniroute:3.8.51
|
||||
kubectl -n omniroute set image deploy/omniroute omniroute=cheaperinference/omniroute:3.8.54
|
||||
|
||||
# Helm
|
||||
helm upgrade omniroute deploy/helm/omniroute -n omniroute --reuse-values \
|
||||
|
||||
@@ -135,7 +135,7 @@ EOF
|
||||
### 2.3 Start the container
|
||||
|
||||
```bash
|
||||
docker pull diegosouzapw/omniroute:latest
|
||||
docker pull cheaperinference/omniroute:latest
|
||||
|
||||
docker run -d \
|
||||
--name omniroute \
|
||||
@@ -143,7 +143,7 @@ docker run -d \
|
||||
--env-file /opt/omniroute/.env \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
### 2.4 Verify that it is running
|
||||
@@ -302,13 +302,13 @@ curl -sI https://llms.seudominio.com/health
|
||||
### Upgrade to a new version
|
||||
|
||||
```bash
|
||||
docker pull diegosouzapw/omniroute:latest
|
||||
docker pull cheaperinference/omniroute:latest
|
||||
docker stop omniroute && docker rm omniroute
|
||||
docker run -d --name omniroute --restart unless-stopped \
|
||||
--env-file /opt/omniroute/.env \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
### View logs
|
||||
|
||||
@@ -70,7 +70,7 @@ docker run -d --name omniroute \
|
||||
-p 20128:20128 \
|
||||
-v omniroute-data:/app/data \
|
||||
-e ENABLE_CC_COMPATIBLE_PROVIDER=true \
|
||||
diegosouzapw/omniroute:latest
|
||||
cheaperinference/omniroute:latest
|
||||
```
|
||||
|
||||
After restarting, the dashboard exposes an **Add Claude Code Compatible** option in
|
||||
|
||||
@@ -344,7 +344,7 @@ export function defaultSpec(target: DeployTargetKind): DeploySpec {
|
||||
namespace: "omniroute",
|
||||
releaseName: "omniroute",
|
||||
image: {
|
||||
repository: "diegosouzapw/omniroute",
|
||||
repository: "cheaperinference/omniroute",
|
||||
tag: "latest",
|
||||
pullPolicy: "IfNotPresent" as const,
|
||||
},
|
||||
|
||||
115
tests/unit/cli-limit-parsing.test.ts
Normal file
115
tests/unit/cli-limit-parsing.test.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { describe, it } from "node:test";
|
||||
import { Command } from "commander";
|
||||
import { registerBatches } from "../../bin/cli/commands/batches.mjs";
|
||||
import { registerFiles } from "../../bin/cli/commands/files.mjs";
|
||||
import { extendProvidersMetrics } from "../../bin/cli/commands/providers.mjs";
|
||||
|
||||
function findSubcommand(root: Command, path: string[]): Command {
|
||||
let current: Command | undefined = root;
|
||||
for (const segment of path) {
|
||||
current = current?.commands.find((c) => c.name() === segment);
|
||||
assert.ok(current, `Expected subcommand "${segment}" to exist`);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
function buildProgramWithCapture(path: string[]) {
|
||||
const program = new Command();
|
||||
program.exitOverride();
|
||||
program.configureOutput({
|
||||
writeOut: () => {},
|
||||
writeErr: () => {},
|
||||
});
|
||||
|
||||
const providers = program.command("providers");
|
||||
extendProvidersMetrics(providers);
|
||||
registerBatches(program);
|
||||
registerFiles(program);
|
||||
|
||||
const target = findSubcommand(program, path);
|
||||
let capturedOpts: Record<string, unknown> | null = null;
|
||||
target.action((opts: Record<string, unknown>) => {
|
||||
capturedOpts = opts;
|
||||
});
|
||||
|
||||
return {
|
||||
parse: async (extraArgs: string[]) => {
|
||||
capturedOpts = null;
|
||||
await program.parseAsync(["node", "omniroute", ...path, ...extraArgs]);
|
||||
return capturedOpts;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
const TARGET_COMMANDS: Array<{
|
||||
label: string;
|
||||
path: string[];
|
||||
defaultLimit: number;
|
||||
}> = [
|
||||
{ label: "providers metrics", path: ["providers", "metrics"], defaultLimit: 50 },
|
||||
{ label: "batches list", path: ["batches", "list"], defaultLimit: 50 },
|
||||
{ label: "files list", path: ["files", "list"], defaultLimit: 100 },
|
||||
];
|
||||
|
||||
describe("CLI --limit positive integer parsing regression", () => {
|
||||
for (const { label, path, defaultLimit } of TARGET_COMMANDS) {
|
||||
describe(label, () => {
|
||||
it(`uses default limit (${defaultLimit}) when --limit is omitted`, async () => {
|
||||
const { parse } = buildProgramWithCapture(path);
|
||||
const opts = await parse([]);
|
||||
assert.ok(opts);
|
||||
assert.equal(opts.limit, defaultLimit);
|
||||
});
|
||||
|
||||
it("parses explicit valid positive integer --limit without radix corruption", async () => {
|
||||
const { parse } = buildProgramWithCapture(path);
|
||||
for (const [raw, expected] of [
|
||||
["1", 1],
|
||||
["10", 10],
|
||||
["25", 25],
|
||||
["250", 250],
|
||||
[String(Number.MAX_SAFE_INTEGER), Number.MAX_SAFE_INTEGER],
|
||||
] as const) {
|
||||
const opts = await parse(["--limit", raw]);
|
||||
assert.ok(opts);
|
||||
assert.equal(opts.limit, expected);
|
||||
assert.equal(Number.isNaN(opts.limit), false);
|
||||
}
|
||||
});
|
||||
|
||||
it("rejects zero, negative, malformed, and unsafe integer --limit values", async () => {
|
||||
const { parse } = buildProgramWithCapture(path);
|
||||
const invalidValues = [
|
||||
"0",
|
||||
"00",
|
||||
"-1",
|
||||
"-50",
|
||||
"1.5",
|
||||
"10abc",
|
||||
"abc",
|
||||
"",
|
||||
" ",
|
||||
"NaN",
|
||||
"Infinity",
|
||||
"1e5",
|
||||
"0x10",
|
||||
"9007199254740992",
|
||||
"99999999999999999999",
|
||||
];
|
||||
|
||||
for (const bad of invalidValues) {
|
||||
await assert.rejects(
|
||||
() => parse(["--limit", bad]),
|
||||
(err: unknown) => {
|
||||
assert.ok(err instanceof Error);
|
||||
assert.match(err.message, /positive integer/i);
|
||||
return true;
|
||||
},
|
||||
`Expected "${bad}" to be rejected for ${label}`
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -216,3 +216,29 @@ test("generated ConfigMap keys match the committed ConfigMap", () => {
|
||||
"the dashboard would ship a different env surface than the committed manifests"
|
||||
);
|
||||
});
|
||||
|
||||
// The default image is the Cheaper Inference Docker Hub repository; the Helm chart and the
|
||||
// static base manifest point at the same name, so the three ways to deploy agree.
|
||||
// diegosouzapw/omniroute still receives every release (legacy name, same digests).
|
||||
test("default image is cheaperinference/omniroute in the generator, the Helm chart and the base manifest", () => {
|
||||
for (const target of ["local", "vps"] as const) {
|
||||
const spec = defaultSpec(target);
|
||||
assert.equal(spec.image.repository, "cheaperinference/omniroute");
|
||||
const deployment = ofKind(docsFor(spec), "Deployment") as {
|
||||
spec?: { template?: { spec?: { containers?: { image?: string }[] } } };
|
||||
};
|
||||
assert.equal(
|
||||
deployment.spec?.template?.spec?.containers?.[0]?.image,
|
||||
`cheaperinference/omniroute:${spec.image.tag}`
|
||||
);
|
||||
}
|
||||
const values = yamlLoad(
|
||||
fs.readFileSync(path.join(REPO_ROOT, "deploy/helm/omniroute/values.yaml"), "utf8")
|
||||
) as { image?: { repository?: string } };
|
||||
assert.equal(values.image?.repository, "cheaperinference/omniroute");
|
||||
const base = fs.readFileSync(
|
||||
path.join(REPO_ROOT, "deploy/kubernetes/base/deployment.yaml"),
|
||||
"utf8"
|
||||
);
|
||||
assert.match(base, /image: cheaperinference\/omniroute:latest/);
|
||||
});
|
||||
|
||||
@@ -38,7 +38,7 @@ test("#8497 Podman guide separates local engines from Podman Machine", () => {
|
||||
assert.match(localGuidance, /podman unshare chown 1000:1000 \.\/data/);
|
||||
assert.doesNotMatch(machineGuidance, /podman unshare chown/);
|
||||
assert.match(machineGuidance, /remote client/);
|
||||
assert.match(machineGuidance, /docker\.io\/diegosouzapw\/omniroute:latest/);
|
||||
assert.match(machineGuidance, /docker\.io\/cheaperinference\/omniroute:latest/);
|
||||
});
|
||||
|
||||
test("#8497 Quadlet is Linux/systemd-only and generated units are not enabled", () => {
|
||||
@@ -94,8 +94,8 @@ test("#8497 pull example and environment hints stay topology-safe", () => {
|
||||
const envExample = read(".env.example");
|
||||
const envReference = read("docs/reference/ENVIRONMENT.md");
|
||||
|
||||
assert.match(quadlet, /Image=docker\.io\/diegosouzapw\/omniroute:latest/);
|
||||
assert.doesNotMatch(quadlet, /diegosouzapw\/omniroute:base/);
|
||||
assert.match(quadlet, /Image=docker\.io\/cheaperinference\/omniroute:latest/);
|
||||
assert.doesNotMatch(quadlet, /(?:diegosouzapw|cheaperinference)\/omniroute:base/);
|
||||
|
||||
for (const source of [envExample, envReference]) {
|
||||
assert.match(source, /any Podman topology/);
|
||||
|
||||
Reference in New Issue
Block a user