Skip to main content
Rehydra provides utilities for managing NER model downloads and cache.

Model Information

Available Models

Model Files

Each model includes:
  • model.onnx - The ONNX model file
  • vocab.txt - WordPiece vocabulary
  • label_map.json - Entity label mapping

Check Model Status

isModelDownloaded()

Check if a model is cached locally.

listDownloadedModels()

List all cached models.

Download Models

downloadModel()

Manually download a model.

ensureModel()

Download if not present, return paths.

Clear Cache

clearModelCache()

Remove cached models.

Cache Locations

getModelCacheDir()

Get the cache directory path.

Node.js Locations

Browser Storage

  • OPFS (Origin Private File System) for model files
  • Data persists across sessions

Semantic Data Management

Similar functions exist for semantic enrichment data:

Download Progress Callback

Example usage:

Pre-Warming

Download models before user interaction:

Model Registry

Access model metadata:

Offline Usage

After initial download, models work offline:

Custom Models

Use your own ONNX model:

Model Requirements

  • Format: ONNX
  • Input: Token IDs, attention mask
  • Output: Logits for BIO-tagged entities
  • Vocab: WordPiece format
See Building Custom Models for details.