|
| 1 | +# Model Hosting Migration — HuggingFace textagent Org |
| 2 | + |
| 3 | +- All ONNX model IDs changed from `onnx-community/` to `textagent/` namespace |
| 4 | +- 7 models duplicated to `textagent` HuggingFace org via `duplicate_repo` API |
| 5 | +- `model-hosts.js` simplified: single HuggingFace CDN, org-based primary/fallback |
| 6 | +- All workers (`ai-worker.js`, `speech-worker.js`, `tts-worker.js`) updated to use `textagent/` models with `onnx-community/` fallback |
| 7 | +- Fixed: removed all GitLab model hosting references from runtime code |
| 8 | +- `mirror-models.sh` retained as GitLab backup utility (downloads from `onnx-community`) |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +## Summary |
| 13 | +Migrated all ONNX model references from `onnx-community` to a self-owned `textagent` HuggingFace organization. Models are server-side duplicated (not re-uploaded), ensuring identical content. If any `textagent/` model is unavailable, workers automatically fall back to the original `onnx-community/` namespace on the same HuggingFace CDN. |
| 14 | + |
| 15 | +--- |
| 16 | + |
| 17 | +## 1. HuggingFace Org Setup |
| 18 | +**What:** Created `textagent` organization on HuggingFace Hub; duplicated 7 ONNX models server-side using `huggingface_hub.duplicate_repo()`. |
| 19 | +**Impact:** TextAgent now owns its model namespace — insulated from upstream renames/deletions by `onnx-community`. |
| 20 | + |
| 21 | +### Models Duplicated |
| 22 | +| Model | Size | URL | |
| 23 | +|-------|------|-----| |
| 24 | +| Qwen 3.5 0.8B ONNX | ~500 MB | `huggingface.co/textagent/Qwen3.5-0.8B-ONNX` | |
| 25 | +| Qwen 3.5 2B ONNX | ~1.2 GB | `huggingface.co/textagent/Qwen3.5-2B-ONNX` | |
| 26 | +| Qwen 3.5 4B ONNX | ~2.5 GB | `huggingface.co/textagent/Qwen3.5-4B-ONNX` | |
| 27 | +| Qwen 3 4B Thinking ONNX | ~2.5 GB | `huggingface.co/textagent/Qwen3-4B-Thinking-2507-ONNX` | |
| 28 | +| Whisper Large V3 Turbo | ~1.5 GB | `huggingface.co/textagent/whisper-large-v3-turbo` | |
| 29 | +| Kokoro 82M v1.0 ONNX | ~80 MB | `huggingface.co/textagent/Kokoro-82M-v1.0-ONNX` | |
| 30 | +| Kokoro 82M v1.1-zh ONNX | ~80 MB | `huggingface.co/textagent/Kokoro-82M-v1.1-zh-ONNX` | |
| 31 | + |
| 32 | +## 2. Model Hosts Configuration |
| 33 | +**Files:** `js/model-hosts.js` |
| 34 | +**What:** Replaced GitLab primary + HuggingFace fallback with single HuggingFace CDN; exports `MODEL_HOST`, `MODEL_ORG` (`textagent`), and `MODEL_ORG_FALLBACK` (`onnx-community`). |
| 35 | +**Impact:** Simplified host config; no more GitLab dependency for model downloads. |
| 36 | + |
| 37 | +## 3. AI Worker Updates |
| 38 | +**Files:** `ai-worker.js`, `public/ai-worker.js` |
| 39 | +**What:** Changed `MODEL_HOST` from GitLab to HuggingFace; fallback now swaps model ID prefix from `textagent/` to `onnx-community/` instead of switching hosts. |
| 40 | +**Impact:** Workers download models from HuggingFace CDN with automatic namespace fallback. |
| 41 | + |
| 42 | +## 4. Speech Worker Update |
| 43 | +**Files:** `js/speech-worker.js` |
| 44 | +**What:** Removed GitLab host; Whisper model ID uses `textagent/whisper-large-v3-turbo` with `onnx-community/` fallback on failure. |
| 45 | +**Impact:** Speech-to-text downloads from HuggingFace with org-based fallback. |
| 46 | + |
| 47 | +## 5. TTS Worker Update |
| 48 | +**Files:** `js/tts-worker.js` |
| 49 | +**What:** Removed GitLab comments; model ID changed to `textagent/Kokoro-82M-v1.1-zh-ONNX`. |
| 50 | +**Impact:** TTS model downloads from textagent HuggingFace org. |
| 51 | + |
| 52 | +## 6. Model Registry Update |
| 53 | +**Files:** `js/ai-models.js`, `js/ai-assistant.js` |
| 54 | +**What:** All `localModelId` values changed from `onnx-community/` to `textagent/` prefix. |
| 55 | +**Impact:** Model selector dropdown and download flows use textagent namespace. |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## Files Changed (10 total) |
| 60 | + |
| 61 | +| File | Lines Changed | Type | |
| 62 | +|------|:---:|------| |
| 63 | +| `js/model-hosts.js` | +12 −11 | Simplified: HF-only, org-based fallback | |
| 64 | +| `ai-worker.js` | +9 −9 | HF host, org-based fallback | |
| 65 | +| `public/ai-worker.js` | +9 −9 | Same as above (public copy) | |
| 66 | +| `js/speech-worker.js` | +11 −10 | HF host, org-based fallback | |
| 67 | +| `js/tts-worker.js` | +3 −6 | Removed GitLab comments | |
| 68 | +| `js/ai-models.js` | +5 −5 | Model IDs → textagent/ | |
| 69 | +| `js/ai-assistant.js` | +1 −1 | Default model ID → textagent/ | |
| 70 | +| `js/ai-actions.js` | +2 −2 | Minor | |
| 71 | +| `js/ai-docgen.js` | +2 −2 | Minor | |
| 72 | +| `js/ai-docgen-generate.js` | +3 −3 | Minor | |
0 commit comments