ruvnet/ruflo · error

No transformers package available. Install @huggingface/tran

Error message

No transformers package available. Install @huggingface/transformers (preferred) or @xenova/transformers to enable ONNX embeddings.

What it means

Thrown when no transformers package is installed for local ONNX embeddings. Defense: check for the dependency at startup and fail fast with the install instruction, or fall back explicitly to another configured provider.

Source

Thrown at v3/@claude-flow/embeddings/src/embedding-service.ts:393

  private readonly modelName: string;
  private initialized = false;

  constructor(config: TransformersEmbeddingConfig) {
    super(config);
    this.modelName = config.model ?? 'Xenova/all-MiniLM-L6-v2';
  }

  private async initialize(): Promise<void> {
    if (this.initialized) return;

    try {
      // ADR-094: try @huggingface/transformers first (clears the
      // protobufjs <7.5.5 critical RCE chain), fall back to legacy
      // @xenova/transformers for backwards compatibility.
      const { loadTransformersPipeline } = await import('./transformers-loader.js');
      const handle = await loadTransformersPipeline();
      if (!handle) {
        throw new Error(
          'No transformers package available. Install @huggingface/transformers (preferred) ' +
          'or @xenova/transformers to enable ONNX embeddings.',
        );
      }
      this.pipeline = await handle.pipeline('feature-extraction', this.modelName);
      this.initialized = true;
    } catch (error) {
      throw new Error(`Failed to initialize transformers pipeline: ${error}`);
    }
  }

  async embed(text: string): Promise<EmbeddingResult> {
    await this.initialize();

    // Check cache
    const cached = this.cache.get(text);
    if (cached) {
      this.emitEvent({ type: 'cache_hit', text });

View on GitHub (pinned to fa13ee4ad6)

Solutions

  1. Install a transformers package: npm install @huggingface/transformers (preferred) or @xenova/transformers.
  2. Switch provider to 'agentic-flow' or 'openai' (with apiKey) if you cannot install the ONNX runtime.
Defensive patterns

Strategy: fallback

When it happens

Trigger: Thrown at v3/@claude-flow/embeddings/src/embedding-service.ts:393 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ruvnet/ruflo@fa13ee4ad6 (2026-08-18). Data as JSON: /api/errors/8e7b75a2282a6670. Report an issue: GitHub.