Skip to content

✨ feat(settings): local embedding provider + OCR toggle in the admin UI#601

Open
vaayne wants to merge 1 commit into
poc/onnx-runtime-ocrfrom
poc/onnx-runtime-settings
Open

✨ feat(settings): local embedding provider + OCR toggle in the admin UI#601
vaayne wants to merge 1 commit into
poc/onnx-runtime-ocrfrom
poc/onnx-runtime-settings

Conversation

@vaayne

@vaayne vaayne commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

What

Expose the two local-ML controls in the admin settings UI + API, so a local-only
deployment is configurable without touching the DB or env vars:

  • Embedding provider (api | local) on the existing embedding settings page.
  • Local OCR toggle on a new settings page, backed by /api/ocr-settings.

Stacked on #600 (OCR sidecar). Base retargets down the chain to main as the
lower PRs merge.

Why

Phase 3/4 made local embedding + OCR work, but reaching them meant editing the
embedding config row by hand and setting STELLA_LOCAL_OCR. Neither is
discoverable. This makes the whole local-ML story usable from the UI an admin
actually sees.

How

  • Embedding: added provider to the EmbeddingSettings/...Update schemas
    (enum api|local). Handler persists it and only requires an API key for the api
    provider. UI adds a provider Select; choosing Local hides the
    key/base-url/model/dim fields (the built-in e5 model manages them) and the
    normalize toggle (the model already L2-normalizes).
  • OCR: new config.OCRSettings singleton + /api/ocr-settings (admin), a
    Local OCR settings page, and a available flag so the UI warns when the models
    aren't installed. Wiring is now dynamic: the sidecar loads OCR models
    whenever they resolve, and the mlOCR adapter checks the stored toggle per call,
    so enabling/disabling needs no restart. The STELLA_LOCAL_OCR env gate is gone.

OpenAPI-first throughout (generate:api + generate:ts-sdk). EN+ZH i18n added.
Config round-trip tests; the env-gated full-stack OCR integration test now drives
the config toggle instead of the env var (verified: 124 chars extracted with the
toggle on). format && build && test green.

Refs

Surface the two local-ML controls that were previously reachable only via DB
config / env, so a local-only deployment is configurable from the admin UI.

- Embedding: add provider (api|local) to the settings API + a selector on the
  embedding page. Selecting local hides the key/base-url/model/dim fields (the
  built-in e5 model manages them) and drops the api-key requirement.
- OCR: new /api/ocr-settings (config singleton, like embedding), a Local OCR
  settings page, and dynamic wiring — the sidecar loads OCR models when present
  while the mlOCR adapter gates each call on the stored toggle, so enabling or
  disabling needs no restart. Replaces the STELLA_LOCAL_OCR env gate.

OpenAPI-first: spec -> generate:api/ts-sdk -> handlers. EN+ZH i18n. Config
round-trip tests; the env-gated full-stack OCR test now drives the config
toggle. format && build && test green.
@vaayne vaayne marked this pull request as ready for review June 27, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant