How patelvivekdev/voyageai-ai-provider works
Project type and purpose
• This is an open-source TypeScript SDK (a provider plugin) for the AI SDK, named “voyage-ai-provider.”
• Its sole purpose is to expose a simple interface (text/image/multimodal embedding models) that developers call via the generic embedMany function, and under the hood it translates those calls into HTTP requests against the external Voyage AI Embedding API.
File structure
• Top‐level directories & files
• src/ – the implementation of the provider
• example/ – sample usage code
• .github/workflows – CI pipeline
• tsup.config.ts, vitest.*.config.js – build & test configs
• package.json, tsconfig.json – package metadata & TS settings
• src/ contents
• index.ts – entry point, exports factory function
• voyage-provider.ts – core class that holds API key & model factories
• voyage-*-model.ts & voyage-*-settings.ts – adapters for each embedding flavor (text, image, multimodal)
• voyage-error.ts – custom error handling
• Tests (vitest) alongside each model file
README for additional insights
• Explains how to import and configure the provider with an API key
• Shows usage patterns for text, image, and multimodal embedding
• Points to the Voyage AI REST API (the external service)
Elements
[Client App] → [AI SDK Interface] → [Voyage AI Provider Library] → [Voyage REST API]
• Blue for in-process modules (Client/SDK/Provider)
• Green for external service (Voyage REST API)
• Orange for config data store
• Grey for build/CI pipeline (optional, off to the side)
• Annotations for key technologies by component (e.g., “TypeScript”, “node-fetch/axios”, “tsup”, “Vitest”, “GitHub Actions”).
Additional detail
• You may optionally show the directory structure under [Voyage AI Provider] to highlight src/, tests, tsup config, and example/ usage.
• If desired, include a small inset showing the HTTP request format (headers with API key, JSON payload with inputs, JSON response with embeddings).