Skip to content

feat: replace Voyage AI with local ONNX embeddings (@xenova/transformers)#2

Merged
daniel-harperdb merged 2 commits intomainfrom
feat/local-onnx-embeddings
Mar 17, 2026
Merged

feat: replace Voyage AI with local ONNX embeddings (@xenova/transformers)#2
daniel-harperdb merged 2 commits intomainfrom
feat/local-onnx-embeddings

Conversation

@daniel-harperdb
Copy link
Collaborator

Summary

  • Replaces the voyageai package (Voyage AI voyage-3, 1024-dim) with @xenova/transformers using the Xenova/all-MiniLM-L6-v2 model (384-dim)
  • Embeddings now run fully in-process via local ONNX — no external API key or network call required
  • Model (~23MB) is downloaded once on first call and cached locally

Changes

  • resources.js: swap import, replace getVoyageClient() with getEmbeddingPipeline(), rewrite generateEmbedding() to use extractor(text, { pooling: 'mean', normalize: true })
  • package.json: remove voyageai, add @xenova/transformers: ^2.17.2
  • .env.example: remove VOYAGE_API_KEY, add explanatory comment about local ONNX
  • All 8 test files: replace voyageai mock with @xenova/transformers mock, remove VOYAGE_API_KEY env setup, update dimension assertions (1024 → 384)
  • Docs: update CLAUDE.md, README.md, docs/architecture.md, docs/synapse-design.md

Test plan

  • All 82 tests pass (npm test on Node 24)
  • No remaining voyageai or VOYAGE_API_KEY references in source files
  • Smoke test: npm run dev starts without VOYAGE_API_KEY set

🤖 Generated with Claude Code

daniel-harperdb and others added 2 commits March 17, 2026 16:42
…ers)

Swap Voyage AI (voyage-3, 1024-dim, requires API key) for local ONNX
inference using @xenova/transformers with all-MiniLM-L6-v2 (384-dim).
The model downloads ~23MB on first call and runs in-process with no
external API key required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@daniel-harperdb daniel-harperdb merged commit 4a007a2 into main Mar 17, 2026
2 checks passed
github-actions bot pushed a commit that referenced this pull request Mar 17, 2026
# [0.3.0](v0.2.0...v0.3.0) (2026-03-17)

### Features

* replace Voyage AI with local ONNX embeddings (@xenova/transformers) ([#2](#2)) ([4a007a2](4a007a2))
@github-actions
Copy link

🎉 This PR is included in version 0.3.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant