Skip to content

(CODUX-182) Support custom Hugging Face memory models - #2656

Merged
numnx merged 2 commits into
feature/CODUX-182-speech-input-and-memory-browserfrom
task/feature-codux-182-speech-input-and-memory-browse-t05-codex-mraolsfc
Jul 7, 2026
Merged

(CODUX-182) Support custom Hugging Face memory models#2656
numnx merged 2 commits into
feature/CODUX-182-speech-input-and-memory-browserfrom
task/feature-codux-182-speech-input-and-memory-browse-t05-codex-mraolsfc

Conversation

@numnx

@numnx numnx commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

🧩 Task: Support custom Hugging Face memory models

Automated task PR opened by Code UX for T05.

📋 Summary

Sprint: Sprint 182 · Speech Input and Memory Browser · Task: T05

Add speech-to-text input across the dashboard chat thread composer with local ONNX transcription and external API fallback, package it safely for Electron/npm runtimes, and modernize the Memory page model browser with grouped embedding/TTS models plus custom Hugging Face model links.

🤖 Model & Provider

Provider Codex CLI
Model gpt-5.5

⏱️ Timing

Started 2026-07-07 13:25:20 UTC
Finished 2026-07-07 13:37:08 UTC
Duration 11m 48s

📊 Token Usage

Metric Value
Input tokens 124,618
Cached input tokens 3,961,472
Output tokens 27,539
Total tokens 4,113,629
Invocations 1
Tool calls 79
Active time 10m 37s

Included usage estimate (subscription/local login): $3.43

✅ QA Review

⏳ QA review runs after this PR is opened. Check the task card in the dashboard for the outcome once it lands.

📝 Full Task Prompt
## Objective
Add backend support for custom Hugging Face model links in the memory model catalog while keeping existing built-in embedding model behavior intact.

## Scope
- Edit `src/contracts/memory-types.ts`
- Edit `src/services/embedding-model-catalog.ts`
- Edit `src/services/embedding-model-manager.ts`
- Edit `src/server/memory-routes.ts`
- Edit memory settings defaults, schema, and sanitizer files touched by T01 as needed after consuming its settings contract
- Add or update tests under `tests/backend/services/embedding-model-catalog.test.ts`, `tests/backend/services/embedding-model-manager.test.ts`, and `tests/backend/server/memory-routes.test.ts`
- Update `docs/dashboard/memory.md` and `docs-web/user/dashboard/memory.md`

## Implementation Requirements
1. Add a typed custom embedding model definition with display name, Hugging Face repo or URL, ONNX model file path, tokenizer files, dimension, approximate size, language, and validation status.
2. Persist custom model definitions in settings or another existing durable store so they survive restart and appear alongside built-in models.
3. Add a route such as `POST /api/embedding-models/custom` that validates Hugging Face URLs/repos, rejects non-Hugging Face or malformed links, normalizes repo/path data, and returns the created catalog entry.
4. Update catalog download URL generation to work for both built-in models and custom Hugging Face sources without weakening built-in model validation.
5. Allow `download`, `select`, `delete`, and `status` routes to operate on custom embedding model IDs while preserving current behavior and errors for unknown models.
6. Add tests for valid custom links, invalid links, URL normalization, status listing, custom download URL construction, and existing built-in catalog compatibility.

## Constraints
- Do not build the Memory page UI refactor in this task.
- Do not permit arbitrary HTTP download hosts; custom model links must be Hugging Face URLs or normalized Hugging Face repo identifiers.
- Do not lower embedding dimension validation or allow selecting a custom model before its required files are downloaded.
- Avoid breaking existing memories embedded with built-in model IDs.

## Verification
- Run `pnpm exec vitest run tests/backend/services/embedding-model-catalog.test.ts tests/backend/services/embedding-model-manager.test.ts tests/backend/server/memory-routes.test.ts`.
- Run `pnpm run lint`.
- Success means built-in model tests still pass and custom Hugging Face embedding models can be added, listed, downloaded, selected, and deleted through typed routes.
🌿 Branch Info

Base: feature/CODUX-182-speech-input-and-memory-browser
Head: task/feature-codux-182-speech-input-and-memory-browse-t05-codex-mraolsfc


🤖 Generated by Code UX

@numnx
numnx merged commit 231dcd5 into feature/CODUX-182-speech-input-and-memory-browser Jul 7, 2026
6 checks passed
@numnx
numnx deleted the task/feature-codux-182-speech-input-and-memory-browse-t05-codex-mraolsfc branch July 7, 2026 13: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