Overview
Voyage AI’svoyage-multimodal-3 model supports generating embeddings from:
- Single images
- Multiple images combined into one embedding
- Images in various formats (URLs and base64)
Image embeddings use the same multimodal model as text embeddings. Use
imageEmbeddingModel() to create a model instance specifically for image inputs.Basic usage
Generate an embedding for a single image:Image formats
You can provide images in two formats:- Tab Title
- Tab Title
Multiple images per embedding
Combine multiple images into a single embedding to represent related visual content:Combining multiple images creates a single embedding that represents all images together, useful for collections or multi-view representations.
Batch processing
Generate embeddings for multiple images efficiently:Input format options
The image embedding model accepts several input formats:import { createVoyage } from 'voyage-ai-provider';
import { embedMany } from 'ai';
const voyage = createVoyage({
apiKey: process.env.VOYAGE_API_KEY,
});
const { embeddings } = await embedMany({
model: voyage.imageEmbeddingModel('voyage-multimodal-3'),
values: [
'https://i.ibb.co/nQNGqL0/beach1.jpg',
'https://i.ibb.co/r5w8hG8/beach2.jpg',
],
});
import { createVoyage } from 'voyage-ai-provider';
import { embedMany } from 'ai';
import type { ImageEmbeddingInput } from 'voyage-ai-provider';
const voyage = createVoyage({
apiKey: process.env.VOYAGE_API_KEY,
});
const { embeddings } = await embedMany<ImageEmbeddingInput>({
model: voyage.imageEmbeddingModel('voyage-multimodal-3'),
values: [
{ image: 'https://i.ibb.co/nQNGqL0/beach1.jpg' },
{ image: 'https://i.ibb.co/r5w8hG8/beach2.jpg' },
],
});
import { createVoyage } from 'voyage-ai-provider';
import { embedMany } from 'ai';
import type { ImageEmbeddingInput } from 'voyage-ai-provider';
const voyage = createVoyage({
apiKey: process.env.VOYAGE_API_KEY,
});
const { embeddings } = await embedMany<ImageEmbeddingInput>({
model: voyage.imageEmbeddingModel('voyage-multimodal-3'),
values: [
{
image: [
'https://i.ibb.co/nQNGqL0/beach1.jpg',
'https://i.ibb.co/r5w8hG8/beach2.jpg',
],
},
],
});
Configuration options
Customize image embedding behavior with provider options:Available options
inputType
inputType
Type of the input. Defaults to
"query".When specified, Voyage automatically prepends a prompt before vectorizing:query- “Represent the query for retrieving supporting documents: ”document- “Represent the document for retrieval: ”
outputEncoding
outputEncoding
The data type for output embeddings. Defaults to
null.null(default) - Embeddings as a list of floating-point numbersbase64- Base64-encoded NumPy array of single-precision floats
truncation
truncation
Whether to truncate inputs to fit within the context length. Defaults to
true.Set to false to raise an error instead of truncating when inputs exceed limits.Use cases
Visual search
Find similar images by comparing embeddings
Image classification
Categorize images based on semantic content
Content moderation
Detect inappropriate or harmful visual content
Recommendation systems
Suggest related images based on visual similarity
Working with usage data
The embedding response includes token usage for images:Image tokens are calculated based on pixel count and processing requirements.
Error handling
Handle errors when processing images:Best practices
Next steps
Multimodal embeddings
Combine text and images in a single embedding
Text embeddings
Learn about text embedding models
Configuration
Customize provider settings
API Reference
Explore the complete API