Manual

User setup manual

From a built binary to a first successful gateway call. Every chapter ends at a state you can verify in the dashboard.

Synced with rivelo@683c35e

01

Before you install

Rivelo builds from source today. A release tag and a public container image do not exist yet.

  1. Install the toolchainGo 1.27 or newer, plus Node.js 22.22.1 or newer with npm. Node is only needed to build the embedded dashboard.
  2. Choose a data directorySQLite, WAL files, and request-log slices live together under one writable path. Leave room for the 1 GiB default storage budget.
  3. Plan your HTTPS edgeManaged mode issues Secure cookies, so terminate TLS at a reverse proxy that preserves the Host header. Nginx and Caddy examples ship in deploy/.
  4. Decide how secrets are injectedRivelo never reads a .env file. The master key, admin token, and public URL must arrive through your process environment or a launcher.

A published binary, GHCR image, and signed release do not exist yet. Build from source or build the container image locally.

Authoritative sourcedocs/operations/self-host.md

02

Build and start managed mode

Managed mode starts only when the master key, admin token, and public URL are present and valid.

  1. Build the binaryFrom the repository root, install dependencies and run the build. The dashboard is embedded, so Node is not needed at runtime.
  2. Start with real secretsExport the values below and start the process. The default listen address is loopback.
  3. Check the processGET /healthz only proves the process can answer. Log health lives under Settings or the admin telemetry API.
  4. Use HTTP only for loopback development-insecure-dev drops the Secure cookie attribute and is accepted only when both the listen host and the public URL host are loopback.
build and first start
npm ci
npm run build
./dist/rivelo -version

export RIVELO_MASTER_KEY="$(openssl rand -base64 32)"
export RIVELO_ADMIN_TOKEN="$(openssl rand -hex 32)"
export RIVELO_PUBLIC_URL="https://rivelo.example"
export RIVELO_DATABASE_PATH="/srv/rivelo/data/rivelo.db"
export RIVELO_LOGS_PATH="/srv/rivelo/data/logs"

./dist/rivelo -addr 127.0.0.1:8080
Startup errorWhat to change
RIVELO_MASTER_KEY must be Base64-encoded 32 random bytesRegenerate with openssl rand -base64 32; do not reuse a password.
RIVELO_ADMIN_TOKEN must be a distinct 32 to 256 character random tokenGenerate a separate token; it must not equal the master key, derive from it, or start with rv_proj_.
RIVELO_PUBLIC_URL must use HTTPSUse HTTPS, or add -insecure-dev with a loopback public URL for local testing.
insecure development mode requires loopback listen and public hostsListen on 127.0.0.1 and set RIVELO_PUBLIC_URL=http://127.0.0.1:<port>.

Store RIVELO_MASTER_KEY separately from the database. Losing it makes existing credentials and Project Keys undecryptable, and startup fails instead of falling back to plaintext.

Authoritative sourcedocs/operations/deployment.md

03

Sign in to the dashboard

The dashboard is served at /admin/. The administrator token is exchanged for a session cookie.

  1. Open the dashboardBrowse to /admin/. In loopback development that is http://127.0.0.1:8080/admin/.
  2. Enter the admin tokenPaste RIVELO_ADMIN_TOKEN and choose Sign in to the management interface.
  3. Verify the sessionThe shell shows Single administrator. Sessions are fixed at 12 hours and are not extended by activity.
  4. Sign out when doneSign out invalidates the cookie. Restarting Rivelo also clears every session.
  • Cookie: HttpOnly, SameSite=Strict, host-only, Path=/api/admin/, Secure unless -insecure-dev
  • Ten login attempts per minute per transport peer; forwarded IP headers are ignored
  • Unsafe admin requests require same-origin; a proxy that rewrites Host causes 403

Authoritative sourcedocs/architecture/storage-and-admin-auth.md

04

Add a provider credential

Providers hold upstream accounts. Ten API-key presets ship in the binary, plus an alpha OpenRouter Decisions entry and an experimental ChatGPT-plan access method.

Add Provider dialog listing OpenAI, OpenRouter, Anthropic, Google Gemini, DeepSeek, xAI, Ollama Cloud, Mistral, OpenCode Go, Command Code, and an alpha OpenRouter Decisions entry.
The preset picker on a local test instance. Anthropic, Google Gemini, and DeepSeek are marked alpha in this build.
  1. Open Providers and choose Add ProviderSelect a preset, then Next step. The OpenAI preset uses https://api.openai.com/v1; each preset pins its own base URL.
  2. Choose an access methodAPI Key is the stable path. ChatGPT plan is the experimental Codex OAuth path and shows a risk notice before it starts.
  3. Enter the credentialName the provider (blank uses the preset name plus a suffix) and paste at least one key. Up to 32 keys per provider.
  4. Create and verifyCreation runs a non-billable model-list probe. It never issues a chat completion. Verify Provider re-runs the probe; model lists refresh on request.
  5. Optionally set a capacity poolEach key starts in its own independent pool. Bind keys of the same account to a shared pool, or set a USD cost cap on a monthly or cumulative window.
