✨ feat(settings): local embedding provider + OCR toggle in the admin UI#601
Open
vaayne wants to merge 1 commit into
Open
✨ feat(settings): local embedding provider + OCR toggle in the admin UI#601vaayne wants to merge 1 commit into
vaayne wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
api|local) on the existing embedding settings page./api/ocr-settings.Stacked on #600 (OCR sidecar). Base retargets down the chain to
mainas thelower PRs merge.
Why
Phase 3/4 made local embedding + OCR work, but reaching them meant editing the
embeddingconfig row by hand and settingSTELLA_LOCAL_OCR. Neither isdiscoverable. This makes the whole local-ML story usable from the UI an admin
actually sees.
How
providerto theEmbeddingSettings/...Updateschemas(enum api|local). Handler persists it and only requires an API key for the
apiprovider. UI adds a provider
Select; choosing Local hides thekey/base-url/model/dim fields (the built-in e5 model manages them) and the
normalize toggle (the model already L2-normalizes).
config.OCRSettingssingleton +/api/ocr-settings(admin), aLocal OCR settings page, and a
availableflag so the UI warns when the modelsaren't installed. Wiring is now dynamic: the sidecar loads OCR models
whenever they resolve, and the
mlOCRadapter checks the stored toggle per call,so enabling/disabling needs no restart. The
STELLA_LOCAL_OCRenv 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 && testgreen.Refs