Skip to content
3 min read · 529 words

@nhtio/adk/batteries/specialists

Environment-neutral aggregate barrel for bundled specialist batteries.

Remarks

Aggregate barrel for the specialists domain: on-device specialist models — speech-to-text (STT), OCR, and image captioning — that run alongside the LLM in the same runtime, Node and browser, rather than delegating to a cloud endpoint. There is no cloud-hosted specialist engine by design: the whole point of this domain is local media understanding a BYO executor can run without another network hop, mirroring how @nhtio/adk/batteries/embeddings favors environment-neutral, locally-runnable engines.

This barrel re-exports each modality's own aggregate barrel in full:

  • @nhtio/adk/batteries/specialists/stt — speech-to-text (transformers.js/Whisper today).
  • @nhtio/adk/batteries/specialists/ocr — optical character recognition (tesseract.js today).
  • @nhtio/adk/batteries/specialists/caption — image captioning (transformers.js today).
  • @nhtio/adk/batteries/specialists/_shared — the structural contracts and normalization helpers (SpecialistMediaLike, isPcmInput, toBytes, defaultDecodeAudio, etc.) shared across all three modalities.

Unlike @nhtio/adk/batteries/embeddings, which excludes its browser/WebGPU-only WebLLM engine from this level of barrel (reachable only via its own subpath), every specialist engine today is environment-neutral — Node and browser both, no WebGPU requirement — so all three modality barrels are re-exported here in full with nothing held back. Should a browser-only specialist engine be added later, it would be excluded from this barrel for the same reason WebLLM is excluded from the embeddings one, and reachable only through its own subpath.

Each adapter class mirrors the embeddings adapters' shape and lifecycle: constructed with options validated by that engine's own Zod schema, exposing the modality's single-purpose method (transcribe, recognize, describe), and reporting model-load progress through the shared @nhtio/adk/batteries/specialists/ocr!BatteryLifecycleHooks contract.

References

BatteryLifecycleBattery

Re-exports BatteryLifecycleBattery


BatteryLifecycleCallback

Re-exports BatteryLifecycleCallback


BatteryLifecycleHooks

Re-exports BatteryLifecycleHooks


BatteryLifecyclePhase

Re-exports BatteryLifecyclePhase


BatteryLifecycleReport

Re-exports BatteryLifecycleReport


CreateTesseractJsModule

Re-exports CreateTesseractJsModule


CreateTesseractJsWorker

Re-exports CreateTesseractJsWorker


CreateTransformersJsCaptionPipeline

Re-exports CreateTransformersJsCaptionPipeline


CreateTransformersJsSttPipeline

Re-exports CreateTransformersJsSttPipeline


DecodeAudioFn

Re-exports DecodeAudioFn


defaultDecodeAudio

Re-exports defaultDecodeAudio


DescribeOptions

Re-exports DescribeOptions


DescribeResult

Re-exports DescribeResult


E_INVALID_TESSERACT_JS_OCR_OPTIONS

Re-exports E_INVALID_TESSERACT_JS_OCR_OPTIONS


E_INVALID_TRANSFORMERS_JS_CAPTION_OPTIONS

Re-exports E_INVALID_TRANSFORMERS_JS_CAPTION_OPTIONS


E_INVALID_TRANSFORMERS_JS_STT_OPTIONS

Re-exports E_INVALID_TRANSFORMERS_JS_STT_OPTIONS


E_TESSERACT_JS_OCR_ENGINE_ERROR

Re-exports E_TESSERACT_JS_OCR_ENGINE_ERROR


E_TRANSFORMERS_JS_CAPTION_ENGINE_ERROR

Re-exports E_TRANSFORMERS_JS_CAPTION_ENGINE_ERROR


E_TRANSFORMERS_JS_STT_ENGINE_ERROR

Re-exports E_TRANSFORMERS_JS_STT_ENGINE_ERROR


isPcmInput

Re-exports isPcmInput


RecognizeOptions

Re-exports RecognizeOptions


RecognizeResult

Re-exports RecognizeResult


SpecialistAudioInput

Re-exports SpecialistAudioInput


SpecialistBytesInput

Re-exports SpecialistBytesInput


SpecialistImageInput

Re-exports SpecialistImageInput


SpecialistMediaLike

Re-exports SpecialistMediaLike


SpecialistPcmInput

Re-exports SpecialistPcmInput


SttSegment

Re-exports SttSegment


TesseractJsModule

Re-exports TesseractJsModule


TesseractJsOcrAdapter

Re-exports TesseractJsOcrAdapter


TesseractJsOcrAdapterOptions

Re-exports TesseractJsOcrAdapterOptions


tesseractJsOcrOptionsSchema

Re-exports tesseractJsOcrOptionsSchema


TesseractJsWorker

Re-exports TesseractJsWorker


toBytes

Re-exports toBytes


TranscribeOptions

Re-exports TranscribeOptions


TranscribeResult

Re-exports TranscribeResult


TransformersJsCaptionAdapter

Re-exports TransformersJsCaptionAdapter


TransformersJsCaptionAdapterOptions

Re-exports TransformersJsCaptionAdapterOptions


TransformersJsCaptionDataType

Re-exports TransformersJsCaptionDataType


TransformersJsCaptionDeviceType

Re-exports TransformersJsCaptionDeviceType


TransformersJsCaptionModelSource

Re-exports TransformersJsCaptionModelSource


transformersJsCaptionOptionsSchema

Re-exports transformersJsCaptionOptionsSchema


TransformersJsCaptionPipeline

Re-exports TransformersJsCaptionPipeline


TransformersJsCaptionProgressCallback

Re-exports TransformersJsCaptionProgressCallback


TransformersJsSttAdapter

Re-exports TransformersJsSttAdapter


TransformersJsSttAdapterOptions

Re-exports TransformersJsSttAdapterOptions


transformersJsSttAdapterOptionsSchema

Re-exports transformersJsSttAdapterOptionsSchema


TransformersJsSttDataType

Re-exports TransformersJsSttDataType


TransformersJsSttDeviceType

Re-exports TransformersJsSttDeviceType


TransformersJsSttModelSource

Re-exports TransformersJsSttModelSource


TransformersJsSttPipeline

Re-exports TransformersJsSttPipeline


TransformersJsSttProgressCallback

Re-exports TransformersJsSttProgressCallback


validateTesseractJsOcrOptions

Renames and re-exports validateOptions


validateTransformersJsCaptionOptions

Renames and re-exports validateOptions


validateTransformersJsSttOptions

Re-exports validateTransformersJsSttOptions