Providers page listing OpenAI, OpenRouter, and Anthropic credentials with verification badges.
Provider cards on the same local instance. Credentials here are placeholders, so verification stays unverified.
  • Credential values are AES-GCM encrypted at rest and never returned by list APIs
  • Full values appear only through an explicit reveal; rename and replace are separate operations
  • Verification states: unverified, pending, valid, invalid, unknown, unsupported
  • Removing the last key of a provider rejects the whole change

Plan-usage cards (OpenCode Go, Command Code, Codex, Ollama Cloud) are read-only upstream reports. They do not feed routing, capacity, or billing.

Authoritative sourcedocs/domains/providers/implementation-plan.md

05

Create a group alias

A group alias is the model name your client sends. Its candidates must share the same model, version, and protocol.

  1. Open Routing and create a groupGive it an alias such as deepseek-v4.1-flash. Aliases are case-insensitive and limited to 80 characters.
  2. Assert the model contractmodelContract records the model and version you verified. Rivelo never infers equivalence from similar names.
  3. Pick protocol and operationsChoose one wire protocol per group, such as OpenAI Chat Completions, and the operations it serves.
  4. Add candidates in orderOne to sixteen candidates. Each points at a provider and model, and the order is your primary, backup, and tie-break order.
  5. Choose a strategySmart, Cost first, In order, Free first, Speed first, or Least used. New groups default to Smart.
  6. Set optional routing detailsPrompt-cache affinity (auto or off, 60–86400 seconds), allowed effort values and a default, and whether every candidate accepts images.
Routing page showing the deepseek-v4.1-flash group with its model contract, Smart strategy, and prompt-cache affinity.
A group with three same-model candidates and the Smart strategy.
StrategyOrdering rule
In orderExactly your candidate order; pure failover.
SmartAvoid pools near their limit, then earliest reset, then most remaining quota.
Cost firstCheapest frozen price quote first; ties fall back to Smart.
Free firstZero-price candidates first; needs price coverage to qualify.
Speed firstRanked by TTFT plus TPS, with a 1-in-5 exploration of unproven paths.
Least usedLowest known utilization fraction; unknown utilization last.

A group cannot be deleted while a Project Key still grants it. Adjust the key's grants first.

Authoritative sourcedocs/domains/routing/implementation-plan.md

06

Issue a Project Key

Project Keys authenticate gateway calls. They never unlock the admin UI and they are not upstream credentials.

  1. Create a projectProjects group keys and request logs. Names are unique among visible projects; you can hold 100.
  2. Issue a keyOpen Project Keys and choose Issue Project Key, then pick the project.
  3. Choose the scopeAll groups/models covers current and future matching groups. Explicit grants allow one to one hundred groups.
  4. Copy the value onceThe server generates a 32-byte secret with the rv_proj_ prefix. The full value is shown only on create or reveal.
  5. Rotate without downtimeCreate replacement produces a new key with identical grants and keeps the old one active. Revoke the old key after you switch.
Project Keys table showing a Production key with all-groups access and a Local dev key with one group grant.
Keys show only a suffix. Reveal and copy are explicit actions.
  • Revocation is irreversible and clears the stored ciphertext
  • A disabled project rejects authentication without revoking its keys
  • Deleting a project soft-deletes it and atomically revokes every unrevoked key
  • Reveal returns 409 key_revoked for a revoked key

Authoritative sourcedocs/domains/gateway/dashboard-pages.md

07

Call the gateway

Send the group alias as the model and the Project Key in the header that protocol expects.

chat completions, JSON
curl "$RIVELO_PUBLIC_URL/v1/chat/completions" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4.1-flash","messages":[{"role":"user","content":"hi"}]}'
chat completions, SSE
curl -N "$RIVELO_PUBLIC_URL/v1/chat/completions" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"deepseek-v4.1-flash","stream":true,"messages":[{"role":"user","content":"hi"}]}'
models
curl "$RIVELO_PUBLIC_URL/v1/models" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY"
anthropic messages
curl "$RIVELO_PUBLIC_URL/anthropic/v1/messages" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"model":"<alias>","max_tokens":1024,"messages":[{"role":"user","content":"hi"}]}'
gemini generateContent
curl "$RIVELO_PUBLIC_URL/gemini/v1beta/models/<alias>:generateContent" \
  -H "x-goog-api-key: $RIVELO_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"contents":[{"parts":[{"text":"hi"}]}]}'
