Skip to content

Configuration

merido is configured entirely through environment variables — there's no config file to manage. This page explains how configuration loads and groups the most common knobs by topic. For the complete, always-current list, see the Environment variables reference, which is generated directly from the source.

How it loads

Settings load via figment: built-in defaults are overlaid by environment variables prefixed with MERIDO_. So MERIDO_PORT=9000 sets the port; anything you don't set keeps its default.

Two variables are parsed specially (figment can't split structured values out of plain strings):

  • MERIDO_ROUTES — a JSON array of virtual-model definitions (name, strategy, targets). See Virtual models.
  • MERIDO_ADMIN_EMAILS — a comma-separated list of admin email addresses.

A few bare (un-prefixed) variables are accepted as fallbacks, matching each tool's own convention:

  • DATABASE_URL — the cloud Postgres connection string.
  • REDIS_URL — shared cluster state (see High availability).
  • RESEND_API_KEY — the Resend email key (equivalent to MERIDO_RESEND_API_KEY).

Common knobs by topic

This is a curated subset for orientation. The full table lives at Environment variables.

Server

  • MERIDO_PORT — listen port (default 8788). Also settable via start --port.
  • MERIDO_HOST — bind address.
  • MERIDO_PROFILElocal (default, SQLite, single-user) or cloud (Postgres, multi-tenant).
  • MERIDO_DATA_DIR — where local data and the master key live (default ~/.merido).

Security & auth

  • MERIDO_DASHBOARD_PASSWORD_HASH — argon2 hash that gates the dashboard + /api/* (generate with merido hash-password).
  • MERIDO_REQUIRE_API_KEY — when true, /v1/* rejects anonymous requests.
  • MERIDO_MASTER_KEY — base64 32-byte encryption-at-rest key (else data_dir/master.key).

Rate limiting

  • MERIDO_RATE_LIMIT_RPM — per-client-key requests per minute.
  • MERIDO_RATE_LIMIT_BURST — burst allowance (defaults to the RPM).

Token saving

  • MERIDO_CAVEMAN_LEVEL — output-compression level: lite / full / ultra / wenyan-lite / wenyan / wenyan-ultra. See Token saving.

Caching

  • MERIDO_DEDUP_TTL_MS — exact-match dedup window (ms).
  • MERIDO_SEMANTIC_CACHE_ENABLED, MERIDO_SEMANTIC_CACHE_EMBED_MODEL, MERIDO_SEMANTIC_CACHE_TTL_MS, MERIDO_SEMANTIC_CACHE_THRESHOLD, MERIDO_SEMANTIC_CACHE_PRECISION_FLOOR, MERIDO_SEMANTIC_CACHE_REVALIDATE_RATE — the semantic cache and its precision guard. See Caching.

Multi-tenancy & email

  • MERIDO_MULTI_TENANT — enable self-serve multi-tenant mode.
  • MERIDO_ADMIN_EMAILS — comma-separated admin emails.
  • MERIDO_RESEND_API_KEY, MERIDO_EMAIL_FROM, MERIDO_PUBLIC_URL — transactional email. See Multi-tenancy.

Cloud & HA

  • DATABASE_URL — Postgres (cloud profile).
  • REDIS_URL — shared cluster state. See High availability.

Interception (MITM)

  • MERIDO_MITM_ENABLED, MERIDO_MITM_PORT, MERIDO_MITM_INSTALL_CA, MERIDO_MITM_MANAGE_HOSTS — the TLS-intercepting proxy for tools that hardcode their host. See Connect a coding CLI.

Routing & operations

  • MERIDO_ROUTES — JSON virtual-model definitions.
  • MERIDO_HEALTH_CHECK_INTERVAL_SECS — active provider health probing.
  • MERIDO_MONTHLY_BUDGET_USD — monthly budget tracking.
  • MERIDO_USAGE_RETENTION_DAYS — prune usage events older than this.

The complete table

The Environment variables page lists every variable, with type, default, and description — generated from crates/config/src/lib.rs, so it never drifts from the code. When in doubt, that page is authoritative.

MIT / Apache-2.0 licensed.