trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
30 lines • 1.13 kB
TypeScript
/**
* Embedding Model
*
* Lazy-loads @huggingface/transformers (v3+) with all-MiniLM-L6-v2 (384-dim).
* Falls back to @xenova/transformers (v2) if the new package is unavailable.
* Model is loaded once on first use and cached for subsequent calls.
*
* @see TRL-18
*/
import { EmbeddingModelConfig } from './types.js';
/**
* Load the embedding model lazily. Returns the feature-extraction pipeline.
* Subsequent calls return the cached pipeline.
*/
export declare function loadModel(config?: EmbeddingModelConfig): Promise<any>;
/**
* Generate an embedding vector for the given text.
* Returns a Float32Array of length `config.dimension` (default: 384).
*/
export declare function embed(text: string, config?: EmbeddingModelConfig): Promise<Float32Array>;
/**
* Generate embeddings for multiple texts in a batch.
* More efficient than calling embed() individually.
*/
export declare function embedBatch(texts: string[], config?: EmbeddingModelConfig): Promise<Float32Array[]>;
/**
* Reset the model singleton. Useful for testing.
*/
export declare function resetModel(): void;
//# sourceMappingURL=model.d.ts.map