video job and poll
curl "$RIVELO_PUBLIC_URL/v1/videos" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"video-alias","prompt":"waves at dusk"}'

curl "$RIVELO_PUBLIC_URL/v1/videos/<id>" \
  -H "Authorization: Bearer $RIVELO_PROJECT_KEY"
ProtocolAuth headerNotes
OpenAI Chat, Responses, Images, Videos, FilesAuthorization: Bearer rv_proj_…Other key headers are rejected.
Anthropic MessagesAuthorization: Bearer rv_proj_… or x-api-keyanthropic-version is required; anthropic-beta is optional.
Geminix-goog-api-key: rv_proj_…Authorization is rejected; streaming needs ?alt=sse.
Vision MCPAuthorization: Bearer rv_proj_…POST /mcp/vision with JSON-RPC tools/call analyze_image.
Connect page with Copy Base URL, API style selector, and a cURL integration example.
The Connect page generates the same request shape. The Key Playground sends real upstream requests.
ResponseMeaningFix
401 invalid or missing Project KeyAdmin token used, wrong prefix, revoked key, or disabled projectUse a rv_proj_ key from an active project.
403 not authorized for this modelThe key does not grant the groupEdit the key grants or use All groups/models.
404 model not foundNo enabled group matches the alias for this protocolCheck the alias, protocol, and that the group is enabled.
503 capped pool pausedPricing is missing or costs are incomplete on a limited poolAdd price coverage, raise the cap, or remove the limit.
429 rate_limit_error16 requests already in flightQueue client-side; there is no server queue.

Authoritative sourcedocs/operations/support-matrix.md

08

Prototype versus managed

Prototype mode is for looking at the dashboard, not for serving traffic.

  • No admin API and no /v1 gateway in prototype mode
  • State lives in memory and resets on reload
  • /projects and /keys redirect back to /gateway
  • Plugins and sign-in are read-only previews
  • GET /api/runtime reports the mode and assembled features

The component preview route exists only in development builds. Production builds do not include it.

Authoritative sourcedocs/domains/dashboard/prototype.md

09

Operate it

Overview, Requests, and Settings read the same SQLite files you run in production.

  1. Set the retention policySettings → Logs and storage. Defaults are delete-on-expiry after 7 online days, 100,000 requests, and 1 GiB. Switch to archive mode to keep a per-project total window.
  2. Query the right tierRequests and Overview never mix tiers. Archive queries need a project and at most 31 days.
  3. Review cost coveragePricing overrides, billing schedules, and media prices live under Settings. Built-in media rates are intentionally empty, so media cost stays unknown until you add entries.
  4. Back up offlineStop the service, copy the whole data directory, and checksum every file. Keep the master key outside the backup.
  5. Restore and reconcile keysVerify checksums, restore into new paths, start with the same master key, then re-apply every revocation that happened after the backup.
  6. Upgrade with a paired backupMigrations are bundled and applied at startup. An older binary refuses a newer schema, so roll back with the backup taken from the matching version.
offline backup
# 1. Stop Rivelo and confirm the process has exited.
backup=/secure/backups/rivelo-$(date -u +%Y%m%dT%H%M%SZ)
mkdir -p "$backup"
cp -a /srv/rivelo/data/. "$backup/data/"
(cd "$backup" && find data -type f -print0 | sort -z | xargs -0 sha256sum > SHA256SUMS)

# 2. Keep the master key and admin token outside this directory.
# 3. Restart Rivelo, then verify /healthz, sign-in, Providers, and Requests.
restore
(cd "$backup" && sha256sum -c SHA256SUMS)
# Restore into a new RIVELO_DATABASE_PATH / RIVELO_LOGS_PATH,
# keeping directory ownership, then start with the SAME master key.
Settings Logs and storage section with delete-on-expiry, 7 online days, 100000 request target, and 1024 MiB storage limit.
Retention defaults on a local instance: 7 days, 100,000 requests, 1 GiB.
LimitValue
In-flight requests16, no queue
Attempts per request3 actual attempts inside one 5-minute budget
Per-attempt timeout2 minutes; at least 2 seconds must remain to start one
Request and response4 MiB request, 16 MiB JSON response
Streaming1 MiB per SSE event, 64 MiB and 100,000 events per stream
Images25 MiB request, 10 MiB per file, 32 parts, 16 images
Video content512 MiB proxy limit, 7-day job and download window
Collections100 providers, 32 keys each, 100 groups, 16 candidates, 100 projects, 100 keys each

Capacity limits are estimated soft caps. Reaching a cap or losing cost data pauses new attempts on that limited pool; work already in flight finishes.

Authoritative sourcedocs/operations/backup-restore.md

Authoritative source

This manual is a task-oriented guide. Authoritative contracts and defaults live in the repository docs.