Skip to content

Settings

hypar resolves runtime configuration through a three-layer system, persisted in three Prisma tables. Most keys are typed by the wizard step definitions in utils/setup/wizard-steps.ts.

The three tables

TableScopeEdited from
SettingGlobal. One row per key.Admin panel (/admin/settings) and the setup wizard.
WorkspaceSettingOne workspace./workspaces (owners and editors).
UserSettingOne user./settings.

All three carry key, value (string) and category. Categories are: apis, vectorDb, embeddings, chunking, search, rag, general (Setting/UserSetting) or the narrower chunking / general for WorkspaceSetting.

Resolution order

For an arbitrary setting at request time:

UserSetting        ┐
  → WorkspaceSetting   (only certain keys, e.g. ALLOWED_FORMATS)
    → Setting (DB global)
      → process.env / runtimeConfig
        → wizard default

The resolver is getEffectiveSettingForUpload() in server/utils/settings.service.ts.

For .env-only options (DB URL, secret keys at boot) this order does not apply — those live exclusively in environment variables; see Environment variables.

Secrets

API keys (GOOGLE_API_KEY, OPENAI_API_KEY, etc.) are flagged as secret in the wizard definitions and are never returned in plain text by the settings endpoints:

  • GET /api/admin/settings returns ••••<last4>.
  • GET /api/user/settings returns { configured, systemConfigured } booleans instead of the value.
  • POST /api/admin/settings skips writes when the body echoes a masked ••••… value, so refreshing the admin form never clobbers the real secret.

User endpoints

Method & pathDescription
GET /api/user/settings?category=Caller's overrides for that category, plus the resolved system value for each field.
PUT /api/user/settingsBody { key, value, category? }. Empty value deletes the override. Also invalidates the per-user rate-limit cache.

Admin endpoints

Method & pathDescription
GET /api/admin/settings?category=Global settings, secrets masked.
POST /api/admin/settingsBody { key, value, category? }. Upserts into Setting.

Workspace endpoints

Method & pathDescription
GET /api/workspaces/:id/settings?category=Workspace overrides plus the effective value of ALLOWED_FORMATS.
POST /api/workspaces/:id/settingsBody { key, value, category? }. Owners and editors only.

Commonly tuned keys

KeyLayer that usually owns itNotes
GOOGLE_API_KEY, OPENAI_API_KEY, OLLAMA_BASE_URLGlobal (Setting)Set via the setup wizard.
EMBEDDING_PROVIDER, EMBEDDING_MODELGlobalOne per deployment.
CHUNK_SIZE, CHUNK_OVERLAPUser override on top of globalPer-user experimentation.
ALLOWED_FORMATSWorkspace override on top of globalLets a workspace narrow or widen what its members can upload.
RAG_TOP_K, RAG_MMR_LAMBDAUser override on top of globalPer-user tuning.

Next steps